lisp转换为vba
求助lisp高手,如何把下面这段lisp写的改块颜色转换为vba;;终于明白了(以前从来都不知道),得到的结论是:
;;块中的引线和公差颜色为 ByBlock ,不随块本身的颜色的变化而变化。
(defun c:ChBlkColor (/ ss co i obj bn bnlst)
(if (and (setq ss (ssget '((0 . "insert"))))
(setq co (acad_colordlg 7))
)
(progn
(repeat (setq i (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss (setq i (1- i))))
bn(vla-get-name obj)
)
(vla-put-color obj co)
(if (and (= (vla-get-ObjectName obj) "AcDbBlockReference")
(= (vla-get-HasAttributes obj) :vlax-true)
)
(foreach x (vlax-invoke obj 'getattributes)
(vla-put-color x 0)
)
)
(if (not (member bn bnlst))
(setq bnlst (cons bn bnlst))
)
)
(setq blks (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
(foreach x bnlst
(vlax-for obj (vla-item blks x)
(if (member (vla-get-ObjectName obj) '("AcDbFcf" "AcDbLeader"))
(vla-put-color obj co)
(vla-put-color obj 0)
)
)
)
)
)
(princ)
)
lisp开发版原帖地址
http://bbs.mjtd.com/thread-68173-1-1.html 同问
页:
[1]