gmmdinesh Posted September 12, 2017 Posted September 12, 2017 (edited) Hi Everyone I have a lots of Mtext objects in my drawing file (as shown in below image),i want split into two lines (as shown in below image) and manual editing taken more time. i want like this, if I click on the Mtext, the first digits (before /) comes in first line.then (/) should be removed, rest of the texts comes in second line, all text rotation should be zero (0), text height should be 2mm and style should be Aerial Black. Before After Please help me anyone on this. Please let me know is this possible? Thanks in advance Edited September 14, 2017 by gmmdinesh Quote
gmmdinesh Posted September 14, 2017 Author Posted September 14, 2017 Hi Everyone I have a lots of Mtext objects in my drawing file (as shown in below image),i want split into two lines (as shown in below image) and manual editing taken more time. i want like this, if I click on the Mtext, the first digits (before /) comes in first line.then (/) should be removed, rest of the texts comes in second line, all text rotation should be zero (0), text height should be 2mm and style should be Aerial Black. Before [ATTACH=CONFIG]62144[/ATTACH] After [ATTACH=CONFIG]62145[/ATTACH] Please help me anyone on this. Please let me know is this possible? Thanks in advance Quote
hanhphuc Posted September 15, 2017 Posted September 15, 2017 As start point.. (and (setq en (car (entsel))) (setq $ (vla-get-TextString (vlax-ename->vla-object en))) (vla-put-Textstring (vlax-ename->vla-object en) (vl-string-subst "\\P" "/" $)) ) ;have a look at dump properties (vlax-dump-object (vlax-ename->vla-object en)) vla-put-height vla-put-StyleName ;etc.. keep trying yourself Don't know formatting Mtext? Suggestion: manually edit in MTEXT editor ARIAL BLACK etc.. then select entity look at Properties dialog -> TEXT -> Contents it will show format something like: "{\\fArial Black|b0|i0|c0|p34; ....... }" Tips: strcat maybe Unformat is useful before applying any changes my $0.02 Quote
BIGAL Posted September 15, 2017 Posted September 15, 2017 Why did you post it again ! It was answered in other post did you try the code I did. All the answers are there. Administrator please merge. Quote
gmmdinesh Posted September 18, 2017 Author Posted September 18, 2017 Really sorry.. actually the answer thread not shown for me on that day.. Hi hanhphuc I will try your code and get back to you. Thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.