Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Macro to turn off all layers containing certain words

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
tony_prall
250 Views, 4 Replies

Macro to turn off all layers containing certain words

tony_prall
Observer
Observer

Hello, new to using macros and stumbling through this, I have a client that i do work for and every file always has certain layers i need to turn off, example i normally do *cat*  in the search to show all the layers with that word in it and select all turn off, then *dim* do the same, so forth and so on, is there a way to make a macro where i hit one button and it goes through all the layers with certain key words and turn them off? 

tony_prall_0-1700615097225.png

tony_prall_1-1700615144995.png

this is the 6 i always have to turn off and freeze.

 

0 Likes

Macro to turn off all layers containing certain words

Hello, new to using macros and stumbling through this, I have a client that i do work for and every file always has certain layers i need to turn off, example i normally do *cat*  in the search to show all the layers with that word in it and select all turn off, then *dim* do the same, so forth and so on, is there a way to make a macro where i hit one button and it goes through all the layers with certain key words and turn them off? 

tony_prall_0-1700615097225.png

tony_prall_1-1700615144995.png

this is the 6 i always have to turn off and freeze.

 

4 REPLIES 4
Message 2 of 5
cadffm
in reply to: tony_prall

cadffm
Consultant
Consultant

The command is 

-LAYER

Type in, press enter and you will see the syntax.

 

Example:

'-LAYER;freeze;*dim*;;

 

 

For example, to

Sebastian

0 Likes

The command is 

-LAYER

Type in, press enter and you will see the syntax.

 

Example:

'-LAYER;freeze;*dim*;;

 

 

For example, to

Sebastian

Message 3 of 5
tony_prall
in reply to: cadffm

tony_prall
Observer
Observer

so could i just type in 

 

'-LAYER;freeze;off;*dim*;*zon*;*aisle*;*text*;*sect*;*cat*;lab*;;

 

 

and that would do them all for me? or does it not work that way?

0 Likes

so could i just type in 

 

'-LAYER;freeze;off;*dim*;*zon*;*aisle*;*text*;*sect*;*cat*;lab*;;

 

 

and that would do them all for me? or does it not work that way?

Message 4 of 5
Kent1Cooper
in reply to: tony_prall

Kent1Cooper
Consultant
Consultant
Accepted solution

@tony_prall wrote:

so could i just type in 

'-LAYER;freeze;off;*dim*;*zon*;*aisle*;*text*;*sect*;*cat*;lab*;;

and that would do them all for me? or does it not work that way?


Freeze and Off are separate options in a Layer command.  No reason to turn them off if they're frozen, really.  Multiple Layer names [including those with wildcards] that you want to apply the same option to need to be comma-delimited:

'-LAYER;freeze;*dim*,*zon*,*aisle*,*text*,*sect*,*cat*,lab*;;

If you do want to also turn them off, you need to invoke the Off option and list them again under that.  But at least you can combine multiple options within one Layer command:

'-LAYER;freeze;*dim*,*zon*,*aisle*,*text*,*sect*,*cat*,lab*;off;*dim*,*zon*,*aisle*,*text*,*sect*,*cat*,lab*;;

Kent Cooper, AIA


@tony_prall wrote:

so could i just type in 

'-LAYER;freeze;off;*dim*;*zon*;*aisle*;*text*;*sect*;*cat*;lab*;;

and that would do them all for me? or does it not work that way?


Freeze and Off are separate options in a Layer command.  No reason to turn them off if they're frozen, really.  Multiple Layer names [including those with wildcards] that you want to apply the same option to need to be comma-delimited:

'-LAYER;freeze;*dim*,*zon*,*aisle*,*text*,*sect*,*cat*,lab*;;

If you do want to also turn them off, you need to invoke the Off option and list them again under that.  But at least you can combine multiple options within one Layer command:

'-LAYER;freeze;*dim*,*zon*,*aisle*,*text*,*sect*,*cat*,lab*;off;*dim*,*zon*,*aisle*,*text*,*sect*,*cat*,lab*;;

Kent Cooper, AIA
Message 5 of 5
tony_prall
in reply to: Kent1Cooper

tony_prall
Observer
Observer

awesome thanks Kent, that works great!

0 Likes

awesome thanks Kent, that works great!

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report