Bill Tillman Posted August 24, 2016 Share Posted August 24, 2016 (edited) I have a neat method which was shared with me in this forum that uses the ENTMAKE command to build a polyline with lines and arcs. Works pretty good. If you run this you'll see the basics of what I'm creating (vl-load-com) (defun C:TEST () (entmake (list '( 0 . "LWPOLYLINE") '( 8 . "0") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '( 90 . 14) '( 70 . 0) (list 10 0 0) (list 10 6 0) (list 10 6 0.5) (cons 42 (- 1 (sqrt 2.0))) (list 10 6.25 0.75) (list 10 11 0.75) (cons 42 (- 1 (sqrt 2.0))) (list 10 11.25 0.5) (list 10 11.25 0) (list 10 56.75 0) (list 10 56.75 0.5) (cons 42 (- 1 (sqrt 2.0))) (list 10 57 0.75) (list 10 62.75 0.75) (cons 42 (- 1 (sqrt 2.0))) (list 10 63 0.5) (list 10 63 0) (list 10 68 0) ) ) (princ) ); end TEST In the real coding I'm using for production, there are many variables used because the length of this polyline varies based on user inputs. I did it like this just to keep things simple for this post. And there is a point where the length is long enough that an additional notch (the arc part of this polyline) is needed right in the middle of this object. I have been using two routines, one for the shorter lines which require only two notches, and a different one that will create the third notch right in the center. I was wondering if there is a way to reduce this to only one routine which would use an (if) to inject the information about the center notch when it's needed. I was trying to build a list of points and then use a (foreach method but I'm not sure how to get the arcs in there. If it's all straight lines that would be simple. But the radius corners in the notches is required design trait. Edited August 24, 2016 by Bill Tillman Quote Link to comment Share on other sites More sharing options...
tombu Posted August 24, 2016 Share Posted August 24, 2016 http://www.afralisp.net/autolisp/tutorials/polyline-bulges-part-1.php Explains calculating the bulge. 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.