Jump to content

Recommended Posts

Posted

I m trying to make a selection set using a point and a couple of lines passing through this point (caution, NOT terminating). I want to select lines of specific layers. What I m typing is this

 

(setq pt (getpoint "\nSelect point: "))
(setq ss (ssget pt '((0 . "LINE") (8 . "mylayer"))))

 

Unfortunately this doesn't work. The only way I could find is to use this instead

 

(ssget "C" pt pt '((0 . "LINE") (8 . "mylayer")))

 

However I do not find that helpful at all. If there is a line at the back on an other elevation, not crossing the initial line, but coincidentally passing 'visually' through this point (pt) the later ssget command will include both and that is not what I want.

 

How could I use a point and filter together? Any help would be appreciated.

Posted

Try

(setq ss (ssget pt (list '(0 . "LINE") '(8 . "mylayer")(cons -4 "*,*,=")(cons 10 (list 0.0 0.0 (caddr pt))))))
;; or
(setq ss (ssget "C" pt pt (list '(0 . "LINE") '(8 . "mylayer")(cons -4 "*,*,=")(cons 10 (list 0.0 0.0 (caddr pt))))))

Henrique

Posted

Thank you. The first one doesn t seem to work. The second works but this way only filtering the Z. If I change the viewpoint of the entire model this will not be reliable. I tried

 

(setq ss (ssget "C" pt pt (list (cons 0 "LINE") (cons 8 "mylayer") (cons -4 "=,=,=") (cons 10 (list (car pt) (cadr pt) (caddr pt))))))

 

but it gives me nil! It should have worked. There is at least one line passing through the pt.

Posted

(setq pt (getpoint "\nSelect point: "));; your known point
(setq wpt (trans pt 1 0));; point in WCS
(setq upt (trans wpt 0 1));; point in actual UCS
(setq ss (ssget "C" upt upt (list '(0 . "LINE") '(8 . "mylayer")(cons -4 "*,*,=")(cons 10 (list 0.0 0.0 (caddr upt))))))

HTH

Henrique

Posted (edited)

Thanks! I will look into it.

Edited by MJLM

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