Jump to content

Recommended Posts

Posted

My code below inserts blocks on all vertices of a closed pline.

How can I modify it so that blocks are inserted only if the internal angle is 180 degrees or less?

thanks

 

 

(setq ent (car (entsel "\nSelect closed polyline: ")))
     e2 (entget e4))
     len (length e2))
     n 0)
);setq
(repeat len
(setq e1 (car (nth n e2)))
(if (= e1 10)
(command "_.INSERT" "myblock" (cdr (nth n e2))  1 "" 0)
);if
(setq n (1+ n))
);repeat

Posted

I don't think I quite understand the wording. A closed polyline will be either CW or CCW. In an internal angle, are you referring to the delta of 2 adjacent segments? The XY Plane angle of a given segment? I believe that you will have to extract the point list in order to compare the angles. -David

Posted

David yes you are correct thinking about it. I thought I might be able to use the code I had to start with, but I as you say I need a points list to compare xy planes of a given segment.

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