Rick_Ismael Posted November 24, 2011 Posted November 24, 2011 Hi all, I want to select entities using (ssget ":L"). Selection sets consist of multiple lines and a block. Using selection via crossing, how can I select all the lines and get the insertion point of the block in the selection without putting the block in the selection set. Thank you. Quote
pBe Posted November 24, 2011 Posted November 24, 2011 you can either: Two prompts for selection.. (ssget ":L" '((0 . "LINE"))) (ssget ":S:E:L" '((0 . "INSERT"))) or All in one go: (defun c:test (/ ss i ent inspt) (setq ss (ssget ":L" '((0 . "INSERT,LINE")))) (repeat (setq i (sslength ss)) (setq ent (entget (ssname ss (setq i (1- i))))) (if (eq (cdr (assoc 0 ent)) "INSERT") (setq inspt (cdr (assoc 10 ent)) ss (ssdel (ssname ss i) ss)) (princ "\nFunctions for lines: ") ) ) (print inspt) (sssetfirst nil ss) (princ) ) Quote
Rick_Ismael Posted November 25, 2011 Author Posted November 25, 2011 Thanks pBe, it works. this is the one that I want to achieve. All in one go: (defun c:test (/ ss i ent inspt) (setq ss (ssget ":L" '((0 . "INSERT,LINE")))) (repeat (setq i (sslength ss)) (setq ent (entget (ssname ss (setq i (1- i))))) (if (eq (cdr (assoc 0 ent)) "INSERT") (setq inspt (cdr (assoc 10 ent)) ss (ssdel (ssname ss i) ss)) (princ "\nFunctions for lines: ") ) ) (print inspt) (sssetfirst nil ss) (princ) ) Quote
pBe Posted November 25, 2011 Posted November 25, 2011 Thanks pBe, it works. this is the one that I want to achieve. Great. Good for you Cheers Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.