how to fill object objectcollection for derivedparametertable

how to fill object objectcollection for derivedparametertable

GeertvanderHeide
Advocate Advocate
340 Views
2 Replies
Message 1 of 3

how to fill object objectcollection for derivedparametertable

GeertvanderHeide
Advocate
Advocate

Hi all, 

 

i want to be able to link/ update a derived parameter table. 

updating is not an option, so i have to delete it first and than add the new file again. 

The point is that i don't need all the parameters in the linked file. 

This is possible but i do have to fill an objectcollection, and i have no clue how to do that. 

Dim Odoc As Document = ThisApplication.ActiveDocument
Dim oCompDef As ComponentDefinition = Odoc.componentdefinition
Dim oparam As Inventor.Parameters = oCompDef.parameters
oparam.DerivedParameterTables.Item(1).Delete
oparam.DerivedParameterTables.Add2("fullfilename of parameter file", ??) 

 i don't know if i can fill an object collection with an array of strings, or if i have to specify each parameter as an inventor.parameter type object. but than again i don't know how to do that with just a parameter name. 

 

I know which parameters i want to import, and these names don't change. 

It is just my lack of knowledge how to fil objectcollection of types i don't know, or are not able to find. 

 

Kind regards, 

 

Geert

0 Likes
Accepted solutions (1)
341 Views
2 Replies
Replies (2)
Message 2 of 3

A.Acheson
Mentor
Mentor
Accepted solution

The API sample shows that you need the parameter objects in a collection "oParamsToLink " and then add it to the table as below. API Help Sample here

DerivedParameterTable.LinkedParameters = oParamsToLink 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 3

GeertvanderHeide
Advocate
Advocate
ah awesome. i missed the createobjectcollection part 😉 thought it would be available when you jsut defined it as an objectcollection, just like an integer for example
Thanks!
0 Likes