AcadXCurve.Trim - Tony?

Discussion in 'AutoCAD' started by Jeff Mishler, Dec 30, 2003.

  1. Jeff Mishler

    Jeff Mishler Guest

    OK, I give up. How in the heck do you get this to work? I've been messing
    aroung with it for hours, and no matter what I do, I get an error "Object
    does not support this method". My selection set is filtered for only the
    AcadObjects allowed (and my test drawing only has lines anyway) and
    "cutLine" is a valid AcadLine. This is the part of the code that fails:

    Dim ent As New AcadXCurve
    Dim x As Long
    Dim cutPt As Variant
    For x = 0 To trimSS.Count - 1
    ent.Entity = trimSS.Item(x) 'OK, I can verify in Locals window
    cutPt = ent.IntersectWith(cutLine, acExtendNone) ' OK, returns
    valid cutPt
    ent.Trim cutLine, cutPt ' nope, errors out
    Next x

    Any ideas?

    Jeff
     
    Jeff Mishler, Dec 30, 2003
    #1
  2. Don't use Trim(). You need to use Break(), and then just
    manally erase the fragments you don't want. When I begin
    implementing Trim, I realized that the TRIM command was a
    UI-centric operation that relies on a selection point (in
    the DCS!) to determine what part(s) of the object are to
    be removed. I also realized that trying to implement a
    fully programmatic equivalent was a bit more work than I
    had expected.

    Break() gives you the option of determining what to keep
    and what to discard, using any means you choose. In fact,
    you can easily implement your own Trim by just breaking
    the object at the points where it intersects the cutting
    edge, and then use the selection point or some other
    criteria to determine which of the resulting fragments
    you want to keep or discard.

    To see an example of this, look at CUT.LSP.
     
    Tony Tanzillo, Dec 30, 2003
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.