- (defun delOffLayer (/ lay)
- (command "_.undo" "be")
- (command "_.color" "")
- (vlax-for lay
- (vla-get-layers
- (vla-get-activedocument
- (vlax-get-acad-object)
- )
- )
- (if (and (= (vla-get-LayerOn lay) :vlax-false) (/= "0" (vla-get-Name lay)))
- (command "laydel" "n" (vla-get-Name lay) "" "y")
- )
- )
- (command "-purge" "a" "" "n")
- (command "_.undo" "e")
- )
自己拼凑了一段代码, 缺点应该是不能处理有参照的图层 |