The DataCAD Developer Network (DDN) is an online resource for information and support for DCAL® (DataCAD Applications Language) developers as well as anyone interested in creating fonts, toolbars, hatch patterns, or linetypes for use in DataCAD.

Moderator: pjdixit

#75140 by dhs
Tue Nov 06, 2018 3:07 pm
Hi,
To create an entity on a layer that is not the current layer in Classic DCAL I have previously saved the current layer, switched to another layer to create the entity, and then switched back to the saved layer... similar procedure to copy any entity to another (non-current) layer.

This is not possible in D4D as the Lyr_Set procedure does not work. I seem to recall that simply changing the layer in the entity record does not work, so can anybody tell me a method to copy an entity to another layer in D4D ?

Thanks,
David H.
#75143 by David A. Giesselman
Tue Nov 06, 2018 4:02 pm
dhs wrote:... I seem to recall that simply changing the layer in the entity record does not work, so can anybody tell me a method to copy an entity to another layer in D4D ?

Are you calling ent_update after changing the layer field?
#75146 by dhs
Tue Nov 06, 2018 5:53 pm
Dave G wrote: Are you calling ent_update after changing the layer field?

Yes, I am calling ent_update. The following code is from a small test macro that I wrote:
Code: Select all     lyr_create ('Test Layer', lyr_addr);
     mode_init (mode);
     mode_lyr (mode, lyr_curr);
     addr := ent_first (mode);
     if ent_get (ent, addr) then begin
         ent.lyr := lyr_addr;
         ent_update (ent);       // crashes on this call
     end;
     callNone(retval);


It fails on the ent_update call with "DataCAD (internal diagnostics) fault 19 Error from: 736" and crashes out of the drawing.

Who is online

Users browsing this forum: No registered users and 2 guests

About DataCAD Forum

The DataCAD Forum is a FREE online community we provide to enhance your experience with DataCAD.

We hope you'll visit often to get answers, share ideas, and interact with other DataCAD users around the world.

DataCAD

Software for AEC Professionals Since 1984