Hi @C_Haines_ENG. That is a very good question. I do not think there is a way to do it through these objects & properties, but there may be another way.
- The DerivedParameterTable.DerivedParameters property is ReadOnly.
- The DerivedParameters collection object does not have an 'Add' method.
- The DerivedParameter has a Delete method, and a property for accessing the source Parameter (DerivedParameter.ReferencedEntity), but not a method like 'Replace'.
- The DerivedParameterTable.LinkedParameters property is Read/Write, but its Value type is an Inventor.ObjectCollection, which is a 'transient' object.
- Transient objects are temporary, and generally only briefly used for relaying a specific collection of data from one place to another, then is destroyed.
- Therefore, we can not simply add an item into that collection directly to make it work, but instead it expects us to supply a whole ObjectCollection to set as the value of that LinkedParameters property. And unfortunately, that seems to replace the ones that are already in there, which may break some links between them and other parameters that may be dependent on them.
The 'other' way that comes to mind, but have not tested it, is to:
Either use the DerivedParameterTable.ReferenceComponent property to get the generic ReferenceComponent, then test which more specific sub-type it is, or go through the Document.ComponentDefinition.ReferenceComponents.DerivedPartComponents... code path, to dig back to the 'definition' of the derived component, and attempt to set the Parameter.ExposedAsProperty property of the source parameter(s), then 'flash' (toggle on/of, then back again) its DerivedPartDefinition.IncludeAllParameters (Read/Write Boolean). But I don't think we can do anything with its DerivedPartDefinition.Parameters property, since that is also ReadOnly, and the collection object it returns (DerivedPartEntities) does not have an 'Add' method either. Just some thoughts.
Edit: Since this seems like a pretty relevant thing to want to do, either manually, or by code, it may be a good idea to search within the Inventor Ideas forum to see if anyone else has requested this ability, and if you can't find one, maybe make a new Idea post for it, then post a Link to it back on this forum discussion, to direct some traffic & votes towards it. I would vote for it.
Edit2: Wow, I did not see your last reply before posting mine. I obviously had my reply window open for a longer time that I realized. 😅
Wesley Crihfield

(Not an Autodesk Employee)