Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic form, how to check if form is shown?

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
hollypapp65
128 Views, 6 Replies

iLogic form, how to check if form is shown?

How to check if an iLogic form is active/shown?

6 REPLIES 6
Message 2 of 7
CCarreiras
in reply to: hollypapp65

I believe is not possible to check that.

 

...only the old way... looking to the screen 😅

CCarreiras

EESignature

Message 3 of 7
hollypapp65
in reply to: hollypapp65

It is not a Dockable window.

I'll dig deeper.

Message 4 of 7
mslosar
in reply to: hollypapp65

best i could think of is put it in a try/catch.  Though, the form not showing would have to actually trigger an error. There is no 'formSuccess' function or anything.  You can detect if they click yes/no/cancel, but I am not aware of anything telling if it displayed or not.

Message 5 of 7
hollypapp65
in reply to: hollypapp65

I'm making an "interactive" form.

Using check box to enable/disable different options.

Also change options in multilist properties.

Using a rule trigger by "Any user parameter change".

I want to "disable" the trigger when form is not shown.

So I'm try to add:

If Form.shown then

'only run update when form is active/shown

End if

Message 6 of 7
mslosar
in reply to: hollypapp65

I get the idea, but i'm not sure the option exists. I would think, in theory, if you're triggering a box on a parameter change, that you'd make you choices in the box and 'OK' it so the box goes away, then any subsequent change triggers a new box.  If you're going to leave it on the screen, you'd need to detect it's presences, clear it, and reload it.

 

Not sure it's within the realm of ilogic, but you could use a rule to trigger the form, and something in it along the lines of 'if Launched = 1 then nothing, else show form.  In your form, when it initializes, set launched = 1. When you close the form, set Launched = 0. That gives you something to key on, but there there's no built in event for this. If you are trying to keep this solely within ilogic, you'd have to assume the form always successfully launches. In which case you could do something like

 

if Launched = 0 then

   Launched = 1

   show.form

   Launched = 0 'not sure if this works in ilogic the way it does in .net where it doesn't pass show.form until you close the form.

else

   'form is already open, so do nothing

end if

 

Only thing is, not sure there is a way in pure ilogic to set Launched back to 0 when you close the form. You can do it in .net or VBA though, but then it won't trigger as a rule most likely.

Message 7 of 7
hollypapp65
in reply to: hollypapp65

I use True/False user parameter.

It work only when form is modal.

Parameter("FormActive") = True
iLogicForm.Show("Cab Config Test", FormMode.Modal)
Parameter("FormActive") = False

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report