Community
AutoCAD LT Forum
Welcome to Autodesk’s AutoCAD LT Forums. Share your knowledge, ask questions, and explore popular AutoCAD LT topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Macro Debug Please

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
209 Views, 3 Replies

Macro Debug Please

I've written the following macro to combine two layers into one and purge out the second selected layer. We have trouble here with people using similar layer names and it would be useful to do this. The problem is that it seems to have difficulty remembering the environment variable "newlayer" and only works intermittently. can anyone help with a debug (Dean?)? Obviously the macro should all be on one line, but I can't get it to appear as such here! Thanks in advance. Paul. ^C^C_ai_molc;\setenv;newlayer;$m=$(getvar,clayer);_ai_molc;\-layer;freeze;*;;erase;all;;_oops;change;previous;;properties;la;$m=$(getenv,newlayer);;-layer;thaw;*;set;$m=$(getenv,newlayer);;-pu;la;;n;
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

The trouble is that all the $M='s are evaluated at once.
You need to put " (quotes) around the $M='s to let
them evaluate in levels.

Take a look at Phil Lacy's Diesel page here:
http://www.grapevine.net/~lacy

Conny

paul_t wrote:
>
> I've written the following macro to combine two layers into one and
> purge out the second selected layer. We have trouble here with people
> using similar layer names and it would be useful to do this. The
> problem is that it seems to have difficulty remembering the
> environment variable "newlayer" and only works intermittently. can
> anyone help with a debug (Dean?)? Obviously the macro should all be on
> one line, but I can't get it to appear as such here! Thanks in
> advance. Paul.
> ^C^C_ai_molc;\setenv;newlayer;$m=$(getvar,clayer);_ai_molc;\-layer;freeze;*;;erase;all;;_oops;change;previous;;properties;la;$m=$(getenv,newlayer);;-layer;thaw;*;set;$m=$(getenv,newlayer);;-pu;la;;n;
Message 3 of 4
Anonymous
in reply to: Anonymous

Hi Conny 🙂 Thanx for that. I new I was missing something. Quotes around the full expression as this "$m=$(....)" when I recall the variables solves the problem. I keep forgetting the stupid things! Regards, Paul.
Message 4 of 4
Anonymous
in reply to: Anonymous

And the tricky part is that next level takes two ""$m=$(....)""
The level after that takes four """"$m=$(....)"""".

Conny

paul_t wrote:
>
> Hi Conny 🙂 Thanx for that. I new I was missing something. Quotes
> around the full expression as this "$m=$(....)" when I recall the
> variables solves the problem. I keep forgetting the stupid things!
> Regards, Paul.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost