Changing subassembly position representations from top-level assembly multi-value user parameters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to create a Form that has multi-value user parameters, where the user can select from and it would select the corresponding position representation of a subassembly that has the same name.
When I try the following code, I get a an error on line 5. I was hoping to be able to access the component position rep from here.
Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition If Arm_Trial_Dimension = "5" Then oAsmCompDef.RepresentationsManager.ActivePositionalRepresentation.Name = "Arm Trial Position 5" End If
Is this because I have not specified the subassembly name? I would like to avoid using explicit component names, if possible, and rather let it change the position rep of any component within the top-level if it finds a position rep with that name. This is because we have several subassemblies with different file names/part numbers but they all share the same type of position rep and need to behave the same if one is replaced for the other. Hope that makes sense.
I wished we could just right click and capture the position rep from here like you can for so many other aspects but this only shows constraints...
I had this working with model states, but unfortunately model states are not reliable in 2022. So now I'm hoping to achieve the same idea with using positional reps and no model states in hopes I can get more reliable results.
Kenny
If this post solved your issue please mark "Accept as Solution". It helps everyone...really!