Ilogic Global Form Update Parameter

Ilogic Global Form Update Parameter

james.johnston.2
Explorer Explorer
1,622 Views
2 Replies
Message 1 of 3

Ilogic Global Form Update Parameter

james.johnston.2
Explorer
Explorer

I am trying to get a Global form to update a parameter, but it is not updating until the next run through. 

 

I have tried using 

RuleParametersOutput()

to get it to update with no success

 

iLogicForm.ShowGlobal("Global Form", FormMode.Modal)
RuleParametersOutput()

MessageBox.Show(UA_1, "UA_1")

RuleParametersOutput()
InventorVb.DocumentUpdate()

ThisApplication.CommandManager.ControlDefinitions.Item("AppIsometricViewCmd").Execute

  "Global Form is my form name" and UA_1 the Parameter to be edited in the Form. Any ideas? 

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

A.Acheson
Mentor
Mentor

Use the parameter function where ever you need the update to happen while the rule runs.

 

You will either need to run the rule manually with a button or to have the local parameter change trigger the rule then the parameter function Updates the value when the rule runs. 

 

Parameter.UpdateAfterChange = True

Parameter("UA_1") = "123"

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 3

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi @james.johnston.2,

 

I think the issue is that the rule as written is showing the form, and then stopping because the form is modal.

 

But if you use FormMode.NonModal, then the form shows and the rest of the code runs immediately.

 

Neither of those scenarios are really what you attempting to do.

 

It's because of this, that I would recommend splitting this into 2 rules.

 

Generally when I have a Show Form rule, it only shows the form... and I usually put an Update line above the showform line, just so that the model is in the expected state when the form is presented.

 

Such as this

 

Curtis_Waguespack_1-1681483317935.png

 

Then I would have another rule that has the other code:

 

Curtis_Waguespack_2-1681483346269.png

 

Note that the form buttons can dictate when things update too, but if you split the rule into 2 rules, I don't think it will matter in this case.

Curtis_Waguespack_0-1681483275304.png

 

Curtis_Waguespack_3-1681483468021.png

 

And another thing you could do, is set the form to have no Predefined buttons, and then use your rule as the Update/Ok button.

 

Curtis_Waguespack_4-1681483745555.png

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

EESignature

0 Likes