Text field showing layer description

Text field showing layer description

joseZ9KZ7
Contributor Contributor
3,506 Views
6 Replies
Message 1 of 7

Text field showing layer description

joseZ9KZ7
Contributor
Contributor

Hello all,

 

I'm using Autocad 2020 and I would like to insert a Text field that shows the layer description.

 

I know that I can show the layer name but I want to show the layer description.

 

Any ideas?

 

Thank you very much.

0 Likes
Accepted solutions (1)
3,507 Views
6 Replies
Replies (6)
Message 2 of 7

Ed__Jobe
Mentor
Mentor
Accepted solution

I don't think a field is going to be able to do that, but you could place text in the dwg. Here is a lisp that inserts text for all the layers. You could modify it to suit your needs.

Ed


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.
How to post your code.

EESignature

Message 3 of 7

vladimir_michl
Advisor
Advisor

You can display Layer Description in a Text Field but how do you select the layer? Do you want the current layer? Or a selected object's layer? Or a fixed layer?

If you want to display a possibly changing description of a fixed layer, you can just replace the property in the layer (named objects) field code - e.g.:

%<\AcObjProp Object(%<\_ObjId 2097988848992>%).Description>%

 

Vladimir Michl, www.cadstudio.cz - www.cadforum.cz

 

Message 4 of 7

joseZ9KZ7
Contributor
Contributor

It would be the layer description of a selected object.

0 Likes
Message 5 of 7

Anonymous
Not applicable

did you get any success with it? I think i'm trying to do the same thing, i Want to display the layer description but in the Field options i can only find the layer name option. Is it possible in any way?

0 Likes
Message 6 of 7

vladimir_michl
Advisor
Advisor

The layer description is "too far" - you will need to get the name of the layer from the selected object, get the Object ID of that layer and then get its Description property. I doubt this can be done just with fields. But it is quite simple in LISP, and maybe you can also add some kind of reactivity to it.

 

Vladimir Michl, www.cadstudio.cz - www.cadforum.cz

 

Message 7 of 7

gros33
Advocate
Advocate

 

@Anonymous 

You can copy the NamedObject field expression (without the %), paste it and change 'Name' to whatever property you'd like 🙂

For example:

<\AcObjProp Object(%<\_ObjId 3111172414224>%).Color> 

or 

<\AcObjProp Object(%<\_ObjId 3111172414224>%).Description>

 

just add % at the start and end

you're welcomed

0 Likes