Discussion forum
CAD discussion |
Please abide by the rules of this forum.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
LISP to display aligned segments |
Post Reply |
Author | |
Edouard Lambert
Newbie Joined: 05.Jul.2023 Location: France Using: AutoCAD MAP 2014 / Covadis 14 Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 05.Jul.2023 at 09:49 |
Hello everyone, I'm a beginner in LISP, I started looking for myself but I'm stuck. I want to create a LISP which takes into account the polylines (or lines) of a given layer in my dwg drawing, and which displays in color (red for example) those which are aligned between them. My approach for this is the following: the code will decompose the polylines of my layer in order to make of them lines (segments), then it will analyze the properties of these lines, and change the color of those whose coordinates XY " start of line" and/or "end" are identical, AND whose angle is similar to 0.005 £ 200 grads (or 0.00008 £ ?? rad). I have attached the properties of the lines in AutoCAD. I work on AutoCAD MAP 2014, with Covadis 14. I hope that this is not a big constraint for this code... So far I have code that explodes my polylines and changes the color of the resulting lines to red (lsp attached). Thanks in advance for your help ?? Edouard Edited by Edouard Lambert - 05.Jul.2023 at 09:50 |
|
Kent Cooper
Senior Member Joined: 12.Mar.2013 Location: United States Using: AutoCAD2020, 2023 Status: Offline Points: 629 |
Post Options
Thanks(0)
|
[I get a 404 not-found error with the link for the PDF file.]
Can you illustrate what you're talking about? I think [in the English-language page] the British-Pound-symbol character must be a substitution for something else, which makes it hard to understand what your "whose angle is similar to 0.005 ? 200 grads (or 0.00008 ? ?? rad)" means. [And since that same character is part of the link to the PDF, it may be the cause of its not being found.] EDIT: And after posting, I see the British-Pound symbols as I copied and pasted from the original post got re-substituted and became question marks. That makes me also suspect the original double question marks are also character substitutions.
Edited by Kent Cooper - 06.Jul.2023 at 14:35 |
|
Edouard Lambert
Newbie Joined: 05.Jul.2023 Location: France Using: AutoCAD MAP 2014 / Covadis 14 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
Hey, Sorry for the character issues. Here is the properties window for a line in AutoCAD. I would like the LISP to use X,Y Start and End, and Angle. I added an example, in which the lines colored in red are lines 2 and 3 (same start and/or end, same angle). Let me correct this sentence in my original message : "AND whose angle is similar to 0.005 more or less 200 grads (or 0.00008 more or less pi rad)." My question marks were actually exclamation point... Thanks
|
|
Kent Cooper
Senior Member Joined: 12.Mar.2013 Location: United States Using: AutoCAD2020, 2023 Status: Offline Points: 629 |
Post Options
Thanks(0)
|
What do you want to do with the things that you want made red? If you want to identify them just so you can join them across the place where they meet, you can do that without Exploding Polylines, using OVERKILL with the right options -- blue for your 2 & 3 still as a Polyline, yellow for your 2 & 3 as separate Lines:
Edited by Kent Cooper - 07.Jul.2023 at 14:51 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0,338 seconds.