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.
#36189 by Bob Myles
Tue May 20, 2008 9:28 am
Hello,
I need to activeOnly/ turn on three layers based on a users click, so they can act on them later in the macro. I cannot seem to get the logic for the syntax for the Layers on/off commands. Here is what I have benn doing, but this doesn't work. Can someone give me some guidance?

If I use
wrterr(layerName1);
pause (0.5);
in place of the IF statement in the loop all of the layerNames show up, so I think the loop works, it is just the IF statement i am having trouble with...

getesc (key);

IF key = f1 THEN

wrtmsg('1st floor Loading');

lyr := lyr_first;
WHILE NOT lyr_nil (lyr) DO
getlyrname(lyr,layerName1);

if = layerName1='1-Joist' then
lyr_seton (lyr, true, true);
Else
lyr_seton (lyr, false, true);
end;
lyr := lyr_next (lyr);
END;


Help is GREATLY appreciated!!!!
#36245 by Bob Myles
Wed May 21, 2008 4:52 pm
String compare
strcomp(str1,str2,len) results in True/False

Doesn't work:
IF LayerName1 = '1-Joist'

Works:
If strcomp(layerName1,'1-joist',-1) then...

Who is online

Users browsing this forum: No registered users and 11 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 Architects Since 1984