Jump to content

ssget "minsert"


Ahankhah

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 .

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by Ahankhah
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...