Jump to content

Global Coversion of Fields to Text?


El Jefe '36

Recommended Posts

Got a quick question. Is there a way to convert several fields to text without going into each individual text strip? I have a large sheet index on our cover that I want to "Unfield", but don't want to go into each individual text strip.

 

I've tried going around this and the only thing that works is the "TXTOUT" command, but that involves a bit of work.

 

Thanks in advanced!

Link to comment
Share on other sites

If you do single line text, you can simply select all the text you want to change, right click go to properties, and under the field that says contents, and you can change it.

Link to comment
Share on other sites

Doing so will change the text to whatever I enter in the "Contents" area....but most of the sheet titles are going to remain the same. I'm just trying to escape from retyping all the sheet titles again, just looking to unfield them.

 

Thank you very much for the input.

Link to comment
Share on other sites

I think I found a faster way than using the "TXTOUT" command, I converted the single line text into Mtext and that cleared out the field. Then I have to xplode the text so it can become single line text once again. The only thing is that you have to do each text strip individually. It is a little faster than going into each text strip and having to select "Convert field to text". Works for now I guess.......

Link to comment
Share on other sites

I write short lisp for fields conversion to text without exploading. Fields-attributes and fields-tables cells can be added. All layers with fields must be unlocked.

 

(defun c:Fields_to_Text(/ mtSet fdLst exDic fDic oldStr)
 
 (vl-load-com)
 
 (princ "\n<<< Select fields to transform to ordinary text >>>")
 (if
   (setq mtSet(ssget '((0 . "TEXT,MTEXT"))))
   (progn
     (setq fdLst(mapcar 'vlax-ename->vla-object 
                      (vl-remove-if 'listp 
                        (mapcar 'cadr(ssnamex mtSet)))))
     (foreach tx fdLst
(setq exDic(vla-GetExtensionDictionary tx))
  (if
    (not
      (vl-catch-all-error-p
	(setq fDic(vl-catch-all-apply
		    'vla-Item(list exDic "ACAD_FIELD")))))
    (progn
      (setq oldStr(vla-get-TextString tx))
      (vla-Delete(vla-Item fDic 0))
      (vla-put-TextString tx oldStr)
      (vla-put-BackgroundFill tx :vlax-false)
      (vla-Update tx)
     ); end progn
    ); end if
); end foreach
     ); end progn
   ); end if
 (princ)
 ); end of c:Fields_to_Text

Link to comment
Share on other sites

  • 2 years later...

Thanks for this code... But, even if I have added ACAD_TABLE in order to be able to process fields in "true" Autocad tables cells, it seems not to work...

How you add this function in your code ??

Aim for me is to remove all fields in all layouts...

 

Thanks a lot for your help !

 

Olivier

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...