Jump to content

Recommended Posts

Posted

I wonder if someone got a lisp that verify all line on a layer if is ortho and straight (vertical and horizontal)

thx

Posted

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

Posted

that's good. At least on my drawings it is. Now where are those drawings I didn't like, done by that subbie ...........

Posted

Thanks Dave - just wasn't sure what kind of tolerance would be good, perhaps 0.0001 is too low?

Posted

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)

Posted

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?

Posted
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... :glare:

Posted

hehe sorry :P but u got something who will do it pleeeasseeee lol

i think it gonna be useful to many person :P

Posted

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?

Posted
hehe sorry :P but u got something who will do it pleeeasseeee lol

i think it gonna be useful to many person :P

 

Only to those who cannot draw properly :shock:

 

I think that Lee Mac has gone far enough already

Posted

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.

Posted

My program highlights the "2 or 3" lines.. so surely its easier to correct these yourself?

 

I'm with Eldon here :wink:

Posted
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.:ouch:

lol That smiley looks like he's having a little trouble on the poop.

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