How do you address both sides of Slice?

Discussion in 'AutoCAD' started by David Hartley, Feb 19, 2004.

  1. When you slice a solid using the .sliceSolid method, you get two pieces.
    How do you address each piece, for instance, to move each piece to a
    different position?

    Thanks for your help

    David
     
    David Hartley, Feb 19, 2004
    #1
  2. David Hartley

    wivory Guest

    When I read your post I half-remembered I had an issue with this some time back and ended up contacting Autodesk support about it. I know it wasn't a very satisfactory response and I just found this comment I had written in my code:

    ' Due to a quirk with the SliceSolid method only the Negative side of the slice can be returned, which means that to always get the piece we're going to chop off the member the plane points must be passed in a clockwise direction. So we want the first point to be on the left and the second point on the right.

    I think in my case I only wanted one of the slices but I needed to make sure I got the *correct* slice as I wanted to delete it. Because in your case you want both slices I think you might have to resort to something like the following:

    Set SomeSlice = OriginalSolid.SliceSolid(...)
    Set FirstSlice = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 2)
    Set SecondSlice = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1)

    I haven't tried it, but I think FirstSlice and SecondSlice should be your slices as they would be the most recently created objects. SomeSlice should be the same as one of them. If you experiment you may find you can do away with one of the above statements.

    Just thought...OriginalSolid may become one of the slices so you may only get one new object rather than two. Check ThisDrawing.ModelSpace.Count before and after the SliceSolid.

    Regards

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Feb 20, 2004
    #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.