PDA

View Full Version : Layer macro issue



greatday2882
11th Jul 2011, 11:54 pm
Hey guys. I have a macro in AutoCAD 2010 to make a layer and set its color:

^C^C-layer;m;F-ANNO-REV1;C;RED;;;

Which works perfectly. We have a customer who has a set of spec'd layers, their revisions need to be on "$REVNOTE1". The macro is exactly the same:

^C^C-layer;m;$REVNOTE1;C;RED;;;

But when you run the macro, it completely ignores "$REVNOTE1;" so it sets the new layer as "C", then hangs up on "RED" saying it isn't a valid option.

If you manually run through the macro, it works fine. Is there an obvious variable I’m missing to make it not ignore the $? Thank you for any help! http://www.cadtutor.net/forum/images/icons/icon7.gif

Tyke
12th Jul 2011, 08:32 am
The $ symbol in a macro indicates the start of a DIESEL expression, that's why its ignoring the name. Have you tried enclosing the name in quotation marks - "$REVNOTE1" ? If that doesn't work try $("$REVNOTE1").

I'm not on my AutoCAD computer at the moment so I can't try them out.

SLW210
12th Jul 2011, 01:11 pm
What is the purpose of naming layers with symbols in the name? :?

greatday2882
12th Jul 2011, 03:06 pm
Neither the " " or the $(" ") worked, thank you for the suggestions!

Trust me, i would never use symbols in layer names for this exact reason. We do fire alarm design, and per this customer's spec (our largest customer), everything we draw, goes onto "E-COMM-XXXX" layers. The Revisions are "$REVNOTE(1,2,3,Etc.)" and "$REVCLOUD(1,2,3,Etc.)". They run our drawings thru a standards check, and will kick them back if anything is off. For now, we insert clouds and deltas on our normal layers, and manually change them to theirs. I was attempting to streamline this for our designers.

SLW210
12th Jul 2011, 03:25 pm
Try a ^$ or $$. I would still let the client know about there poor layer naming.

Tyke
12th Jul 2011, 03:26 pm
Can you just leave off the $ symbol and add it to the layer names at the end of the job, or use a LISP or VBA routine to create all the layers that you might need with the $ symbol at the beginning and do a PURGE when the jobs done to get rid of all of the unused layers?

BIGAL
14th Jul 2011, 03:35 am
another way possibly ^C^C(setq layans "$revnote") -layer;m;!layans;C;RED;;;