也许这就是你想要的。尽管如Al所述,您通常如何确定哪些属性发生了更改?
- (defun c:foo (/ _puttext _getclipboardtext s txt)
- ;; RJP - 04.12.2018
- ;; Copies clipboard text to selected objects
- (defun _puttext (o s)
- (cond ((vlax-property-available-p o 'textstring) (vla-put-textstring o s))
- ((vlax-property-available-p o 'textoverride) (vla-put-textoverride o s))
- ((vlax-property-available-p o 'hasattributes)
- (foreach a (vlax-invoke o 'getattributes) (vla-put-textstring a s))
- )
- )
- )
- ;; http://www.theswamp.org/index.php?topic=35577.msg408049#msg408049
- (defun _getclipboardtext (/ htmlfile result)
- (setq
- result (vlax-invoke
- (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'parentwindow)
- 'clipboarddata
- )
- 'getdata
- "Text"
- )
- )
- (vlax-release-object htmlfile)
- result
- )
- (cond
- ((null (setq txt (_getclipboardtext))) (print "Nothing in clipboard"))
- ((null (setq s (ssget ":L" '((0 . "insert,*text,multileader,dimension"))))) (print "Bye.."))
- ((foreach a (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))))
- (_puttext a txt)
- )
- )
- )
- (princ)
- )
- (vl-load-com)
|