iLogic, updating parts as needed.

iLogic, updating parts as needed.

TKey_Luttrell
Advocate Advocate
2,081 Views
2 Replies
Message 1 of 3

iLogic, updating parts as needed.

TKey_Luttrell
Advocate
Advocate

I have an assembly, its not too complicated, but i have sets of parts that need to be turned off and turned back on based on the overall length of the assembly, which i control via parameters.  Each of these parts is constrained to an extrusion in another part.  These extrusions also turn on and off based on the overall length of the assembly.  So currently what i am doing in the iLogic is.

Check to see which of the part sets should be turned off.
Turn off the constraints, then suspend the parts that need to be off.
Then feed the new length to the parts whose extrusions need to change.

Check to see if any parts are off that should be turned on.
Turn the parts back on, then turn on their constraints.

 

My problem is that the extrusions do not seem to update until AFTER the parts and constraints are turned back on, so my iLogic fails out because of errors, and i have to go in and manually update the parts to get the errors to clear.

 

Is there a way to tell iLogic to specifically update and rebuild a specific part AT THIS MOMENT.  So those parts will already be rebuilt and ready to accept other parts before i turn them on?

0 Likes
Accepted solutions (1)
2,082 Views
2 Replies
Replies (2)
Message 2 of 3

TKey_Luttrell
Advocate
Advocate

here is the iLogic i am currently using.

'CALCULATIONS

If Even_Space_Studs Then
	Stud_Count = Ceil(Length / 18)
End If

'END CALC

	If Stud_Count <1 Then
		Constraint.IsActive("Mate:9") = False
		Constraint.IsActive("Flush:14") = False
		Constraint.IsActive("Flush:15") = False
		Constraint.IsActive("Mate:10") = False
		Constraint.IsActive("Mate:11") = False
		Constraint.IsActive("Flush:16") = False
		
		Component.IsActive("SET_1_A") = False
		Component.IsActive("SET_1_B") = False
	End If
	If Stud_Count <2 Then
		Constraint.IsActive("Mate:12") = False
		Constraint.IsActive("Flush:17") = False
		Constraint.IsActive("Flush:18") = False
		Constraint.IsActive("Flush:19") = False
		Constraint.IsActive("Mate:13") = False
		Constraint.IsActive("Mate:14") = False
		
		Component.IsActive("SET_2_A") = False
		Component.IsActive("SET_2_B") = False
	End If
	If Stud_Count <3 Then
		Constraint.IsActive("Mate:15") = False
		Constraint.IsActive("Flush:20") = False
		Constraint.IsActive("Flush:21") = False
		Constraint.IsActive("Mate:17") = False
		Constraint.IsActive("Mate:18") = False
		Constraint.IsActive("Flush:24") = False
		
		Component.IsActive("SET_3_A") = False
		Component.IsActive("SET_3_B") = False
	End If
	If Stud_Count <4 Then
		Constraint.IsActive("Mate:16") = False
		Constraint.IsActive("Flush:22") = False
		Constraint.IsActive("Flush:23") = False
		Constraint.IsActive("Mate:19") = False
		Constraint.IsActive("Mate:20") = False
		Constraint.IsActive("Flush:25") = False
		
		Component.IsActive("SET_4_A") = False
		Component.IsActive("SET_4_B") = False
	End If
	If Stud_Count <5 Then
		Constraint.IsActive("Mate:21") = False
		Constraint.IsActive("Flush:26") = False
		Constraint.IsActive("Flush:27") = False
		Constraint.IsActive("Mate:26") = False
		Constraint.IsActive("Flush:31") = False
		Constraint.IsActive("Mate:23") = False

		
		Component.IsActive("SET_5_A") = False
		Component.IsActive("SET_5_B") = False
	End If
	If Stud_Count <6 Then
		Constraint.IsActive("Mate:22") = False
		Constraint.IsActive("Flush:28") = False
		Constraint.IsActive("Flush:29") = False
		Constraint.IsActive("Mate:24") = False
		Constraint.IsActive("Mate:25") = False
		Constraint.IsActive("Flush:30") = False
		
		Component.IsActive("SET_6_A") = False
		Component.IsActive("SET_6_B") = False
	End If

Parameter("FLR", "Width") = Thickness
Parameter("FLR", "Length") = Length
Parameter("FLR", "Thickness") = Substrate_Thickness

Parameter("FLR_D", "Width") = Thickness
Parameter("FLR_D", "Length") = Length
Parameter("FLR_D", "Thickness") = Substrate_Thickness
Parameter("FLR_D", "Stud_Count") = Stud_Count

ThisDoc.Document.Update()

Parameter("TOP", "Width") = Thickness
Parameter("TOP", "Length") = Length
Parameter("TOP", "Thickness") = Substrate_Thickness

Parameter("TOP_D", "Width") = Thickness
Parameter("TOP_D", "Length") = Length
Parameter("TOP_D", "Thickness") = Substrate_Thickness
Parameter("TOP_D", "Stud_Count") = Stud_Count

ThisDoc.Document.Update()

Parameter("STUD", "Width") = Thickness
Parameter("STUD", "Length") = Height - Substrate_Thickness *4 +.5
Parameter("STUD", "Thickness") = Substrate_Thickness

	If Stud_Count >0 Then
		Component.IsActive("SET_1_A") = True
		Component.IsActive("SET_1_B") = True
		
		Constraint.IsActive("Mate:9") = True
		Constraint.IsActive("Flush:14") = True
		Constraint.IsActive("Flush:15") = True
		Constraint.IsActive("Mate:10") = True
		Constraint.IsActive("Mate:11") = True
		Constraint.IsActive("Flush:16") = True
	End If
	If Stud_Count >1 Then		
		Component.IsActive("SET_2_A") = True
		Component.IsActive("SET_2_B") = True
		
		Constraint.IsActive("Mate:12") = True
		Constraint.IsActive("Flush:17") = True
		Constraint.IsActive("Flush:18") = True
		Constraint.IsActive("Flush:19") = True
		Constraint.IsActive("Mate:13") = True
		Constraint.IsActive("Mate:14") = True
	End If
	If Stud_Count >2 Then
		Component.IsActive("SET_3_A") = True
		Component.IsActive("SET_3_B") = True
		
		Constraint.IsActive("Mate:15") = True
		Constraint.IsActive("Flush:20") = True
		Constraint.IsActive("Flush:21") = True
		Constraint.IsActive("Mate:17") = True
		Constraint.IsActive("Mate:18") = True
		Constraint.IsActive("Flush:24") = True
	End If
	If Stud_Count >3 Then
		Component.IsActive("SET_4_A") = True
		Component.IsActive("SET_4_B") = True
		
		Constraint.IsActive("Mate:16") = True
		Constraint.IsActive("Flush:22") = True
		Constraint.IsActive("Flush:23") = True
		Constraint.IsActive("Mate:19") = True
		Constraint.IsActive("Mate:20") = True
		Constraint.IsActive("Flush:25") = True
	End If
	If Stud_Count >4 Then
		Component.IsActive("SET_5_A") = True
		Component.IsActive("SET_5_B") = True
		
		Constraint.IsActive("Mate:21") = True
		Constraint.IsActive("Flush:26") = True
		Constraint.IsActive("Flush:27") = True
		Constraint.IsActive("Mate:26") = True
		Constraint.IsActive("Flush:31") = True
		Constraint.IsActive("Mate:23") = True
	End If
	If Stud_Count >5 Then
		Component.IsActive("SET_6_A") = True
		Component.IsActive("SET_6_B") = True
		
		Constraint.IsActive("Mate:22") = True
		Constraint.IsActive("Flush:28") = True
		Constraint.IsActive("Flush:29") = True
		Constraint.IsActive("Mate:24") = True
		Constraint.IsActive("Mate:25") = True
		Constraint.IsActive("Flush:30") = True
	End If

ThisDoc.Document.Rebuild()

iLogicVb.UpdateWhenDone = True
0 Likes
Message 3 of 3

TKey_Luttrell
Advocate
Advocate
Accepted solution
0 Likes