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,

 

A little modification in the code. Please find the modified code in the following.

 

    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 oSourceBody As SurfaceBody = oPartDef1.Worksurfaces.Item(1).Surfacebodies(1)

	Dim nonPrmFeatures As NonParametricBaseFeatures = oPartDef2.Features.NonParametricBaseFeatures 
	Dim nonprmFea As NonParametricBaseFeature = nonPrmFeatures.Item(1)

	nonprmFea.Redefine(oSourceBody)


    oAssemblyDoc.Update

Please feel free to contact if there is any doubt.


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network