Author Topic: Mtext {\\Format Codes } ?  (Read 3723 times)

0 Members and 1 Guest are viewing this topic.

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Mtext {\\Format Codes } ?
« on: December 29, 2013, 11:04:32 AM »
There is a list of Mtext codes similar to;

Code: [Select]
(setq sampletxt "{\\C2;\\LEnter Text Here}")

That causes the Text Line to have the desired format.

The above code will make the line "Underlined Yellow text" for example.

Unfortunately I can not locate a list of these codes (I should have saved them the last time I found them...)

Any ideas or links to this would be appreciated.

Bruce

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: Mtext {\\Format Codes } ?
« Reply #1 on: December 29, 2013, 11:09:18 AM »
The documentation offers this, but I'm not convinced that its a complete reference.  :|

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Mtext {\\Format Codes } ?
« Reply #2 on: December 29, 2013, 11:09:40 AM »
Haven't had coffee yet, but would this be useful?

http://msdn.microsoft.com/en-us/library/office/aa140302(v=office.10).aspx
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: Mtext {\\Format Codes } ?
« Reply #3 on: December 29, 2013, 11:22:50 AM »
The documentation offers this, but I'm not convinced that its a complete reference.  :|

Thanks Lee, just what I was looking for.

Bruce

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: Mtext {\\Format Codes } ?
« Reply #4 on: December 29, 2013, 02:15:39 PM »
The documentation offers this, but I'm not convinced that its a complete reference.  :|

I've been trying to Left justify some text lines and Center others to no avail....
This does not appear to be do-able.

Bruce

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: Mtext {\\Format Codes } ?
« Reply #5 on: December 29, 2013, 02:38:17 PM »
The documentation offers this, but I'm not convinced that its a complete reference.  :|

I've been trying to Left justify some text lines and Center others to no avail....
This does not appear to be do-able.

Code - Auto/Visual Lisp: [Select]
  1. (defun c:test ( / p )
  2.     (if (setq p (getpoint "\nPoint for text: "))
  3.         (entmake
  4.             (list
  5.                '(000 . "MTEXT")
  6.                '(100 . "AcDbEntity")
  7.                '(100 . "AcDbMText")
  8.                 (cons 010 (trans p 1 0))
  9.                '(001 . "\\pxql;Left\\P\\pqc;Centered\\P\\pqr;Right")
  10.                '(041 . 12.0)
  11.                '(040 .  1.0)
  12.             )
  13.         )
  14.     )
  15.     (princ)
  16. )

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Mtext {\\Format Codes } ?
« Reply #6 on: December 29, 2013, 03:14:08 PM »
One thing you can do is create the formatting manually then select the MText and look at the Contents property displayed in Property Palette.





From Developer Documentation:
Quote
MText.Contents Property
Accesses the character contents of the MText object. Formatting data used for word wrap calculations is removed before the string is copied.

Quote
MText.Text Property
Accesses the MText contents with formatting removed