03-15-2017
12:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-15-2017
12:19 AM
Hi Rikard,
Please try the following sample code if surface body is more than one.
Dim oAssemblyDoc As AssemblyDocument = ThisApplication.ActiveDocument Dim oAssemblyDef As AssemblyComponentDefinition = oAssemblyDoc.ComponentDefinition Dim oOccurrence1 As ComponentOccurrence = Component.InventorComponent("CopyObject2_1") Dim oPartDef1 As PartComponentDefinition= oOccurrence1.Definition Dim oOccurrence2 As ComponentOccurrence = Component.InventorComponent("CopyObject1") Dim oPartDef2 As PartComponentDefinition = oOccurrence2.Definition Dim oOccurrence3 As ComponentOccurrence = Component.InventorComponent("CopyObject2_2") Dim oPartDef3 As PartComponentDefinition= oOccurrence3.Definition Dim oSourceBody As SurfaceBody = oPartDef1.Worksurfaces.Item(1).Surfacebodies(1) Dim oSourceBody1 As SurfaceBody = oPartDef3.Worksurfaces.Item(1).Surfacebodies(1) Dim nonPrmFeatures As NonParametricBaseFeatures = oPartDef2.Features.NonParametricBaseFeatures Dim nonprmFea As NonParametricBaseFeature = nonPrmFeatures.Item(1) nonprmFea.Redefine(oSourceBody) nonprmFea.Redefine(oSourceBody1) oAssemblyDoc.Update
Please feel free to contact if there is any doubt.
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network
