Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
zoe.baker-bushby
553 Views, 6 Replies

iLogic Create Model State in Part won't run again

Hi I have the following rule:

	MessageBox.Show("START")
	Dim doc As PartDocument = ThisDoc.Document
	oPCD = doc.ComponentDefinition
	oMStates = oPCD.ModelStates
	Dim masterMS As ModelState = oMStates.Item("Master")
	masterMS.Activate()
	oMState = oMStates.Add(PartNumber)
	ThisDoc.ActiveModelState = "Master"
	
	PartNumber = PartNumber
	
	iLogicVb.UpdateWhenDone = True

 

I call this via a button in a form. On first run it works fine.

 

When trying to run again, ModelStateName being set to a different name, it will not execute.

The 'START' message box doesn't even appear. 

 

Is there something wrong with my code or is this a bug??

 

Any advice would be great :slightly_smiling_face:

 

Labels (3)