Code to run only when form is open

Code to run only when form is open

Anonymous
Not applicable
1,023 Views
4 Replies
Message 1 of 5

Code to run only when form is open

Anonymous
Not applicable

Is there any way to check to see if a form is open, and if it is open, run some code? The setup is:

 

I have a form that is opened with a button in another form. When certain parameters are changed, rules are triggered and change some values. In order to speed up the processing time, I would like certain calculations to only run if the relevant form is open. Is this possible?

0 Likes
Accepted solutions (1)
1,024 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

For Example:

 

iLogicForm.Show("Form 1")

 is a predefined command that exists. Is there a way to access information about the form already being open? All I really need is a Boolean true/false

 

0 Likes
Message 3 of 5

bshbsh
Collaborator
Collaborator

You can check if the .Visible property of the userform is true or false. (At least in VBA, but I assume it's the same or similar in iLogic.)

 

0 Likes
Message 4 of 5

Anonymous
Not applicable

I get the error 'Visible' is not a member of 'Autodesk.iLogic.Interfaces.IiLogicForm'.

 

when I try to run this:

If iLogicForm.Visible("Meter Creator") = True Then
    MsgBox("Visible")
End If

 

Message 5 of 5

Anonymous
Not applicable
Accepted solution

So I created a workaround, where when clicking the button to launch the form, toggle a True/False parameter to true. Then, I created a button on the form to close it, that then toggles the true/false parameter to false.

0 Likes