04-02-2017
11:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-02-2017
11:16 PM
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
Please feel free to contact if there is any doubt.
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network
