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

#71579 by dhs
Wed May 24, 2017 3:18 pm
I think I already know the answer to this, but hopefully I'm wrong:

Is it possible for a DCAL macro to see entities that are on a locked layer ?

I would have expected to be able to read them but not to update or add anything on a locked layer, but getmode does not appear to return anything from a locked layer, and also trying to read a selset (that had been set up before the layer was locked) does not return the entities. Is there any way to get them ?

I did a search for the word 'lock' in all the dcal documentation, but all I found was a couple new procedures relating to symbol lock size, so I am assuming that DCAL has no functionality relating to layer locking (other than being able to display function keys with struck through text)
#71580 by David A. Giesselman
Wed May 24, 2017 3:42 pm

How are you initializing the mode_type variable?

#71582 by dhs
Wed May 24, 2017 4:14 pm
Hello Dave,

Nothing unusual about the way I was initialising, but it looks like I was partly wrong:

My post was based on testing using a drawing with about 50,000 entities on the locked layer. With this file my macro cannot get any of the entities on the locked layer, but can access them if I unlock the layer.
Testing on a file with just a handful of entities, I can access these entities on a locked layer.

The file I was originally testing may be a bit extreme (array copy of exploded 3D entities created for testing the shadow macro), but the reason I was testing was because an architect had tested the macro and reported that he could not cast shadows of entities on locked layers. Presumably he was using a 'real' file, so the symptom is not just limited to my test file...
#71583 by David A. Giesselman
Wed May 24, 2017 5:20 pm

Upon which layer are the shadow polygons created? Does your macro attempt to modify (in any way) the entities that are considered to cast shadows?

Also, please check your private messages here on the forum.

#71584 by dhs
Wed May 24, 2017 11:50 pm
Hi Dave,
My test drawing only has 4 layers. Only 2 of them are on. Of these the locked layer has approx. 50k entities and there are no entities on the other layer. I cannot run a macro from the locked layer, so it is run from the other layer. The locked layer is ON (obviously). I wrote the following code to test it:
Code: Select allPROGRAM Test;

PROCEDURE msg_OK (msg : str255); BUILTIN 245;

   res, key, i   : integer;
   ent   : entity;
   mode : mode_type;
   addr : entaddr;
   str : str255;
      res := getmode ('to count', mode, key);
      if res = res_normal then
         addr := ent_first (mode);
         i := 0;
         WHILE ent_get (ent, addr) DO
            addr := ent_next (ent, mode);
            i := i+1;
         cvintst (i, str);
         msg_OK (str);
   until res = res_escape;
END Test.

When I run this code if I try to select anything from the locked layer by entity or group then it simply says 'The point entered is too far from an entity'. If I select by area or fence then the test macro returns a count of 0.

If I unlock the layer then I can select entities and the macro returns the expected count.

#71734 by dhs
Sun Jun 25, 2017 5:21 pm
Am I just to assume that this is a known bug with DataCAD?

I no longer have the test drawing where this was occurring and cannot reproduce the problem at this stage. Out of interest, it was not just the DCAL macro that had problems with the entitites on the locked layer .... I could not even identity them using the DataCAD interface.

I will raise this issue again if I reproduce it in the future.

David H

Who is online

Users browsing this forum: No registered users and 1 guest

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