Mtext width on the screen

Mtext width on the screen

sunlight1
Enthusiast Enthusiast
334 Views
3 Replies
Message 1 of 4

Mtext width on the screen

sunlight1
Enthusiast
Enthusiast

Hi all, 

I have some Mtexts and lines below them, 
some of the Mtext is 1 line, some of them in 2 lines, 

but the line below them is extended to much.

im trying to "trim" the line below, to fit to the Mtext above it. 
the Mtext loacation on the right is always in the same place, 

so i will take the width of the Mtext and change only the line length.

i have all the elements objects, 

i tryed to use assoc 42 but didnt know how to calculate that. 

for example, 

for 2 lines Mtext -  ASSOC (42 . 0.0787402) and my actual Mtext on screen is 10.1 units. (for text hight 1)

for 1 line Mtext - ASSOC  (42 . 0.0309128)

both of them has same hight, style and all, just a different string, and the fact that they split to 1 and 2 lines

 

does anyone know how to get that width? length on screen? 

 

 

 

 

 

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

Moshe-A
Mentor
Mentor

@sunlight1 ,

 

Post a sample dwg with that issue.

 

Moshe

0 Likes
Message 3 of 4

sunlight1
Enthusiast
Enthusiast

i think i know what is the problem, 
when i made the file to upload, i changed the Mtext to English and checked again. 

and it was fine. 

i think the style was the problem. 

anyway, since uve asked, i upload both of them so u can see yourself
and myb u will have any thoughts of it.  
i guess i need to change the object style, 
get the Mtext width 

trim the line

and then restore to the old style

0 Likes
Message 4 of 4

Moshe-A
Mentor
Mentor

@sunlight1,

 

you also have two other options:

 

1. (textbox) function, classic  AutoLISP

 

2. (vla-get-boundingbox) ; funcrion, VisualLISP

 

Moshe

 

0 Likes