MACRO: Change Layer of Object

lukas.nagiller
Participant
Participant

MACRO: Change Layer of Object

lukas.nagiller
Participant
Participant

Hey guys! 

 

I need your help please.. I'm new to macros and I need a macro which changes the layer of the current selected object(s) in AutoCAD LT..

 

And optional.. Maybe is it possible to check if an object is already selected with an "if" in the macro?

 

Please it have to be AutoCAD LT compatible.. No LISP..

0 Likes
Reply
Accepted solutions (1)
1,883 Views
8 Replies
Replies (8)

lukas.nagiller
Participant
Participant

Hey guys! 

 

I need your help please.. I'm new to macros and I need a macro which changes the layer of the current selected object(s) in AutoCAD LT..

 

And optional.. Maybe is it possible to check if an object is already selected with an "if" in the macro?

 

Please it have to be AutoCAD LT compatible.. No LISP..

0 Likes

ВeekeeCZ
Consultant
Consultant

LAYMCH or LAYCUR are built-in commands that should serve your purpose.

0 Likes

h_s_walker
Mentor
Mentor

Use the CHPROP command.

CHPROP
Select objects: LAST 1 found

Select objects:
Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: LAYER
Enter new layer name <STANDARD_TEXT>: REINFORCEMENT

The above changes the layer of the last object drawn

Also see the link below

CHPROP (Command) | AutoCAD 2021 | Autodesk Knowledge Network

 

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes

lukas.nagiller
Participant
Participant

Hi! Thanks for the really fast response.. unfortunately I can't get the macro to work rather I got not enough time to figure out how does this work.. and is there a method to check if on object is already selected or not?
Thanks for your help!

0 Likes

pendean
Community Legend
Community Legend
Select the objects.
Use the LAYER pulldown to change their layer.

Done.

Takes just as long to do as hunting and pecking at a macro button in LT. Try it.

0 Likes

h_s_walker
Mentor
Mentor
Accepted solution

@pendean is the easiest way, but if you really want a macro

^C^C_.select \_.change previous ;properties layer reinforcement;

The above will allow you to select objects until you finish and will then change the layer to "reinforcement". Obviously you need to change "reinforcement" to your layer

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes

lukas.nagiller
Participant
Participant
I know I could get it from pulldown but we got like 200 layers in our company.. So to make the technicians life easier I make them a custom ribbon with the most important layers..

Thanks its working and my techicians will thank you!
0 Likes

pendean
Community Legend
Community Legend
@lukas.nagiller LAYMCUR or CLAYER then LAYCUR on the objects to "move" is the method we train our users to employ instead of hunting/pecking on a dozen+ custom macro buttons in a unique panel or toolbar: they learn AutoCAD in the process too.

You might want to teach them to use SETBYLAYERMODE (System Variable) as well to "fix" blocks that don't conform.

Those buttons already exist.

HTH
0 Likes