TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: xiaxiang on December 19, 2010, 08:36:22 PM
-
Recently I make a routine for ssget the line and the circle
(setq ss1 (ssget '((0 . "LINE"))))
(setq ss2 (ssget '((0 . "circle"))))
But I don't want to select twice,so I modify it
(setq sss (ssget '((0 . "LINE,circle"))))
but how can I Specify the entity of line to SelectionSet ss1,and the entity of circle to SelectionSet ss2?
I use the function http://www.theswamp.org/index.php?topic=20164.0 (http://www.theswamp.org/index.php?topic=20164.0) By Mr Ron.
And I use this routine to Cascade(connect) the Discrete lines and circles. I must Select Twice! Help me,thanks.
-
Look at this, it separates the ss1. Places circles in ss2. NOTE: no error handling.
(defun c:test ()
(setq ss1 nil ss2 nil)
(if (setq ss1 (ssget '((0 . "LINE,circle"))))
(foreach itm (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss1)))
(if (= (cdr (assoc 0 (entget itm))) "CIRCLE")
(progn
(or ss2 (setq ss2 (ssadd)))
(ssadd itm ss2)
(ssdel itm ss1)
)
)
)
)
)
-
Thank you Alan :-D
The code is updated.