Jump to content
Ahankhah

ssget "minsert"

Recommended Posts

Ahankhah

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.

Share this post


Link to post
Share on other sites
Tharwat

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

Share this post


Link to post
Share on other sites
Ahankhah

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

Share this post


Link to post
Share on other sites
Tharwat
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 .

Share this post


Link to post
Share on other sites
Lee Mac
(ssget "_X" '((0 . "INSERT") (-4 . ">") (70 . 0)))

Share this post


Link to post
Share on other sites
David Bethel

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

Share this post


Link to post
Share on other sites
Ahankhah
(ssget "_X" '((0 . "INSERT") (-4 . ">") (70 . 0)))

Lee, again you and your excellent improvisation:o.

Thanks a lot:D.

Share this post


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

Share this post


Link to post
Share on other sites
Lee Mac
Lee, again you and your excellent improvisation:o.

Thanks a lot:D.

 

Thanks Ahankhah :)

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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