拷贝属性从一个块到另一个块
(defun c:MAV (/ AT:GetSel atts ss i ass)
;; Match Attribute Values
;; Alan J. Thompson, 2017.01.31
(if
(and
(AT:GetSel
entsel
"\nSelect source attributed block: "
(lambda (x / d)
(if
(and (eq (cdr (assoc 0 (setq d (entget (car x))))) "INSERT")
(eq (cdr (assoc 66 d)) 1)
) ;_ end of and
(setq
atts (mapcar (function (lambda (a)
(cons (vla-get-tagstring a)
(vla-get-textstring a)
) ;_ end of cons
) ;_ end of lambda
) ;_ end of function
(vlax-invoke
(vlax-ename->vla-object (car x))
'GetAttributes
) ;_ end of vlax-invoke
) ;_ end of mapcar
) ;_ end of setq
) ;_ end of if
) ;_ end of lambda
) ;_ end of AT:GetSel
(progn
(princ "\nSelect destination attributed block(s): ")
(setq ss (ssget "_:L" '((0 . "INSERT") (66 . 1))))
) ;_ end of progn
) ;_ end of and
(repeat (setq i (sslength ss))
(foreach a (vlax-invoke
(vlax-ename->vla-object (ssname ss (setq i (1- i))))
'GetAttributes
) ;_ end of vlax-invoke
(if (setq ass (cdr (assoc (vla-get-tagstring a) atts)))
(vla-put-textstring a ass)
) ;_ end of if
) ;_ end of foreach
) ;_ end of repeat
) ;_ end of if
(princ)
) ;_ end of defun
(vl-load-com)
(princ)
函数 AT:GetSel
**** Hidden Message *****
正需要,支持Lisphk楼主大人!!!!! 回复学习学习!
实用功能,谢谢分享程序! 谢谢分享。。。。。。。 过年都没歇着哈...
学习了。。。。。 Learning ..... “我来测试一下,行不行”
谢谢分享。。。。。。。 需要学习 看看
回复学习学习
看看能不能适合我用咯,谢谢开源
很好用啊啊1
挺好用的一个功能