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)
)


+ Recent posts