To Modify an Occurrence Parameter with a Model State

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:

  1. Create a part file with an extruded feature, with Length and Width parameters, and 2 or more model states.
  2. Place 2 instances, each reflecting a different model state, of that part in an assembly. Activate different model states on the instances.
  3. Add the following iLogic rule to change the Length and Width:
    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).