Knit does not remove original surfaces

Knit does not remove original surfaces

Anonymous
Not applicable
406 Views
1 Reply
Message 1 of 2

Knit does not remove original surfaces

Anonymous
Not applicable

I have 4 surfaces, which I wish to stitch together.

KintDoesNotRemoveOriginal.png

 

I pass those as worksurfaces to Knitfeatures.Add which cerates the result as 5th surface.

I wish the original 4 were deleted. Calling delete on them does not work either.

 

        Private Sub stitchMidsurfaces()
            Dim oWorkSurfaces As ObjectCollection = _invApp.TransientObjects.CreateObjectCollection
            For Each ws As WorkSurface In m_partDoc.ComponentDefinition.WorkSurfaces
                oWorkSurfaces.Add(ws)
            Next

            Dim oSurfBodies As ObjectCollection = _invApp.TransientObjects.CreateObjectCollection
            For Each sb As SurfaceBody In m_partDoc.ComponentDefinition.SurfaceBodies
                If Not sb.IsSolid() Then
                    oSurfBodies.Add(sb)
                End If
            Next

            Dim oKnitFeature As KnitFeature
            oKnitFeature = m_partDoc.ComponentDefinition.Features.KnitFeatures.Add(oWorkSurfaces)

            ' delete the original surfaces
            For Each ows As SurfaceBody In oSurfBodies
                ows.Delete()
            Next
        End Sub

Any clue?

0 Likes
407 Views
1 Reply
Reply (1)
Message 2 of 2

Vladimir.Ananyev
Alumni
Alumni

You cannot delete the parent surfaces.

You may try to create the KnitFeature basing on the NonParametricBaseFeature that does not reference any source geometry.


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes