Workaround for modifying an occurrence parameter with a model state.
What's New: 2022
An assembly can have 2 or more instances of the same part (or subassembly), where the same part (or subassembly) is in 2 different model states. When you have component instances of the same part (or subassembly) that are in different model states, it's possible that one or more of the instances may not be modifiable. If you modify one member (which is in one model state), that means another member (which is in a different model state) cannot be modified. However, you can make it modifiable by updating the assembly itself. Here's an example:
InventorVb.DocumentUpdate() Parameter("Part1:1", "Length") = 1 Parameter("Part1:1", "Width") = 0.5 ' The parameter assignments above modify the member document of the first occurrence, which makes the member document of the second occurrence not modifiable. ' To make it modifiable, update this assembly document: InventorVb.DocumentUpdate() ' Now we can modify the other model state: Parameter("Part1:2", "Length") = 2 Parameter("Part1:2", "Width") = 1.5
As a best practice, make all the changes required in the first instance of the same part (or subassembly), before updating and changing the second instance of the same part (or subassembly).