尊敬的各位:,
我在写Lisp程序,有人能帮我吗?
我有许多层供用户通过dcl对话框选择,在用户选择项目(可能不止一个)后,我将打开此层并检查是否在此层中有圆形对象。因为超过50项。如果我用If-then-else检查每个标志,我的lisp程序就会变得很长。还有其他好方法吗?
- (if (= item1 1)
- (progn
- (setq acadDocument (vla-get-activedocument (vlax-get-acad-object)))
- (setq theLayers (vla-get-layers acadDocument))
- (vlax-for item theLayers (vlax-put-property item "LayerON" ':vlax-false))
- (command "-layer" "On" (vlax-get-property item1-layer 'Name) "")
- (setq sset (ssget "_a" (LIST '(0 . "CIRCLE") (8 . item1-layer) (cons 410 (getvar "CTAB")))))
- )
- )
- (if (= item2 1)
- (progn
- (setq acadDocument (vla-get-activedocument (vlax-get-acad-object)))
- (setq theLayers (vla-get-layers acadDocument))
- (vlax-for item theLayers (vlax-put-property item "LayerON" ':vlax-false))
- (command "-layer" "On" (vlax-get-property item2-layer 'Name) "")
- (setq sset (ssget "_a" (LIST '(0 . "CIRCLE") (8 . item2-layer) (cons 410 (getvar "CTAB")))))
- )
- )
.
.
.
.
. |