TheSwamp

Code Red => .NET => Topic started by: jtoverka on August 07, 2023, 11:53:26 AM

Title: All Text Formatting Codes
Post by: jtoverka on August 07, 2023, 11:53:26 AM
Does anyone know a reference, or could provide a reference to all text formatting codes that one may find in MTEXT or MLeaders?
I am looking for an exhaustive list or something close.
Title: Re: All Text Formatting Codes
Post by: kdub_nz on August 07, 2023, 08:20:25 PM
Perhaps look at for a start:
https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-ECEEF65E-C327-44B8-AFB9-C0ACA2CAEF55

https://adndevblog.typepad.com/autocad/2017/09/dissecting-mtext-format-codes.html

https://www.keanw.com/2010/06/creating-an-autocad-mtext-object-containing-different-colours-using-net.html

https://help.autodesk.com/view/ACDLT/2023/ENU/?guid=GUID-7D8BB40F-5C4E-4AE5-BD75-9ED7112E5967

If you require something specific, please ask.


Regards,
Title: Re: All Text Formatting Codes
Post by: chell12 on January 04, 2024, 01:23:15 PM
Hello;

I am in the same boat as jtoverka, I need a comprehensive list of Mtext codes. A partial list just will not cut it as my task is to take an Mtext string from Autocad and convert it to a formatted string in Revit.

After scouring the internet for some 4 hours now, I think such a reference is not to be found outside of some office at Autodesk.

Michelle
Title: Re: All Text Formatting Codes
Post by: David Hall on January 04, 2024, 01:51:23 PM
I do not have Revit, so I cant test, but what programming options are available in Revit?  Maybe LISP or .Net or even VBA (yes I said that outloud)
Title: Re: All Text Formatting Codes
Post by: David Hall on January 04, 2024, 01:52:43 PM
as a side thought, can you post some of the formatting from Autocad you want to convert?
Title: Re: All Text Formatting Codes
Post by: kdub_nz on January 04, 2024, 02:24:39 PM
Another 2 options

STRIPMTEXT  . . . may be other sources . . need to translate the lisp.
https://www.theswamp.org/index.php?topic=31584.0
https://cadabyss.wordpress.com/2010/01/04/stripmtext-v5-0/

https://www.cadforum.cz/en/text-formatting-codes-in-mtext-objects-tip8640
Title: Re: All Text Formatting Codes
Post by: chell12 on January 04, 2024, 03:35:49 PM
Hello David:

Revit has a variety of programming interfaces: Dynamo (which can include Python nodes), Python via Revit Python Shell, compiled macros, and of course compiled add-ins. After bumping around a bit, I have sortof settled on Python & Revit Python Shell as it is an interpreted language and I have immediate access to Revit model. Unfortunately, RPS is not an environment like visualLisp - no real debugging support.

Note that I can drive Autocad from Revit but I cannot drive Revit from Autocad. So from Revit, I use Autocad's ActiveX interface to get at a DWG file.

Attach is a sample file with some Mtext. This is just a sample from a random file.
Title: Re: All Text Formatting Codes
Post by: David Hall on January 04, 2024, 04:31:31 PM
Good news is we have a Python expert here, who hopefully will see this and maybe can give a few ideas