Results 1 to 3 of 3

Thread: Differences in content of Mtext returned

  1. #1
    100 Club
    Join Date
    2003-11
    Location
    Dublin, Ireland.
    Posts
    152
    Login to Give a bone
    0

    Default Differences in content of Mtext returned

    Hi,
    I am looking to extract the contents of a piece of mtext.
    Would anybody have any ideas why, when using this line of code to select mtext :

    (setq AddText (cdr (assoc 1 (entget (car (entsel "nPlease Select Text :"))))))

    that it returns a value of : {fArial|b0|i0|c238|p34;C}11 on some pieces of mtext
    and in other cases it returns the contents of the text without all without all the stuff
    between the {}, which is what I am actually looking for?

    I have attached a sample of two pieces of mtext to demonstrate.

    Thanks in Advance.

    John
    Attached Files Attached Files

  2. #2
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Differences in content of Mtext returned

    Look in the help files for formatting MText. The string contains the formatting that is applied to the MText object.

  3. #3
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Hartford, Michigan
    Posts
    3,194
    Login to Give a bone
    0

    Default Re: Differences in content of Mtext returned

    Quote Originally Posted by jmcshane
    Hi,
    I am looking to extract the contents of a piece of mtext.
    Would anybody have any ideas why, when using this line of code to select mtext :

    (setq AddText (cdr (assoc 1 (entget (car (entsel "nPlease Select Text :"))))))

    that it returns a value of : {fArial|b0|i0|c238|p34;C}11 on some pieces of mtext
    and in other cases it returns the contents of the text without all without all the stuff
    between the {}, which is what I am actually looking for?

    I have attached a sample of two pieces of mtext to demonstrate.

    Thanks in Advance.

    John
    Try part of this, I use it to strip text in tables to the default font
    Code:
    (foreach dp EntDxf
    (if (= (car dp) 1)
    (if (= (wcmatch (cdr dp) "`{*") T)
    	 (progn
    	 (setq leftside (vl-string-left-trim
    	"{\\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ|0123456789 "
    	(cdr dp)
    		 ) ;_ end of vl-string-left-trim
    	 leftside2 (vl-string-left-trim ";" leftside)
    	 rightside (vl-string-right-trim "}" leftside2)
    	 ) ;_ end of setq
    	 (setq EntDxf (subst (cons 1 rightside) dp EntDxf))
    	 (entmod EntDxf)
    	 (entupd (cdr (assoc -1 EntDxf)))
    	 )	;end progn
    )	;end if
    )	;end if
    "RIGHTSIDE" is the variabl or part that you want, it contains the text without all that other "junk"
    Christopher T. Cowgill, P.E.
    Autodesk Expert Elite
    AEC Collection Civil 3D 2020
    Windows 10

Similar Threads

  1. GetBoundingBox MText actual content only
    By mailmaverick361505 in forum AutoLISP
    Replies: 5
    Last Post: 2013-12-11, 11:24 AM
  2. Lookup table properties value returned within field
    By Kernal_CAD_Monkey in forum Dynamic Blocks - Technical
    Replies: 1
    Last Post: 2012-08-24, 04:34 PM
  3. Borrowed Licenses not being returned
    By ROBinHI in forum Revit Architecture - General
    Replies: 0
    Last Post: 2010-03-04, 10:52 PM
  4. Replies: 6
    Last Post: 2007-05-14, 07:24 AM
  5. Installed '07, and '06 returned
    By dmarx in forum AutoCAD Civil 3D - General
    Replies: 1
    Last Post: 2006-05-08, 06:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •