+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Full Member benhubel's Avatar
    Computer Details
    benhubel's Computer Details
    Operating System:
    Windows 7
    Discipline
    Manufacture
    benhubel's Discipline Details
    Occupation
    Waterjet Programmer
    Discipline
    Manufacture
    Using
    AutoCAD 2012
    Join Date
    Dec 2015
    Location
    Dallas, Texas
    Posts
    76

    Default Select multiple entities created from command offset

    Registered forum members do not see this ad.

    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
    I just now discovered for the first time that I am prone to memory loss.

  2. #2
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,078

    Default

    This thread may help you.

  3. #3
    Full Member benhubel's Avatar
    Computer Details
    benhubel's Computer Details
    Operating System:
    Windows 7
    Discipline
    Manufacture
    benhubel's Discipline Details
    Occupation
    Waterjet Programmer
    Discipline
    Manufacture
    Using
    AutoCAD 2012
    Join Date
    Dec 2015
    Location
    Dallas, Texas
    Posts
    76

    Default

    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.
    I just now discovered for the first time that I am prone to memory loss.

  4. #4
    Senior Member
    Computer Details
    ronjonp's Computer Details
    Operating System:
    Windows 10
    Using
    AutoCAD 2018
    Join Date
    Apr 2009
    Location
    Colorado
    Posts
    461

    Default

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

    Quick one liner

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

  5. #5
    Full Member benhubel's Avatar
    Computer Details
    benhubel's Computer Details
    Operating System:
    Windows 7
    Discipline
    Manufacture
    benhubel's Discipline Details
    Occupation
    Waterjet Programmer
    Discipline
    Manufacture
    Using
    AutoCAD 2012
    Join Date
    Dec 2015
    Location
    Dallas, Texas
    Posts
    76

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by ronjonp View Post
    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.
    I just now discovered for the first time that I am prone to memory loss.

Similar Threads

  1. layer created & sorted base on entities colour/how to include nested entities?
    By Tripledot in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 7th Jul 2016, 06:53 am
  2. Multiple Offset Command Error
    By DD21988 in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 29th May 2015, 06:03 pm
  3. selection set of bunch of newly created entities
    By MJLM in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 16th Feb 2014, 06:09 pm
  4. Replies: 10
    Last Post: 11th Aug 2011, 05:40 am
  5. Best way to keep track of created entities for ease of removal?
    By Hudson in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 11th Aug 2009, 01:43 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts