PDA

View Full Version : Undocumented Codes for MTEXTs



Michaels
12th Sep 2010, 10:55 am
Hello,

In my codes below, I have a very nice codes that control with Mtext's contents
which are highlighted in red.

I looked for the rest but without a result. So anybody have any please ?



(vl-load-com)
(setq MyCadDocs (vla-get-activedocument (vlax-get-acad-object)))
(setq pt (getpoint "\n Specify point for text :"))
(vla-put-attachmentpoint (vla-addmtext (vla-get-modelspace MyCadDocs)
(vlax-3d-point pt)
0
"{\\C230 Michaels \\C5;!}")
acattachmentpointmiddlecenter)


many thanks.

Michaels

Lee Mac
12th Sep 2010, 10:59 am
Firstly, the acAttachmentPointMiddleCenter is just the enum for vla-put-AttachmentPoint - look it up in the ACAD Dev Help.

As for the "{\\C230" etc, these are the dreaded MText formatting codes, and there are a multitude of codes that can appear.

Here is a small reference:

http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%202010%20User%20Documentation/index.html?url=WS1a9193826455f5ffa23ce210c4a30acaf-63b9.htm,topicNumber=d0e123454

Here is another diagram that I constructed for my own reference:

http://www.theswamp.org/screens/leemac/Formatting%20Codes.png

Michaels
12th Sep 2010, 11:05 am
As usual you are always in the front. :)

I thought that I would not get any about my thread. but you always breaking the record Lee.

Thank you so much.

Michaels

Michaels
12th Sep 2010, 11:47 am
It's a very nice and kind of you to share your own works with the others, I do thank you from my heart.

I followed you uploaded Cad help and I found it in mine.:)

And the (vla-put-AttachmentPoint) is really great to get use with it from now on .

Thank you Lee for your special Help.

Michaels.

Lee Mac
12th Sep 2010, 05:20 pm
You're welcome Michaels, happy to provide assistance :)