Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing the Text in a Dimension

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
dwcouch123
1548 Views, 3 Replies

Changing the Text in a Dimension

I should know this, but it escapes me.  I want to override the measurement in a dimension with a string of text using a LISP command.

 

E.g.. "select dimension"

type new text for dimension

replace dimension measurement with new text. 

 

I can get the entity and its values, buy not sure which value to change for the "text override".

 

BTW Acad 2012.

 

Any help would be appreciated.

 

Dave

3 REPLIES 3
Message 2 of 4
Kent1Cooper
in reply to: dwcouch123


@DCouch wrote:

....  I want to override the measurement in a dimension with a string of text using a LISP command.

....

I can get the entity and its values, buy not sure which value to change for the "text override".

....


There are at least a couple of ways to do that:

 

(entmod

  (subst

    (cons 1 YourNewTextContentVariable)

    (assoc 1 YourEntityData)

    YourEntityData

  )

)

 

or convert it to a VLA object, and do:

 

(vla-put-TextOverride YourVLAObject YourNewTextContentVariable)

 

And there may be others....

Kent Cooper, AIA
Message 3 of 4
dwcouch123
in reply to: Kent1Cooper

Perfect. Thank you very much. David Couch Walden & Associates 2552 White Road, Suite B Irvine, CA 92614 949-660-0110 Fax: 949-660-0418 www.waldenassociates.com
Message 4 of 4
Kent1Cooper
in reply to: dwcouch123


@DCouch wrote:

I can get the entity and its values, buy not sure which value to change for the "text override".

....


Perfect. Thank you very much. ....

You're welcome.  The easy way to identify which value to change for anything is to draw something, give the characteristic of it that you want to identify a distinctive value, and look at the entity data to find that value.  So if you draw a dimension, and override its text content in the Properties Box or by way of a text-editing command -- let's say you change it to say "Text override" -- and then apply (entget) to it, you'll find this entry in the entity data:

 

(1 . "Text override")

 

That will tell you that it's the DXF code 1, or (assoc 1) value, or however you want to describe it, that holds that information.

 

I suggest a distinctive value particularly for the case of numerical entries.  For instance, if you want to know what DXF entry holds the Thickness of an entity, draw one and change its Thickness in the Properties Box or by way of CHPROP.  But don't change it to something like 1 or 1.0, because there may be a variety of DXF entries that have that in them, just as there may be several that have 0.0 in them, so you may not be able to tell which one it is if you leave its Thickness at 0.  Change it to something out-of-the-ordinary lke 1.2345, and it will be easy to locate it in the entity data list [Thickness is 39].

Kent Cooper, AIA

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

Post to forums  

Autodesk Design & Make Report

”Boost