Ahankhah Posted September 24, 2011 Share Posted September 24, 2011 Hi all, is it possible to filter selection set to contain only minserted blocks? If so, how? Thanks to anyone who spends her/his time to get any answer to the problem. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 24, 2011 Share Posted September 24, 2011 My approach .. (defun c:TesT (/ ss i sset mins) ;;;=== Tharwat 24. Sep. 2011 ===;;; (if (setq ss (ssget "_x" '((0 . "INSERT")))) (progn (repeat (setq i (sslength ss)) (setq sset (ssname ss (setq i (1- i)))) (setq mins (vl-remove-if-not (function (lambda (x) (eq (car x) 100) ) ) (entget sset) ) ) (if (not (member (cdr (cadr mins)) '("AcDbMInsertBlock"))) (ssdel sset ss) ) ) ) (princ) ) (princ) (alert (strcat "Number of Minsert Blocks >> :" " " " <" " " (itoa (sslength ss)) " " "> " " " "Nos." ) ) (princ) ) Tharwat Quote Link to comment Share on other sites More sharing options...
Ahankhah Posted September 24, 2011 Author Share Posted September 24, 2011 Thank you Tharwat, your code is very good, but isn't it possible to filter minserted objects just in one line like this? (setq ss (ssget "_x" '((0 . "INSERT")(100 . "AcDbMInsertBlock")))) I know it isn't correct, but someting like it... Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 24, 2011 Share Posted September 24, 2011 Thank you Tharwat,your code is very good, but isn't it possible to filter minserted objects just in one line like this? (setq ss (ssget "_x" '((0 . "INSERT")(100 . "AcDbMInsertBlock")))) I know it isn't correct, but someting like it... Actually that what I did try first but it did select all blocks without considering the filtration of minserts only at all . Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 24, 2011 Share Posted September 24, 2011 (ssget "_X" '((0 . "INSERT") (-4 . ">") (70 . 0))) Quote Link to comment Share on other sites More sharing options...
David Bethel Posted September 24, 2011 Share Posted September 24, 2011 If the 100 filter doesn't work ( which I think that it should ), then I think that you will have test all of row / col values: (ssget "_X" '((0 . "INSERT") (-4 . "<OR") (-4 . ">") (44 . 0) (-4 . ">") (45 . 0) (-4 . ">") (70 . 0) (-4 . ">") (71 . 0) (-4 . "OR>"))) -David Quote Link to comment Share on other sites More sharing options...
Ahankhah Posted September 24, 2011 Author Share Posted September 24, 2011 (ssget "_X" '((0 . "INSERT") (-4 . ">") (70 . 0))) Lee, again you and your excellent improvisation:o. Thanks a lot:D. Quote Link to comment Share on other sites More sharing options...
Ahankhah Posted September 24, 2011 Author Share Posted September 24, 2011 (edited) If the 100 filter doesn't work ( which I think that it should ), then I think that you will have test all of row / col values: (ssget "_X" '((0 . "INSERT") (-4 . "<OR") (-4 . ">") (44 . 0) (-4 . ">") (45 . 0) (-4 . ">") (70 . 0) (-4 . ">") (71 . 0) (-4 . "OR>"))) -David David, thank you very much for showing all possible differences between "entget"ing "INSERT"' and "MINSERT". Edited September 24, 2011 by Ahankhah Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 24, 2011 Share Posted September 24, 2011 Lee, again you and your excellent improvisation:o.Thanks a lot:D. Thanks Ahankhah Quote Link to comment Share on other sites More sharing options...
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.