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

assigning layers to commands

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
bengee54
882 Views, 8 Replies

assigning layers to commands

hi, can someone please tell me how to assign layers to different commands? for example I'd like all viewports to be drawn in the layer AM_VIEWS.

 

I used to be able to do this, but following a reset of my CAD software, new viewports are drawn in the current layer.

 

Also, how would i get all my dimensions drawn in a certain layer? 

 

 

8 REPLIES 8
Message 2 of 9
hwalker
in reply to: bengee54

I've just had a look online and this is what I've found

 

^C^C-layer;Set;0;;

 

The 0 is for layer 0. I then assume at the end you put your command.

 

As to the dimensions. I've set myself up a tool palette with all the dimension commands in it. In tool palettes you can set which layer an object appears on, so all my dimensions (using the tool palette) automatically go on the dimensions 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

Message 3 of 9
AcadAdamLT
in reply to: hwalker

^C^C-Layer;set;*Layer*;;^C^C_Dimlinear;

This command changes the current layer to specified layer.

 

^C^C-Layer;make;*layer*;;^C^C_Dimlinear;

This command creates a new layer with specified name and changes the current layer to your new layer.

Signature, sincerely... //Adam
AutoCad LT 2016
Give Kudos where credit is due, Mark "accepted as solution" if the post solved your question.
Message 4 of 9
pendean
in reply to: bengee54

>>>...following a reset of my CAD software...<<<
So you did not have your customizations or add-ons backed up? Simply restore them if you did back them up: hate to think you were flying by the seat of your pants with something so important.
What did you use for the feature? click on a button? type something unique?
Your post sure is light on details about what you used to do, how you used to do it, and where it all came from.
Message 5 of 9
doni49
in reply to: bengee54

If it were me, I'd prefer to stay away from doing it via menu macros.  I would be inclined to redefine the command itself.  This way whether you run the command via command line OR menu, it would perform as expected.

 

In the appropriate acad*.lsp file (there are many to choose from depending upon your setup):

 

(command "undefine" "MVIEW")

(defun c:mview()

 

  (command

    "-layer" "s" "AM_VIEW" ""    ;sets the layer current, assumes the layer exists. 

                                                 ;This could be developed further to create the layer if it doesn't already exist

 

    "-MVIEW"                              ;this starts the mview command so that you can create the viewport. 

                                                  ;The hyphen tells acad to use the OOTB (undefined version of the command). 

  )

)

 

 

P.S. What Dean said.    ^^^^^^^^



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

Message 6 of 9
dgorsman
in reply to: bengee54

The "AM_" prefix on the layer name gives a hint - you were using AutoCAD Mechanical before.  Are you still using that, or are you using vanilla AutoCAD?  Mechanical and other vertical AutoCAD products have built in tools for (among many other things) layer control.  If you are now running vanilla AutoCAD you will need to create your own customizations.  If you are still using Mechanical, I would suggest visiting the Mechanical board for set-up suggestions: http://forums.autodesk.com/t5/AutoCAD-Mechanical-General/bd-p/39

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 7 of 9
dgorsman
in reply to: doni49

Modifying any of the ACAD####.LSP files isn't recommended.  User customizations should be in either ACAD.LSP or ACADDOC.LSP (note the lack of version numbers).  These are not provided with AutoCAD, and are user-created.  Updating, patching, etc. won't molest these files.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 8 of 9
GrantsPirate
in reply to: bengee54

I use a lisp program with reactors made by the talented Lee-Mac, called LayerDirector.lsp http://www.lee-mac.com/layerdirector.html While there think about a small donation, he provides some pretty sophisticated programs without asking for payment.

GrantsPirate
Piping and Mech. Designer
EXPERT ELITE MEMBER
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.

Message 9 of 9
rkmcswain
in reply to: GrantsPirate


@GrantsPirate wrote:
I use a lisp program with reactors made by the talented Lee-Mac, called LayerDirector.lsp http://www.lee-mac.com/layerdirector.html While there think about a small donation, he provides some pretty sophisticated programs without asking for payment.

I came to this thread to say exactly what @GrantsPirate said here ^^^^^^

 

R.K. McSwain     | CADpanacea | on twitter

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

Post to forums  

Autodesk Design & Make Report

”Boost