Jump to content

Entmake Question


Bill Tillman

Recommended Posts

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.

 

attachment.php?attachmentid=59074&cid=1&stc=1

PolyLineTest.jpg

Edited by Bill Tillman
Link to comment
Share on other sites

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