MText mixed justification

MText mixed justification

Anonymous
Not applicable
2,306 Views
4 Replies
Message 1 of 5

MText mixed justification

Anonymous
Not applicable

Hello everyone,

 

I tried to create Mtext with mixed alignment, but up to now only find the possibility to align the whole text block by following code:

 

Set InsrtTXT = AcadApp.ActiveDocument.ModelSpace.AddMText(InsrtPnt, 50, TXTString)

InsrtTXT.AttachmentPoint = acAttachmentPointBottomRight 

But I want the text like this:

Line 1: Profile-No. 12345_1_Ä2

Line 2:                        RWXXXX

 

One possibility of course would be to split the text into smaller peaces, but I don't want to do this. Especially because the MText Editor within Autocad allows me exactly to do what I want.

 

Thanks in advance.

 

Lars

 

 

0 Likes
Accepted solutions (1)
2,307 Views
4 Replies
Replies (4)
Message 2 of 5

Ed__Jobe
Mentor
Mentor

You need to edit the text string using mtext format codes.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 5

Anonymous
Not applicable

Thanks Ed that is obviously a good idea, but up to now I only found parameters to align to Bottom, Center or Top by putting \A+No. in front of the text.

 

What do you have to use for horizontal alignment?

0 Likes
Message 4 of 5

Ed__Jobe
Mentor
Mentor
Accepted solution

Format some mtext how you want it. Then select it and look at its Contents property in the Properties palette. This help topic might help some.

 

If  you're having trouble seeing the format codes, you can switch the editor to Notepad by setting MTEXTED to "notepad".

 

Specify an Alternate Text Editor

  1. At the Command prompt, enter MTEXTED.
  2. At the prompt do one of the following:
    • Enter the path and name of the executable file for the ASCII text editor that you want to use to create or edit multiline text.
    • Enter Internal to restore the text editor.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 5 of 5

Anonymous
Not applicable
Hello Ed,

thanks you ver much for your help! That was quite helpful answer.

By using "{\P\pql;Text}" you could align single line left. Replacing "l"
through "r" you get IT to the right.
0 Likes