Jump to content

Layer Management - Assigning layers to a Command


rjbrittain11

Recommended Posts

Hey all,

 

I have a question for you. Is it possible to have autocad, im using 2014, assign a layer to a specific command? For example, if I use the command PL and want to draw a polyline, it will automatically switch the layer to a layer that I have designated for a line, such as LINE. Or if i want to create a leader, it will automatically make the layer LEADER the current layer when i type LEADER into the command line?

 

Also, if the layer isn't created yet, it would create the layer and then assign it to the current layer once i type the command. I want to say that I was a previous job years ago and the CAD manager had created a LISP for this. Its fuzzy but I think he did.

 

Anyway, anyone heard of this or has a resource to find out how to do this?

Link to comment
Share on other sites

Try my Layer Director application :)

 

Lee

 

I have been using this one ever since Lee generously provided it to anyone and everyone. Easy to modify for the layers and commands you want included, works very well.

Link to comment
Share on other sites

Thanks for the referral guys! Now, to get it to load and work. I've loaded it into autocad, but it doesn't seem to work. Do I have to turn something else on or off? All i did was go to APPLOAD, found the downloaded routine, then hit load. Anything I am missing? I type TEXT and it doesn't change anything.

Link to comment
Share on other sites

First type LD at the command line, if it is loaded you will see it turn on or off at the command line.

 

Now open the LayerDirector.lsp file and edit the top portion for your needs, like the following

 

(defun LM:LayerDirector nil (vl-load-com)

 (setq *LayerData*
  '(
    ("*TEXT"           "M-ANNO"  7)
    ("*DIM*,*QLEADER"  "M-DIMS" 7)
    ("*VPORT*"         "M-VIEW"  42)
    ("*MVIEW*"         "M-VIEW"  42)
    ("*MLEA*"          "M-ANNO"  7) ;mleader
    ("*NEWOR*"         "M-ANNO"  7) ;newwork custom command
    ("RAY*"           "XLINE"  201) ;
    ("*REV*"           "M-ANNO"  7) ;revcloud
    ("*TABL*"          "M-ANNO"  7) ;table
    ("*WIPEO*"         "M-VIEW"  251) ;wipeout
    ("*XATT*, *WFATT*" "XREF"  7)   ;xref attach
    ("*XLIN*"          "XLINE"  201) ;xline
    ("*XL*"            "XLINE"  201) ;xline
    ("*HATC*"          "M-PATT"   ;bhatch hatch
    )
 )      

 (

Link to comment
Share on other sites

Thanks for the referral guys! Now, to get it to load and work. I've loaded it into autocad, but it doesn't seem to work. Do I have to turn something else on or off? All i did was go to APPLOAD, found the downloaded routine, then hit load. Anything I am missing? I type TEXT and it doesn't change anything.

 

The program is currently set to load automatically on drawing startup - if you want to enable it manually midway through a drawing session, you will need to type 'LDON' as rkent correctly indicates.

 

If you set the application to load on drawing startup (following one of these methods), there is no need to type the command to enable it everytime.

 

I hope it helps!

 

Lee

Link to comment
Share on other sites

I have been using this one ever since Lee generously provided it to anyone and everyone. Easy to modify for the layers and commands you want included, works very well.

 

That's fantastic to hear rkent! -

I'm delighted that you get so much use out of the program. :)

 

Now open the LayerDirector.lsp file and edit the top portion for your needs, like the following

 

(defun LM:LayerDirector nil (vl-load-com)

 (setq *LayerData*
  '(
...
    )
 )

 

FYI, that looks like a snippet from an older version of the program - I updated the program in June of this year to V1.2 to enable more layer properties to be configured for new layers.

 

Cheers,

 

Lee

Link to comment
Share on other sites

That's fantastic to hear rkent! -

I'm delighted that you get so much use out of the program. :)

 

FYI, that looks like a snippet from an older version of the program - I updated the program in June of this year to V1.2 to enable more layer properties to be configured for new layers.

 

Cheers,

 

Lee

 

It definitely makes life easier, and yes I was using the original. I have d/l the newer one and made the changes for my layers. I was wondering today when this thread started if you could add linetypes, and shazam, yes you can and yes you did.

 

Thanks,

 

rkent

Link to comment
Share on other sites

That's fantastic to hear rkent! -

I'm delighted that you get so much use out of the program. :)

 

 

 

FYI, that looks like a snippet from an older version of the program - I updated the program in June of this year to V1.2 to enable more layer properties to be configured for new layers.

 

Cheers,

 

Lee

 

Lee, I've said it before, and I'll say it again, this lisp is, as are you, awesome! Thanks for all you give and do. I was using the old version too, will update it. Everybody should use this one, why wouldn't you? :beer:

Link to comment
Share on other sites

A couple more suggestions you can use menu's, toolbars and palettes to have custom commands that draw specific objects eg drainage pit is two plines on layer drainage-pit. This way if you still want a pline you can still control which layer, maybe also preloaded defuns PLA polyline on layer A, LEA leader on layer A.

Link to comment
Share on other sites

I was wondering today when this thread started if you could add linetypes, and shazam, yes you can and yes you did.

 

8)

 

Lee, I've said it before, and I'll say it again, this lisp is, as are you, awesome! Thanks for all you give and do. I was using the old version too, will update it. Everybody should use this one, why wouldn't you? :beer:

 

Cheers Dadgad - that's very kind of you :)

I've noticed from your other posts that you are a fan of this program :)

Link to comment
Share on other sites

  • 9 years later...

I was wondering if there is a way to set variables such as height and rotation for [D] Text? I have it pointing to the layer and other properties as intended but the variables are stopping this function from working as intended, also is there a way to assign an annotation style as well?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...