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

#73084 by dhs
Mon Jan 15, 2018 4:09 pm
I think that drawing files from DCAD 19 are compatible back to DataCAD 15, but can anybody confirm if the same is true for layer (.dlf) file ? Specifically, Could a layer file created in v19 be imported into a drawing using v15 without any issues ?
David H.
#73087 by dhs
Tue Jan 16, 2018 4:42 pm
I tried installing DataCAD 15 to answer this myself, but was unable to (downloaded from and installed .. I hoped it would give me a trial period as I had never previously had v15 installed, but it immediately said that my trial had expired .... ??).

The reason I am asking this question is that I have developed a way to add entities with features not supported by DCAL by creating a layer file that contains an entity with the desired feature and, and then reading the layer file in my macro and copying and updating the entity with other desired properties that are supported by DCAL. As I am creating my layer file using DataCAD 19, I want to be able to accurately tell potential users the compatibility with previous versions of DataCAD.

If anybody is interested, an example of the logic I am using is below. This example creates a text entity with Knockout (which is not supported by DCAL, although once a text entity with knockout is added the macro can update the Knockout_ENL attribute that specifies the size of the knockout), but I can think of several other cases where similar logic could be used to add things that are not supported by DCAL.

Code: Select allMODULE TextAdd;


PROCEDURE AddTextEnt (ent : IN OUT entity); PUBLIC;

   doKnockOut : boolean;
   templyr : layer;
   newent : entity;
   lyrfilename : str255;
   mode : mode_type;
   svlyr : layer;
   i : integer;
   addr : entaddr;

   doKnockOut := GetSvdBln ('dhBlockerKO', false);
   if doKnockOut then
      ! DCAL does not support knockout, so we need to effectively copy an entity that already has knockout, so we
      ! read a layer file into a temp layer, then copy a text entity with knockout from that layer, and then update
      ! that entity to have the attributes of the entity being added.
      getpath (lyrfilename, pathsup);
      strcat (lyrfilename, 'dhsoftware/Knockout');      ! layer file created as part of the macro installation
      lyr_init (templyr);
      i := lyr_read (templyr, lyrfilename, true, false);
      mode_init (mode);
      mode_1lyr (mode, templyr);
      mode_enttype (mode, enttxt);
      addr := ent_first (mode);
      if ent_get (tempent, addr) then
         ent_copy (tempent, newent, true, true);
         newent.ltype := ent.ltype;
         newent.width := ent.width;
         newent.spacing := ent.spacing;
         newent.ovrshut := ent.ovrshut;
         newent.color := ent.color;
         newent.attr := ent.attr;
         newent.txtPnt := ent.txtpnt;
         newent.txtSize := ent.txtSize;
         newent.txtAng := ent.txtAng;
         newent.txtSlant := ent.txtSlant;
         newent.txtAspect := ent.txtAspect;
         strassign (newent.txtStr, ent.txtStr);
         newent.txtBase := ent.txtBase;
         newent.txtHite := ent.txtHite;
         strassign (newent.txtFont, ent.txtFont);
         ent_update (newent);
         if not ent_get (ent, newent.addr) then
            ent_add (ent);     ! just in case there was a problem, create the entity in the normal way
      lyr_term (templyr);
      ent_add (ent);
END AddTextEnt;

END TextAdd.
#73088 by Roger D
Tue Jan 16, 2018 4:49 pm
I'll try to check that out when at my other computer, has versions from X3 on.
#73091 by Roger D
Wed Jan 17, 2018 9:16 am
appears to work, see your pm.

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.


Software for AEC Professionals Since 1984