M76 Posted February 1, 2010 Share Posted February 1, 2010 ssget won't select the objects toching a line, only those that cross it. (ssget "_F" (list p1 p2) ) didn't select anything What method is the best for selecting these objects, if I know the endpoints of the line? I've tried to create a polygon around the line, but I screwed something up in this code, I'm not sure what. It only works if the angle of the line is below 180. (setq sp-angle (angle p1 p2)) (setq sp1 (polar p2 (+ sp-angle (/ pi 4)) puffer)) (setq sp2 (polar p2 (- sp-angle (/ pi 4)) puffer)) (setq sp3 (polar p1 (- (abs (- pi sp-angle)) (/ pi 4)) puffer)) (setq sp4 (polar p1 (+ (abs (- pi sp-angle)) (/ pi 4)) puffer)) Quote Link to comment Share on other sites More sharing options...
NBC Posted February 1, 2010 Share Posted February 1, 2010 how about using FASTSELECT, in conjunction with FSMODE ? Quote Link to comment Share on other sites More sharing options...
M76 Posted February 1, 2010 Author Share Posted February 1, 2010 how about using FASTSELECT, in conjunction with FSMODE ? I've found it, seems a little bit overkill to me, 420 lines of code Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 1, 2010 Share Posted February 1, 2010 Wasn't this something similar? http://www.cadtutor.net/forum/showthread.php?t=43459 Also, you could look for intersections Quote Link to comment Share on other sites More sharing options...
ronjonp Posted February 1, 2010 Share Posted February 1, 2010 You could use a fuzz factor .... say 0.001 and calc the point beyond (polar p1 (angle p1 p2)(+ 0.001 (distance p1 p2))) Quote Link to comment Share on other sites More sharing options...
devitg Posted February 1, 2010 Share Posted February 1, 2010 Do not forget to do a zoom extend to both points of the fence line SSGET only SSGET seen on the screen. SSGET do a SSGET to ALL enty when SSGET "_X" Quote Link to comment Share on other sites More sharing options...
LEsq Posted February 1, 2010 Share Posted February 1, 2010 What method is the best for selecting these objects, if I know the endpoints of the line? Don't have any code of mine on hand, but recall a function from an old friend. The master John F. Uhden. Here is the link: http://www.cadlantic.com/Freebies.htm And see if SSGETENDS.LSP could help, among some other great stuff available there. Quote Link to comment Share on other sites More sharing options...
M76 Posted February 2, 2010 Author Share Posted February 2, 2010 You could use a fuzz factor .... say 0.001 and calc the point beyond(polar p1 (angle p1 p2)(+ 0.001 (distance p1 p2))) That only extends the line, I'd have to create a polygon that encloses the line. Which I tried to do in the first post, but there is a problem with the angles. Quote Link to comment Share on other sites More sharing options...
M76 Posted February 2, 2010 Author Share Posted February 2, 2010 Don't have any code of mine on hand, but recall a function from an old friend. The master John F. Uhden. Here is the link: http://www.cadlantic.com/Freebies.htm And see if SSGETENDS.LSP could help, among some other great stuff available there. Thanks but that only selects objects near the ends of the line, which is fairly easy to do almost every lsp I created uses something like this. What I need is to select all objects along the line. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 3, 2010 Share Posted February 3, 2010 can you paste a image etc not sure exactly what your doing I have a crossing lisp used to dimension multiple lines. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 3, 2010 Share Posted February 3, 2010 This? (defun GetTouching (ent fuzz / p1 p2 ang pi/2) (setq p1 (cdr (assoc 10 (entget ent))) p2 (cdr (assoc 11 (entget ent))) ang (angle p1 p2) pi/2 (/ pi 2.)) (ssget "_CP" (list (polar p1 (+ ang pi/2) fuzz) (polar p1 (- ang pi/2) fuzz) (polar p2 (- ang pi/2) fuzz) (polar p2 (+ ang pi/2) fuzz)))) (defun c:test (/ ent) (if (and (setq ent (car (entsel "\nSelect Line: "))) (eq "LINE" (cdr (assoc 0 (entget ent))))) (sssetfirst nil (GetTouching ent 0.001))) (princ)) Quote Link to comment Share on other sites More sharing options...
M76 Posted February 4, 2010 Author Share Posted February 4, 2010 Thanks, I already figured it out, sorry I didn't indicate it. Quote Link to comment Share on other sites More sharing options...
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.