Jump to content

Recommended Posts

Posted

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.

Posted

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

Posted

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

Posted
Thanks pBe, it works. this is the one that I want to achieve.

 

Great. Good for you :)

 

Cheers :beer:

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