Help with dimension text in autolisp

Help with dimension text in autolisp

DC-MWA
Collaborator Collaborator
821 Views
3 Replies
Message 1 of 4

Help with dimension text in autolisp

DC-MWA
Collaborator
Collaborator

I have a sinple routine I'm trying get done. It uses autocad dimensions and I need to gather user input and change the dimension text with that information.

My autolisp knowledge is very limited so forgive my rooky programming.

See attached...

0 Likes
822 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant

If this is for use in sections, be aware that a routine could calculate what the actual slope is, rather than asking the User for it.  If it's for use in plan view, then I can see a point in what it does.

 

Personally, I would set all those DIMensioning System Variables into a defined Dimension Style, and save whatever is the current Style at the beginning, set the one for this purpose current, do the Dimension, and then restore the previous Style.

 

Also, the DIMALIGNED command will supply its own prompts, if you can live with its offering the select-an-object option that you don't want a User to take.

 

As for the text part, I would build it into  the drawing of the Dimension, with the Text option, rather than drawing it and then modifying it afterwards:

 

(command

  "_.dimaligned" pause pause "_text"

  (strcat (getstring "\nSlope: ") "\\XSLOPE")

  "@"

)

 

Kent Cooper, AIA
0 Likes
Message 3 of 4

scot-65
Advisor
Advisor
Another method:

First gather the user input [and strcat with the suffix].
Add the dimension to the drawing base then,
(setpropertyvalue (entlast) "DimensionText" "User Input Value Here")

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 4 of 4

dbhunia
Advisor
Advisor

Hi,

 

I know you have got solution on this post form your next post.....

 

But I should go with @_gile post....... 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes