Skip to main content
Is there any way to determine the width (in coordinate units) of AutoCAD multiline text output?

 

 

I need to offset the text to the left for callout tags where the leader line leans to the left of the item they are describing (subtract width amount from x coordinate) - but I have yet to figure a way to extract the "rendered" width of the longest line to do so.
If this is not possible - what is a good way to calculate the longest line (in number of characters) so I can just use that and mutiply by an average width to get close?
Hi,

 

 

have you looked at the StringLengthCalculator?

 

 

David
SLC is in bytes, is it not?

 

 

I use boundingbox on the text attribute and extract its dimensions.

 

You need to (trial and error) adjust the value somewhat.

 

It is very dependant on the font type.

 

Look:

 

 

 

creates:

 

 

 

and zoomed in:

 

 

 

 

There is a tcl/TkCmd Font (wich has for instance Measure function) Wich is in pixels tough.

Reply