Finding lines that are not straight.

Finding lines that are not straight.

keshishian
Contributor Contributor
3,738 Views
26 Replies
Message 1 of 27

Finding lines that are not straight.

keshishian
Contributor
Contributor

Hello,

 

Attached is a lisp command that moves all "non straight" lines to a new layer. It is very accurate or (not accurate) and moves a lot of good lines to the new layer. Is there a way to:

1- Isolate lines that are between a few degrees of 90 and 270, compare their x coordinates, and if not 0 move to the new layer?

1- Isolate lines that are between a few degree of 0 and 180, compare their y coordinates, and if not 0 move to the new layer?

 

Any suggestion will be very much appreciated. Application used is AutoCAD 2024 LT

 

Thank You.

0 Likes
Accepted solutions (1)
3,739 Views
26 Replies
Replies (26)
Message 21 of 27

pullstackautocad
Enthusiast
Enthusiast

Help can we just change the color of lines which are orthogonal, i mean not straight . 

color red . so i could figure out the lines @Kent1Cooper 

thankyou

0 Likes
Message 22 of 27

Kent1Cooper
Consultant
Consultant

If you mean you want the not-quite-orthogonal Lines changed to red color, but not put on a different Layer, then remove or comment out this line:

(command "_layer" "_new" "NotQuiteOrtho" ""); whether or not it exists already
and change this line:

(entmod (append edata (list '(8 . "NotQuiteOrtho") '(62 . 1))))
to just this:

(entmod (append edata (list '(62 . 1))))

Kent Cooper, AIA
Message 23 of 27

pullstackautocad
Enthusiast
Enthusiast

sir can i get the lsp file, i am a begineer, it would be very helpful .... thankyou

0 Likes
Message 24 of 27

Kent1Cooper
Consultant
Consultant

I would have thought the instructions were easy enough to follow, but see the attached.

Kent Cooper, AIA
0 Likes
Message 25 of 27

pullstackautocad
Enthusiast
Enthusiast

@Kent1Cooper Idk sir bt Maybe not for my 2018 version.

0 Likes
Message 26 of 27

Kent1Cooper
Consultant
Consultant

It works for me, and I can't imagine the version difference would be why it doesn't for you.  But here's a possibility:  Are those "lines" in your drawing LINE objects specifically?  The routine is not written to work with Polylines, if that's what they are.

 

If that's not the issue, post your drawing file in which it doesn't work.

Kent Cooper, AIA
0 Likes
Message 27 of 27

sharpl
Advocate
Advocate

Dear @kentcooper it works, but the out put is  <25 found>, how do we know which ones to fix? The new layer is not formed...

0 Likes