AutoCAD LT Discussion Group Search

Thursday, September 6, 2007

Set current layer by selecting object

**EDIT**
It was brought to my attention that I missed something right in front of my eyes. AutoCAD LT 2007already has a button to do this, it's on the LAYER toolbar. But, for those of you with LT versions below 2000 this is a good alternative.
**EDIT**

More DIESEL. I spent a couple days looking & trying to figure out how to set the current layer to an object I picked. Of course with lisp this is fairly simple, but I think I came up with a good alternative for Us LT users.

^C^C_ai_molc;\setenv;CL;$m=$(getvar,clayer);-layer;set;"$m=$(getenv,CL)";;

Also by changing the code a little you can use it to freeze, turn off, lock or unlock a layer.

I hope this is helpful,

Erik

5 comments:

Anonymous said...

MOLC stands for Make Object Layer Current, which if I'm reading your macro description correctly already does what your macro claims to do, without your macro. it's found in LT and full autocad and has been for several versions.

LT2007 and LT2008 already have layer tools for freeze, thaw, lock and unlock, don't they?

Erik said...

I don't claim to be perfect, thanks for pointing that out. Remember that not everyone is on the latest version. Take care

Anonymous said...

Thank you for the clarification, I would recommend deleting this one tip as it does nothing if you can do that here, or rewrite it.

Anonymous said...

Actually since LT2000, sorry if that was not clear.

Chris aka "Shinyhead" said...

Leave the tip! Sometimes seeing how something is done can be great inspiration for doing other things as well.