Get iLogic to wait for form completion

Get iLogic to wait for form completion

SharkDesign
Mentor Mentor
2,291 Views
5 Replies
Message 1 of 6

Get iLogic to wait for form completion

SharkDesign
Mentor
Mentor

I have got iLogic displaying a form which asks for a few inputs, but then it races off completing the rest of the ilogic code before the form window has been closed.

 

Is there a way to get iLogic to wait for the form to be closed before carrying on with the next line of code?

 

Thank you for any help.

 

 

Inventor 2016

  Inventor Certified Professional
0 Likes
Accepted solutions (1)
2,292 Views
5 Replies
Replies (5)
Message 2 of 6

LukeDavenport
Collaborator
Collaborator

 

Hi James, try these options in the form. If you add an 'apply' button the form will wait until you hit apply before it runs changes you've made.

Does that work?

Luke

 

Picture1.png

0 Likes
Message 3 of 6

SharkDesign
Mentor
Mentor

Thanks for the reply, I tried what you said but it still carries on without waiting.

 

It's basically an extrusion that changes length and saves the result as a file.

 

The form is:

 

form.PNG

 

 

My code is this:

 

JN = iProperties.Value("Project", "Project")
PN = "P8 40x40-" & L
Nm=iProperties.Value("Summary", "Author")
saveFolder = "C:\Users\User\Desktop\Item\"  

Nm=myName
iLogicForm.Show("Item Creation")
ThisDoc.Document.SaveAs(SaveFolder & JN & " " & PN & (".ipt") , True)
MessageBox.Show("Part created", "Item create")

Else
End If
iLogicVb.UpdateWhenDone = True

 

  Inventor Certified Professional
0 Likes
Message 4 of 6

LukeDavenport
Collaborator
Collaborator
Accepted solution

 

Hi James,

I've just tried it myself - If you have an 'Apply' button on the form, then any parameter changes you type in will not be applied to the model until you hit the apply button.

 

Do you have an event trigger for the rule you pasted? If so why not simply get rid of that and add the rule itself as a button to the form, so that you enter your info on the form and then hit the button to create the copied file.

 

Luke

Message 5 of 6

SharkDesign
Mentor
Mentor

That's pretty much what I ended up doing.

Thanks

  Inventor Certified Professional
0 Likes
Message 6 of 6

JeremyVosnacos1076
Explorer
Explorer

By setting Modal to True within the rule or

JeremyVosnacos1076_0-1626930245561.png

Setting Modal as True when you run it using ilogic

iLogicForm.ShowGlobal("Form 1",1)