Help with lisp to convert TEXT & MTEXT fields containing save date expression (%<\AcVar SaveDate \f "dd.MM.yyyy">%) to text would be much appreciated, could fields inside blocks be converted as well?
Thank you
Robert
Hello from France
Please look at these routines (especially from INERB) :
https://forums.augi.com/showthread.php?72534-Convert-Field-to-Text-within-Block-Globally
Please let us know which one is OK and right for you because I have never used/tested these routines !
And maybe the "F2T" routine from pbejse :
Patrice BRAUD
Hi, thanks. As a result of web search I've gone through these also earlier.
Irneb's code can convert field values in block attributes to text
https://forums.augi.com/showthread.php?72534-Convert-Field-to-Text-within-Block-Globally/page2:
(vl-load-com)
(defun c:FLD2TXT (/ ss n bn an ad s)
(prompt
"Select the blocks you wish to remove the field links from: "
) ;_ end of prompt
(setq ss (ssget '((0 . "INSERT")))) ;Get selection set from user
(setq n 0) ;Initialize counter
;; Step through selection set one entity at a time
(while (< n (sslength ss))
(setq bn (ssname ss n)) ;Get the nth entity in the selection set
(setq an (entnext bn)) ;Get the next enity after bn
;; Step through each next entity until it is not an attribute
(while (and an ;Check if entity is found
(setq ad (entget an)) ;Get data
(= "ATTRIB" (cdr (assoc 0 ad))) ;Check if attribute
) ;_ end of and
(setq s (cdr (assoc 1 ad))) ;Get text value
(setq ad (subst (vl-list* 1 "") (assoc 1 ad) ad))
;Clear the attribute's value
(entmod ad) ;Modify the entity
(setq ad (subst (vl-list* 1 s) (assoc 1 ad) ad))
;Set the attribute's value back to only the text
(entmod ad) ;Modify the entity
(entupd an) ;Update screen to show change
(setq an (entnext an)) ;Get next entity
) ;_ end of while
(setq n (1+ n)) ;Increment counter
) ;_ end of while
(setq ss nil) ;Clear selection set
(gc) ;Clear unused memory
(princ)
) ;_ end of defun
I could not get pbejse's "F2T" to work..
Hello
You have to modify the pbejse's "F2T" routine for YOUR specific block !
Into F2T : Block Name = "Mode_A3" , Attributes Names = TAG1 , TAG2 , TAG3
So ...
Patrice BRAUD
Hi,
"F2T" does not quite meet my needs, as it's for block with attributes, the fields I have to convert (on drawing export suppose) are in Text or Mtext which also / in addition reside in blocks.
Also I need to be able to filter the text objects by field expression given above to maintain contents of other fields.
Thanks,
Robert