FOU Posted September 14, 2009 Posted September 14, 2009 I wonder if someone got a lisp that verify all line on a layer if is ortho and straight (vertical and horizontal) thx Quote
Lee Mac Posted September 14, 2009 Posted September 14, 2009 Are we talking just lines? Or *polylines/xlines also? Quote
Lee Mac Posted September 14, 2009 Posted September 14, 2009 Just a quick one: (defun c:allortho (/ nss i ss ent st en) (setq nss (ssadd)) (cond ((setq i -1 ss (ssget "_X" '((0 . "LINE")))) (while (setq ent (ssname ss (setq i (1+ i)))) (setq st (cdr (assoc 10 (entget ent))) en (cdr (assoc 11 (entget ent)))) (or (equal 0.0 (- (cadr st) (cadr en)) 0.0001) (equal 0.0 (- (car st) (car en)) 0.0001) (ssadd ent nss))) (sssetfirst nil nss)) (t (princ "\n** No Lines Found **"))) (princ)) Tolerance = 0.0001 You can add a filter to the SelectionSet (ss) to filter for layer Quote
dbroada Posted September 14, 2009 Posted September 14, 2009 that's good. At least on my drawings it is. Now where are those drawings I didn't like, done by that subbie ........... Quote
Lee Mac Posted September 14, 2009 Posted September 14, 2009 Thanks Dave - just wasn't sure what kind of tolerance would be good, perhaps 0.0001 is too low? Quote
dbroada Posted September 14, 2009 Posted September 14, 2009 I use snap so it would be unusual for me to be "out". On my screen 0,05 is less than 1 pixel but 0,1 shows as a step so you may be a bit fine. (metric of course, imperial may need to be finer) Quote
FOU Posted September 14, 2009 Author Posted September 14, 2009 I'm not sure what I'm doing wrong but allortho fin all my line not straight but do not change it to straight line. Any clue? Quote
Lee Mac Posted September 14, 2009 Posted September 14, 2009 I'm not sure what I'm doing wrong but allortho fin all my line not straight but do not change it to straight line. Any clue? You didn't mention anything about changing the lines... Quote
FOU Posted September 14, 2009 Author Posted September 14, 2009 hehe sorry but u got something who will do it pleeeasseeee lol i think it gonna be useful to many person Quote
Lee Mac Posted September 14, 2009 Posted September 14, 2009 But how would the program know which endpoint to move to make it straight? And would the program need to keep the line the same length? Or by a factor cosine of the angle displaced? Quote
eldon Posted September 14, 2009 Posted September 14, 2009 hehe sorry but u got something who will do it pleeeasseeee lol i think it gonna be useful to many person Only to those who cannot draw properly I think that Lee Mac has gone far enough already Quote
FOU Posted September 14, 2009 Author Posted September 14, 2009 let say from top (reference) to bottom for vertical and left (reference) to right for horizontal. I'm doing a lot of electrical drawing which contain a lot of line. Sometime i got 2 or 3 line on 100 lin correct but those make the drawing all bad. Quote
Lee Mac Posted September 14, 2009 Posted September 14, 2009 My program highlights the "2 or 3" lines.. so surely its easier to correct these yourself? I'm with Eldon here :wink: Quote
alanjt Posted September 14, 2009 Posted September 14, 2009 My program highlights the "2 or 3" lines.. so surely its easier to correct these yourself? I'm with Eldon here :wink: One's work is never truly appreciated. lol That smiley looks like he's having a little trouble on the poop. 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.