 - (defun c:tt ()
- (if (and (setq s1 (entsel "\n选择文字"))
- (setq ent (entget (car s1)))
- (= (cdr(assoc 0 ent)) "TEXT")) (progn
- (setq txt (cdr(assoc 1 ent)))
- (set-clip-string (substr txt 1 (vl-string-position (ascii " ") txt)))
- ))
- (princ)
- )
- (defun SET-CLIP-STRING (STR / HTML RESULT)
- (and (= (type STR) 'STR)
- (setq HTML (vlax-create-object "htmlfile"))
- (setq RESULT
- (vlax-invoke
- (vlax-get (vlax-get HTML 'PARENTWINDOW) 'CLIPBOARDDATA)
- 'SETDATA
- "Text"
- STR
- )
- )
- (vlax-release-object HTML)
- )
- )
|