|
发表于 2003-4-3 10:56:00
|
显示全部楼层
;Usage: Outext
;Select texts or mtext in the drawings
;These texts or mtext will be sent to Dutext.txt
;(overide if the file exists) in an order of
;their Y value of their insert point in the drawing.
;Format of mtext hopefully will be removed.
;
(defun C:Outext(/ ss idx txtlst cnt f)
(setq ss (ssget)
idx 0
txtlst '())
(while ( (cadr e1) (cadr e2))))))
(setq txtlst (mapcar 'car txtlst))
(setq f (open "dutext.txt" "w") cnt 0)
(while (vla-object Mtext))
)
(1 (setq Mtext nil))
)
(and
Mtext
(= (vlax-get Mtext 'ObjectName) "AcDbMText")
(setq Mtext (vlax-get Mtext 'TextString))
(setq Text "")
(while (/= Mtext "")
(cond
((wcmatch (strcase (setq Str (substr Mtext 1 2))) "\\[\\{}`~]")
(setq Mtext (substr Mtext 3)
Text (strcat Text Str)
)
)
((wcmatch (substr Mtext 1 1) "[{}]")
(setq Mtext (substr Mtext 2))
)
((and KeepLF (wcmatch (strcase (substr Mtext 1 2)) "\\P"))
(setq Mtext (substr Mtext 3)
Text (strcat Text "\\P")
)
)
((wcmatch (strcase (substr Mtext 1 2)) "\\[LOP]")
(setq Mtext (substr Mtext 3))
)
((wcmatch (strcase (substr Mtext 1 2)) "\\[ACFHQTW]")
(setq Mtext (substr Mtext (+ 2 (vl-string-search ";" Mtext))))
)
((wcmatch (strcase (substr Mtext 1 2)) "\\S")
(setq Str (substr Mtext 3 (- (vl-string-search ";" Mtext) 2))
Text (strcat Text (vl-string-translate "#^\\" " " Str))
Mtext (substr Mtext (+ 4 (strlen Str)))
)
(print Str)
)
(1
(setq Text (strcat Text (substr Mtext 1 1))
Mtext (substr Mtext 2)
)
)
)
)
)
Text
)
--
John Uhden, Cadlantic/formerly CADvantage
http://www.cadlantic.com
Sea Girt, NJ |
|