Jump to content
benhubel

Select multiple entities created from command offset

Recommended Posts

benhubel

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

Share this post


Link to post
Share on other sites
benhubel

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.

Share this post


Link to post
Share on other sites
ronjonp

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

Share this post


Link to post
Share on other sites
benhubel
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.

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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