- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello. There is likely a very simple solution for this but I'm really struggling with getting this working properly for our department.
I want to modify the native model state of a part component occurrence in an assembly, but what's happening is it appears that it's only changing the part model state within the context of the parent assembly that it's in. When I open the part on its own, the model state is still set on [Primary] and it wasn't updated properly.
I'm essentially doing this:
Dim oAsmCompDef As AssemblyComponentDefinition
'Getting access to the parent assembly
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oOccurrence As ComponentOccurrence
'Don't worry about oPath or oMatrix... Those are set more complexly but will access a part that was created from a template and added to the assembly. I can access this correctly without issue.
oOccurrence = oAsmCompDef.Occurrences.Add(oPath, oMatrix)
oOccurrence.ActiveModelState = modelStateStringName
RuleParametersOutput()
InventorVb.DocumentUpdate()
I've tried figuring out how to access the NativeObject of the component occurrence so that it sets the model state of the part itself and not just within the context of the parent assembly, but I don't think I was doing it correctly.
Within iLogic, do I need to actually open the part up on its own to change the model state and then close it?
Thanks for your help!
Solved! Go to Solution.