Oops, I just re-read your request. Sorry, I thought you wanted to add a
description. You can't get to the description thru regular AutoLisp, you
have to use Vlisp (activeX calls to the object model itself)
It's almost the same code to get the description: (use a get instead of a
put)
the following would be inserted just after your setting of AA
(setq acadDocument (vla-get-activedocument (vlax-get-acad-object)))
(setq theLayers (vla-get-layers acadDocument))
(setq layObj (vla-item theLayers AA)) ;; the layer name you selected
(setq descriptString (vla-get-description layObj))
then you can add the string to your strcat at the end.
Of course, if you want, you can access the other properties of the layer at
the same time with:
(setq layColor (vla-get-color layObj)) ;; same as your A62
or
(setq layLT (vla-get-linetype layObj)) etc.
bytheway, your vars A2 and LYRNAME are not necessary, as AA already is bound
to the name.
If you want to get nested layers, look into using nentsel instead of entsel.
oh, and your defun statement first line should read: (defun C:LID ( / )
[with your variable names after the slash]
good luck,
- the OF
"KDispoto" wrote in message
news:5748046@discussion.autodesk.com...
I appreciate the help - Being that I barely get by with lisp - I am not
familiar with vlisp (although I won't mind trying it here).
Using your code - what is the variable that contains the layer description
(vla-put-description layObj )?
"the Other Frank" wrote in message
news:5747942@discussion.autodesk.com...
here's a few snippets of vlisp to get you going.
(setq acadDocument (vla-get-activedocument (vlax-get-acad-object)))
(setq theLayers (vla-get-layers acadDocument))
(setq layObj (vla-item theLayers AA)) ;; the layer name you selected
(vla-put-description layObj "This is the layer description")
- the OF
"KDispoto" wrote in message
news:5747872@discussion.autodesk.com...
Ultimately I'd like to add the user defined layer "description" (as it
appears at the far right side of the layer properties dialog box) to the
LID.lsp routine below so that when I select a single object, whether it be a
base dwg object or an xreference object, the description would show in the
screen message.
(defun C:LID/)
(setvar "cmdecho" 0)
(setq AA (cdr (assoc 8
(entget (car (entsel "Select entity to set layer: "))))))
(setq EL (tblsearch "layer" AA))
(setq A2 (cdr(assoc 2 EL)))
(setq A62(cdr(assoc 62 EL)))
(setq LYRNM A2)
(setq LYRCLR (rtos A62 2 0))
(setq MSG (strcat "Layer: " LYRNM "\n" "\nLayer color: " LYRCLR))
(alert MSG)
)
"gert" wrote in message
news:5747887@discussion.autodesk.com...
what do you mean with layer description?
all layer names of a open drawing
all layer names of a selected xref
KDispoto wrote:
> Using autolisp - how can I obtain the layer description of a selected
> drawing or xreference object?