Rule doesn't update the model

Rule doesn't update the model

eugen.gutol
Contributor Contributor
648 Views
5 Replies
Message 1 of 6

Rule doesn't update the model

eugen.gutol
Contributor
Contributor

Hi,

I made a rule which changes a flange according to selected type and sub type using Case function.

The issue is that when I change the type model doesn't update fully unless I change the subtype also.

Below is the code:

 

MultiValue.SetValueOptions(True, DefaultIndex := 0)

Select Case Flange_Group
Case "A"
	MultiValue.SetList("Flange_type", "A1", "A2", "A3")
	Feature.IsActive("Corner Hole 1") = True
	Feature.IsActive("Corner Hole 2") = True
	Feature.IsActive("Corner Holes mirror") = True
	Select Case Flange_type
	Case "A1"
		Width = 250
		Height = 500
		Flange_thk = 75
		hole_nr_vert = 7
		hole_nr_hrz = 5
	Case "A2"
		Width = 350
		Height = 500
		Flange_thk = 75
		hole_nr_vert = 9
		hole_nr_hrz = 5
	Case "A3"
		Width = 400
		Height = 500
		Flange_thk = 75
		hole_nr_vert = 11
		hole_nr_hrz = 5
	End Select
	
Case "B"
	MultiValue.SetList("Flange_type", "B1", "B2", "B3")
	Feature.IsActive("Corner Hole 1") = False
	Feature.IsActive("Corner Hole 2") = False
	Feature.IsActive("Corner Holes mirror") = False
		Select Case Flange_type
		Case "B1"
			Width = 150
			Height = 250
			Flange_thk = 50
			hole_nr_vert = 3
			hole_nr_hrz = 3
		Case "B2"
			Width = 150
			Height = 350
			Flange_thk = 50
			hole_nr_vert = 3
			hole_nr_hrz = 5
		Case "B3"
			Width = 150
			Height = 400
			Flange_thk = 50
			hole_nr_vert = 3
			hole_nr_hrz = 7
		End Select
Case "C"
	MultiValue.SetList("Flange_type", "C1", "C2", "C3")
	Feature.IsActive("Corner Hole 1") = False
	Feature.IsActive("Corner Hole 2") = False
	Feature.IsActive("Corner Holes mirror") = False
		Select Case Flange_type
		Case "C1"
			Width = 300
			Height = 300
			Flange_thk = 20
			hole_nr_vert = 4
			hole_nr_hrz = 4
		Case "C2"
			Width = 400
			Height = 400
			Flange_thk = 20
			hole_nr_vert = 6
			hole_nr_hrz = 6
		Case "C3"
			Width = 500
			Height = 500
			Flange_thk = 20
			hole_nr_vert = 8
			hole_nr_hrz = 8
		End Select
End Select

Moving the subtype below the main Select case which defines the sub types doesn't change the result.

 

Setup ASetup ASetup B after I change to itSetup B after I change to itActual Setup B after I switch to B2 and back to B1Actual Setup B after I switch to B2 and back to B1

0 Likes
649 Views
5 Replies
Replies (5)
Message 2 of 6

DRoam
Mentor
Mentor

Try adding the following line to the top of your rule:

 

iLogicVb.UpdateWhenDone

 

Sometimes iLogic will change parameters and things but the model doesn't update accordingly until it's told to do so. 

0 Likes
Message 3 of 6

eugen.gutol
Contributor
Contributor

I've added at the end 

iLogicVb.UpdateWhenDone = True

but it didn't change anything 

0 Likes
Message 4 of 6

Anonymous
Not applicable

Separate it to 2 rules.

GroupRule with with Flange_Group Select

TypeRule with with Flange_Type Select

That should work

0 Likes
Message 5 of 6

eugen.gutol
Contributor
Contributor

That's the thing I don't want to split it to several rules. There will be other rules with similar structure and I don't want to have a rule for every 5-6 features.

0 Likes
Message 6 of 6

Anonymous
Not applicable

I have a workaround:

Add a blank position on your list on first position. Then you'll be forced to change it every time you change flange group. And selecting a blank position will make no change, so it's not a problem.

MultiValue.SetList("Flange_type", "A1", "A2", "A3")
change to
MultiValue.SetList("Flange_type", "", "A1", "A2", "A3")

xxxx.png