Results 1 to 5 of 5

Thread: Convert All Fields to Text

  1. #1
    Member
    Join Date
    2012-05
    Posts
    13
    Login to Give a bone
    0

    Default Convert All Fields to Text

    I'm trying to get a lisp file that will select all text / mtext and convert any fields to plain text or mtext.
    I have the below lisp that does this beautifully, but it requires me to manually select what text objects I want.
    All I want to change is the selection. Instead of being prompted to select, I would like it to select all mtext or text objects.
    Any help would be greatly appreciated!

    (defun c:FITOTXT ( / *error* doc i ss obj str)




    (vl-load-com)
    (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
    (vla-StartUndoMark doc)


    (setq i 0)
    (if (setq ss (ssget ":L" '((0 . "TEXT,MTEXT"))))
    (repeat (sslength ss)
    (setq obj (vlax-ename->vla-object (ssname ss i))
    str (vlax-get obj 'TextString)
    )
    (if (not (eq str (vla-FieldCode obj)))
    (progn
    (vlax-put obj 'TextString " ")
    (vlax-put obj 'TextString str)
    )
    )
    (setq i (1+ i))
    )
    )
    (*error* nil)
    )

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL
    Posts
    3,374
    Login to Give a bone
    0

    Default Re: Convert All Fields to Text

    The first link in Similar Threads at the bottom of the page: https://forums.augi.com/showthread.p...=1#post1296764

    Easily found with a quick search in this forum.

    You need to Wrap Code tags around any code you post.
    Clicking the [Go Advanced] button at the bottom puts a toolbar at the top and the # icon in that toolbar places code tags around
    Code:
    selected text
    for you or simply paste your code inside.
    Tom Beauford P.S.M. - Civil 2020 on Windows 10 Enterprise
    Design Analysis - Leon County Public Works/Engineering Wrap [CODE] tags around selected text
    2280 Miccosukee Rd. Tallahassee, FL 32308-5310
    Ph# (850)606-1516 Home Page

  3. #3
    Member
    Join Date
    2012-05
    Posts
    13
    Login to Give a bone
    0

    Default Re: Convert All Fields to Text

    Yeah I found that one before I posted this.
    That requires you to select what text objects you want.
    I'm trying to modify it to select all text objects without me having to select the objects manually.

  4. #4
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL
    Posts
    3,374
    Login to Give a bone
    0

    Default Re: Convert All Fields to Text

    Quote Originally Posted by barshnizza494659 View Post
    Yeah I found that one before I posted this.
    That requires you to select what text objects you want.
    I'm trying to modify it to select all text objects without me having to select the objects manually.
    Using R-FIELDS-ALL didn't prompt to select anything for me and it converted every field to text for me.

    What lisp did you try?
    Tom Beauford P.S.M. - Civil 2020 on Windows 10 Enterprise
    Design Analysis - Leon County Public Works/Engineering Wrap [CODE] tags around selected text
    2280 Miccosukee Rd. Tallahassee, FL 32308-5310
    Ph# (850)606-1516 Home Page

  5. #5
    Member
    Join Date
    2012-05
    Posts
    13
    Login to Give a bone
    0

    Default Re: Convert All Fields to Text

    Quote Originally Posted by Tom Beauford View Post
    Using R-FIELDS-ALL didn't prompt to select anything for me and it converted every field to text for me.

    What lisp did you try?
    Thanks Tom, I already had an "R-Fields-All" that I had downloaded from one of these forums.
    It looked identical to the one on the link you provided.
    I just tried the one from the link you provided again and it worked, so apparently mine wasn't exactly the same.
    The R-Fields-All you're referencing works for me now.
    Thanks for the help!

Similar Threads

  1. Converting All Fields To text
    By mbrandt5 in forum AutoLISP
    Replies: 6
    Last Post: 2015-07-27, 05:44 PM
  2. Nested Fields - Convert units for Northings/Eastings?
    By keelay711 in forum AutoCAD Fields
    Replies: 5
    Last Post: 2007-03-05, 07:24 AM
  3. convert all text to mtext
    By c_rado in forum AutoCAD General
    Replies: 6
    Last Post: 2006-12-03, 11:15 PM
  4. Match line call outs as fields - link fields across sheets
    By david_ellis in forum AutoCAD Fields
    Replies: 1
    Last Post: 2006-06-13, 09:49 PM

Tags for this Thread

Posting Permissions

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