[LISP] How to read text size in a dimension?

[LISP] How to read text size in a dimension?

iBlachu
Advocate Advocate
414 Views
6 Replies
Message 1 of 7

[LISP] How to read text size in a dimension?

iBlachu
Advocate
Advocate

How to read the height of the text in the dimension selected by the user?

 

I would like the user to indicate the dimension line and the program to read the text height set in it.

0 Likes
415 Views
6 Replies
Replies (6)
Message 2 of 7

ВeekeeCZ
Consultant
Consultant

Maybe it's about time to teach yourself how to find such information.

Start with (dumpallproperties (car (entsel)))

Then you have set/getpropertyvalue functions.

Easy-peasy.

0 Likes
Message 3 of 7

iBlachu
Advocate
Advocate

Not quite, because in the DXF code of the dimension there is no information about the height of the dimension text, only about the style of the dimension.

0 Likes
Message 4 of 7

ВeekeeCZ
Consultant
Consultant

Then use nentsel instead.

 

 

0 Likes
Message 5 of 7

paullimapa
Mentor
Mentor

of course there is...try:

(getpropertyvalue (car(entsel)) "dimtxt")


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 6 of 7

iBlachu
Advocate
Advocate

And is it possible to read the size of the dimension text in the same way as the following example?

  (if (setq ss (ssget '((0 . "DIMENSION"))))
    (command "_.dimoverride" "DIMSE1" "_off" "DIMSE2" "_off" "" ss "")
  )
0 Likes
Message 7 of 7

Kent1Cooper
Consultant
Consultant

@iBlachu wrote:

And is it possible to read the size of the dimension text in the same way as the following example?

  (if (setq ss (ssget '((0 . "DIMENSION"))))
    (command "_.dimoverride" "DIMSE1" "_off" "DIMSE2" "_off" "" ss "")
  )

No.  That's an editing command that can only impose properties.  The one command that can read properties of things is LIST, but for a Dimension its returned information doesn't include the Text height.

 

Besides, that code can work with a selection set of multiple Dimensions, since a property like suppression of an extension line can be imposed on more than one Dimension together.  What would you want from such a set by way of reading their Text height, if that might vary?

 

Your contention in Message 3, if as it seems it's in response to @ВeekeeCZ 's (dumpallproperties) suggestion rather than DXF code information, is incorrect -- see the appropriate property in Message 5.

 

But you are correct about DXF information -- it's quite unexpected that it does not seem to include the Text height.  If the Text Style used has a fixed height, you could get it from that.  I haven't been able to find where it is stored.

Kent Cooper, AIA
0 Likes