06-22-2022
01:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-22-2022
01:35 AM
The activated model state does change though?
When you create a new model state it automatically changes to the new state?
Just running something as small as:
MessageBox.Show("START") Dim doc As PartDocument = ThisDoc.Document oPCD = doc.ComponentDefinition oMStates = oPCD.ModelStates oMState = oMStates.Add(PartNumber) iLogicVb.UpdateWhenDone = True
Changes the state.
You are however correct in saying that:
ThisDoc.ActiveModelState = "Master"
Is the line that is making it so that the rule does not run again.
However, I need it to toggle back to Master.
Changing syntax to:
Dim masterMS As ModelState = oMStates.Item("Master") masterMS.Activate()
Also doesn't work. It again runs once but won't run again.
However if I make a separate rule which just has:
ThisDoc.ActiveModelState = "Master"
I can then call this from my other rule and everything works fine...
MessageBox.Show("START") Dim doc As PartDocument = ThisDoc.Document oPCD = doc.ComponentDefinition oMStates = oPCD.ModelStates oMState = oMStates.Add(PartNumber) iLogicVb.RunRule("Master") iLogicVb.UpdateWhenDone = True
So the order I am trying to do things is fine.
This has got to be a bug?
Unless I am just overlooking something ![]()