Page 1 of 1

Accessing Layers in DCAL

PostPosted: Tue May 20, 2008 9:28 am
by Bob Myles
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!!!!

strings

PostPosted: Wed May 21, 2008 4:52 pm
by Bob Myles
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...