Message 1 of 5
Linking parameters to existing derived parameter table crashes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
i have two parts, part 1 and part2.
Part 2 is already linked to part 1. I would like to link an extra parameter (d3 in this case) to it.
i have followed the sample in the help guide but can't get to work.
here is my code and the parts are attached with the code in part 2:
Sub main
Dim param As String = "d3"
Dim oCompDef As Inventor.PartComponentDefinition = ThisDoc.Document.ComponentDefinition
Dim oLinkedPart As Inventor.PartDocument
Dim oTable As Inventor.DerivedParameterTable = oCompDef.Parameters.DerivedParameterTables.Item(1)
Dim oParamsToLink As Inventor.ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
'oParamsToLink = oTable.DerivedParameters
For Each oPAram In oTable.LinkedParameters
oParamsToLink.Add(oPAram)
Next
oLinkedPart = oTable.ReferencedDocumentDescriptor.ReferencedDocument
oParamsToLink.Add(oLinkedPart.ComponentDefinition.Parameters.Item(param))
oTable.LinkedParameters = oParamsToLink
End Sub
any help greatly appreciated,
thanks,
John