Quick select a layer to draw

Quick select a layer to draw

dvrVSNMW
Advocate Advocate
3,927 Views
8 Replies
Message 1 of 9

Quick select a layer to draw

dvrVSNMW
Advocate
Advocate

Hello,

 

I use 5 different layers a lot.

 

Now I always need to go search for the correct layer to use in the dropdown layer menu.

But can I add a button to my screen for the most used layers? So I can click these buttons so I have instant the correct layer?

Or can I add a layer type to a keyboard key ?

 

Regrads,

DVR.

0 Likes
3,928 Views
8 Replies
Replies (8)
Message 2 of 9

makdezines
Advocate
Advocate

Use Laycur command

0 Likes
Message 3 of 9

illusionistNUGXG
Advocate
Advocate

You can change the active Layer with the CLAYER command.

To use it with a button in the ribbon or keyboard-shortcut, you need a macro.

Example:

^C^C_CLAYER;0;

This changes the active layer to 0.

 

If you have more than just numbers as layernames, you need to put the layername in quotations. Example (i have AM_-layers for using AutoCAD Mechanical...therefore...)

^C^C_CLAYER;"AM_4";

This changes the active layer to AM_4.

 

The macro can be assigned in the CUI (customer user interface).

There in the bottom-left block you can create a new command, rename it and put in the macro with the desired layername.

To use it as keyboard-shortcut:

Now in the list of the top-left block, expand the part named Keyboard....uhm...something (-shortcut commands?). Below this should now be "Keyboard shortcuts". Drag and drop the new command from the bottom-left block to here.

Now at the right side of the menu, you can assign a keyboard-shortcut. (use the [...]-box at the right)

 

Assigning it to a button to the ribbon is also possible in the CUI, but that's out of my experience.

 

Oh, by the way...it only works, if the layer is already a part of the drawing. If the layer isn't in the drawing (just activated once - no lines have to be used), it returns an error message.

0 Likes
Message 4 of 9

Kent1Cooper
Consultant
Consultant

@makdezines wrote:

Use Laycur command


I think you mean LAYMCUR.  LAYCUR puts selected objects on the current Layer [it does not change the current Layer]; LAYMCUR makes the Layer of a selected object current.  But LAYMCUR requires having an object drawn on that Layer to select, which you might not always have, or not in the current view.

 

I would suggest macro items in a Tool Palette, as already suggested by @illusionistNUGXG , but with a difference.  The Layer command can be transparent, meaning you can use it in the middle of another command if you have reason to.  [I'm not sure what such a reason might be in the case of LAYER, but there could be some.]  In order to allow that possibility, you can't have the common ^C^C [two Cancels] at the beginning of the macro, and you must use '-LAYER with the apostrophe prefix for transparent use and the hyphen to prevent the dialog box.  Macros like these:

 

'_.-LAYER _Set YourLayer1 ;

'_.-LAYER _Set YourLayer2 ;

'_.-LAYER _Set YourLayer3 ;

 

In case the Layer in question may not exist in the drawing, you can use the _Make option instead of _Set, which will also make it current, and which won't have any problem if the Layer does already exist:

 

'_.-LAYER _Make YourLayer1 ;

'_.-LAYER _Make YourLayer2 ;

'_.-LAYER _Make YourLayer3 ;

 

[The underscores make them work in AutoCAD for any language, and the periods make them use the native command in case there may have been a revised definition of it.]

 

Kent Cooper, AIA
Message 5 of 9

dvrVSNMW
Advocate
Advocate

Thx for the reply's.

 

I never made a macro. Can u pls help me on this ?

 

I came this far:

https://ibb.co/nP631hT

 

But where do I enter the command I want to use? And what type of commands should I use to keep it simple? Like l1, l2, l3, l4,... ?

Are the things I have done already correct ?

0 Likes
Message 6 of 9

Kent1Cooper
Consultant
Consultant

@dvrVSNMW wrote:

....I never made a macro. .... where do I enter the command I want to use? And what type of commands should I use ... Like l1, l2, l3, l4,... ?


From your original message, "...can I add a button to my screen for the most used layers? So I can click these buttons so I have instant the correct layer?" suggests a Tool Palette, in which there would be "buttons" to click on.  Those would contain code as in my previous Reply, and would not require giving a command name to each -- you would just click on the buttons.  But if you want to have command names that you can type in, that's a little different.  They could also be done with keyboard shortcuts [Ctrl+something, Alt+whatever, etc.].  Do you have a preferred method?

Kent Cooper, AIA
0 Likes
Message 7 of 9

dvrVSNMW
Advocate
Advocate

I was simply thinking of naming it lay1, lay2, lay3,...

 

i'll try making buttons as well. Keep u updatet.

0 Likes
Message 8 of 9

ВeekeeCZ
Consultant
Consultant

@dvrVSNMW wrote:

... Or can I add a layer type to a keyboard key ? ...

 

Yes, this is a built-in feature, see HERE  how it works.

 

I recommend turning off all other content but layers -- just to make the search list as clean as possible from items you don't use.

0 Likes
Message 9 of 9

RobDraw
Mentor
Mentor

You can also use objects to set the current layer:

Make Object’s Layer Current (LAYMCUR)

Using this tool will change the current layer by selecting an object as reference. 

 

There's a button for it, too.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
0 Likes