http://www.afralisp.net/visual-lisp/tutorials/selection-sets.php


 

(defun c:xxx ( / ssets acadDocument newsset ctr item)
   (vl-load-com)
   (setq acadDocument (vla-get-activedocument (vlax-get-acad-object)))
   (setq ssets (vla-get-selectionsets acadDocument))
   (setq newsset (vla-add ssets "SS1"))
   (vla-selectOnScreen newsset)
   (setq ctr 0)
   (repeat (vla-get-count newsset)
      (setq item (vla-item newsset ctr))
      (setq check (vlax-property-available-p item "Color" T))
      (if check
         (vlax-put-property item 'Color 5)
      ) 
      (setq ctr (1+ ctr))
   ) 
   (vla-delete (vla-item ssets "SS1"))
   (princ)
)



(defun c:xxx ( / ssets acadDocument newsset ctr item)
   (vl-load-com)
   (setq acadDocument (vla-get-activedocument (vlax-get-acad-object)))
   (setq ss (ssget (list (cons 0 "INSERT"))))
   (setq ssets (vla-get-activeselectionset acadDocument))
   (vlax-for obj ssets
      (vla-explode obj)
   ) 
   (vla-delete ssets)
   (princ)
)


'Lisp & Tips > Lisp' 카테고리의 다른 글

vl-file-systime 의 사용법  (0) 2016.12.04
현재 도면에 로딩된 모든 명령어/함수/변수 보기  (0) 2016.10.17
=, eq, equal  (0) 2016.04.02
블럭안의 치수만 지우기  (0) 2016.02.20
vl-every, vl-some 함수  (0) 2016.02.20