与我在你的第二个帖子中发布的帖子几乎相同,只是根据需要做了一些修改。
- (vl-load-com)
- (defun c:2lay0 (/ b o)
- ;;--- Tharwat 26.June.2013 ---;;
- (or doc (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))))
- (vlax-for b (vla-get-blocks doc)
- (if
- (and
- (eq :vlax-false (vla-get-isLayout b))
- (eq :vlax-false (vla-get-isXref b))
- )
- (vlax-for o b
- (vla-put-layer o "0")
- )
- )
- )
- (vla-regen doc acAllViewports)
- (princ)
- )
|