Extracting or merging bodies

Forums: 

Hey everyone it is me again. I was wondering if there is a good way to get multiple bodies into one with Snap. Much like the "Extract geometry" function. What im doing is, im checking the distance for bodies and if they are inside a Body im trimming them. Ofc i get a trim Body for each trim, so i would like to add some cleaning up.

I tried to add all of them to an Array and orphan them so i can at least delete the extrude and the outside bodies but it doesnt seem to work. Somehow bodies with distance > 0 get inside my Array. Dunno why.

Heres the code:


Public Shared Function Extrudearc(ByRef curvestoextrude() As NX.Curve)

Arraysortarc(curvestoextrude)
exbody = Snap.Create.ExtrudeSheet(curvestoextrude, exvector, exlength, 0)

Dim selectbodymenu As New Trimmenu
selectbodymenu.Show()
Dim bodyhold() As NX.Body
Dim bodycount As Integer = 0

For Each body As Object In exbody.Bodies

If Compute.Distance(body, selectedbody) = 0 Then
Snap.Create.TrimBody(body, selectedbody, False)
End If
Next

End Function

End Class

"I was wondering if there is a good way to get multiple bodies into one with Snap."

Like using the "unite" command?

From the description in the first post, I'm not sure what your end goal is. Can you explain more what it is that you are trying to do?

I stumbled upon the unite function already but it is the Problem that i cant delete the bodies after i united them. i generally wanna have all created bodies as one Body and delete the rest after, so the user will just have one Body for further process afterwards.

On another note, how do i sign a Programm so users without a snap license can run the .dll

The unite command will combine multiple bodies into a single body. However, there are options in the settings section of the dialog called "keep tool" and "keep target"; if one or both of these are selected, copies of the tool or target bodies will be created. Perhaps one or both of these options were inadvertently turned on when you performed the unite?