The parameter "Hauteur_tab" is modified by a form. If I use the MessageBoxes, I can see the Part Number is modified. But if I check on the part (iProperties), it has always the old value, like if the rule could not send back the result in the part. Sometimes it works, sometimes not...
Is this rule in an assembly? I ask because of the following line where you are setting the iProperty, the red part looks like you are telling the Part Number iProperty for that specific part to change.
iProperties.Value("AFNOR 60,3 x 4 00000001:1", "Project", "Part Number") = "4.7181.0455.0.0"
If the rule is in a part, try just doing this...
iProperties.Value("Project", "Part Number") = "4.7181.0455.0.0"
Another thing you could try is...
If Hauteur_TAB = 2000 Then
'MessageBox.Show(iProperties.Value("AFNOR 60,3 x 4 00000001:1", "Project", "Part Number"), "Title")
iProperties.Value("AFNOR 60,3 x 4 00000001:1", "Project", "Part Number") = "4.7181.0455.0.0"
'MessageBox.Show(iProperties.Value("AFNOR 60,3 x 4 00000001:1", "Project", "Part Number"), "Title")
End If
RuleParametersOutput()
InventorVb.DocumentUpdate()
It is a iLogic code within the assembly. It modifies the property of the occurrence. What TONELLAL mentioned is: after modification, the value is correct when he checked it and popped out by message box. But when he checked the iProperties dialog of the occurrence, the value is still the old one.
Hi TONELLAL,
I also gave a test on a very simple file a couple of times. It works well to me. The value in the iProperties is always updated. Since you mentioned the behavior does not always occur, could you try to find in which scenario it can reproduce, or is it related with specific data?
I tried to make a new simplified model to reproduce the problem.I had others problems...
The context :
I have an assembly, containing a Frame Generator su-assembly, which contain a single part created by FG.
The assembly contain a custom parameter.
Depending of this parameter value, an iLogic rule (in the assembly) modify the part number of the FG part.
The parameter is modified via an iLogic form.
What I had first time (my 1st post) :
or
If you modify the parameter using a form, the property is modified during the execution (this is checked by a messagebox), but once finished, if you check the property on the part it is not modified.
What I had today :
The rule is never fired when I modify the parameter, I have to launch it manually. Even if I put event on "modify model parameter" the rule is not fired.
It seems iLogic cannot be trusted !
Dear TONELLAL,
Skeleton models often include rather complex internal references that should be taken into account by rules logic.
Will you please upload your simplest test assembly with iLogic rules that could clarify the problem.
Thanks,
I send you a very simplified assembly.
The assembly contains only one occurrence named AFNOR, in a Frame assembly.
There is only one parameter modified by the form. It contains a listbox with 3 values : 1600, 1800 or 2000.
The rule Designation modify the Part Number of the occurrence AFNOR depending of the value in the form :
1600 --> 3333333333
1800 --> 2222222222
2000 --> 1111111111
Workflow :
Open the part and display the form.
Modifiy the value and check the Part Number property on the part : It is not modified.
Run the rule manually.
Check the Part number : it is modified !
I slightly modified the code of your rule. It works for me.
iLogicVb.UpdateWhenDone = True Dim Tab As DoubleForEquals = Parameter("Hauteur_TAB") Dim Result As String = "?" Select Case Tab Case 2000 Result = "1111111111" Case 1800 Result = "2222222222" Case 1600 Result = "3333333333" Case Else 'do nothing now End Select If Result <> "?" Then iProperties.Value(MakePath("Frame proto:1", "AFNOR 60,3 x 4 00000001:1"), _ "Project", "Part Number") = Result Beep End If RuleParametersOutput() InventorVb.DocumentUpdate()
Cheers,
Sorry to tell you... that it is always the same problem ! It seems the rule is not fired when using the form : there is no beep when I modify the value via the form, but if I modify the value via the form then I launch the rule manually it is ok.
If you replace line
Dim Tab As DoubleForEquals = Parameter("Hauteur_TAB")
with
Dim Tab As DoubleForEquals = Hauteur_TAB
your rule will be fired after any changes of the "blue" parameter "Hauteur_TAB" value.
It doesn't matter if you do it manually in the parameter editor or programmatically via your iLogic form.
Cheers,