Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Hi Rikard,

 

Thanks for the sample.

 

Please find the sample code to stitch surfaces at component occurrence level.

 

    Dim oAssemblyDoc As AssemblyDocument = ThisApplication.ActiveDocument

    Dim oAssemblyDef As AssemblyComponentDefinition = oAssemblyDoc.ComponentDefinition

    Dim occ As ComponentOccurrence
    occ = oAssemblyDef.Occurrences.ItemByName("CopyObject1")

    occ.Edit()

    Dim oCompDef As PartComponentDefinition
    oCompDef = occ.Definition

    Dim oSurfaces As ObjectCollection
    oSurfaces = ThisApplication.TransientObjects.CreateObjectCollection

    oSurfaces.Add(oCompDef.WorkSurfaces.Item(1))
    oSurfaces.Add(oCompDef.WorkSurfaces.Item(2))

    Dim oKnitFeature As KnitFeature
    oKnitFeature = oCompDef.Features.KnitFeatures.Add(oSurfaces)

    occ.ExitEdit(ExitTypeEnum.kExitToPrevious)
	
    oAssemblyDoc.Update

Before_stitch.JPG

 

 

After_stitch.JPG

Please feel free to contact if there is any doubt.

 


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network