Ajmal Posted May 5, 2020 Posted May 5, 2020 i need only select lines. But it's not coming. (defun c:DE () (setq p1 (getpoint "\nSelect object...")) (setq p2 (getcorner p1)) (setq mp (polar p1 (angle p1 p2) (/ (distance p1 p2) 2))) (setq p1 (list (nth 0 p1) (nth 1 p1))) (setq p2 (list (nth 0 p2) (nth 1 p2))) (setq lines (ssget "_C" p1 p2 ((list (cons "LINE"))))) (if (/= (sslength lines) 4) (alert "4 lines need to be selected"))) Quote
David Bethel Posted May 5, 2020 Posted May 5, 2020 Quote (defun c:DE (/ ss) (while (not (and (princ "\nSelect 4 LINEs...") (setq ss (ssget (list (cons 0 "LINE")))) (= (sslength ss) 4) (princ "\n4 Line Selected...")))) (prin1)) While I don't now your exact input limitations, this could give much more flexibility. -David Quote
BIGAL Posted May 6, 2020 Posted May 6, 2020 (edited) If its 4 lines in some form touching like sq rectang diamond etc then try this idea if you pick a corner you make a little sq of 4 points then use ssget "F" with the 4 points it will find the two lines, repeat for other corner. I have used this method very successfully for all sorts of objects. The other option is pick point inside make a bploy use these points to select objects at say midpoint along each line. I would go down this path as you can have more line segments. Edited May 6, 2020 by BIGAL Quote
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.