Jump to content

Recommended Posts

Posted

My lisp program runs the offset command, then immediately uses entlast to get the newly created polyline and add it to a selection set. There is a bug using this method, though, since offset creates multiple entities any time the offset distance is large enough to make it collide with itself. I am trying to find a way to get those additional polylines, but entlast only grabs the most recent. I am at a loss.

 

The only things I can think of right now are to either write my own custom offset routine or to select everything in the drawing before and after the offset, then deselect the selection from before. Both methods sound inefficient.

 

Does anybody have a better way of going about this? I found a few posts where people asked similar questions about this problem, but each one found a workaround specific to their case instead of addressing the issue of getting more than one recent entities which are output at the same time.

 

For reference, here is what I'm talking about by multiple entities being created when it self-intersects:

OffsetEntities.PNG

Posted

Thank you. It appears to be a bit over my head, but it seems to be exactly what I was hoping for. I'll look it over and see if I can figure out what to make of it.

Posted

You could also use vla-offset then all the items created would be stored as a list of vla-objects.

 

Quick one liner :)

 

(vlax-invoke (vlax-ename->vla-object (car (entsel))) 'offset (getdist))
;; Returns
;; (#<VLA-OBJECT IAcadLWPolyline 0000022d161fa478> #<VLA-OBJECT IAcadLWPolyline 0000022d161fb5b8>) 

Posted
You could also use vla-offset then all the items created would be stored as a list of vla-objects.

 

I had no idea that vla-offset even existed. I'm surprised I've never heard of it before now. I'll definitely be checking that out, whether I use it here or not.

 

**Edit**

To be fair, I haven't had the chance to do too much with VLA in the first place. I think I should put more time into learning it.

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