Hi @Matthew_Policelli
You will need 2 rules.
Let's call them :
- PDF Button Rule
- PDF Rule
On the form, use the rule called "PDF Button Rule" as the button.
The event trigger still calls the original rule ( "PDF Rule" in this example )
The code for "PDF Button Rule" will call the "PDF Rule" and send it an argument to tell it to ask questions or not ask questions, and would be something like this:
Dim oValueMap As Inventor.NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap()
oValueMap.Add("SkipPrompt", True)
iLogicVb.RunRule("PDF Rule", oValueMap)
The PDF Rule would have some code at the beginning to receive the argument from the other rule, and use it to determine if it needs to prompt the user. It would look something like this:
'set default value for variable
oSkipPrompt = False
'try to set variable based on argument from other rule
oSkipPrompt = RuleArguments("SkipPrompt")
If oSkipPrompt = False Then
oInput = MessageBox.Show("Are you sure you want to create the PDF?", "iLogic",MessageBoxButtons.YesNo)
If oInput = vbNo Then Exit Sub
End If
''' code to create PDF here
''' code to create PDF here...
MessageBox.Show("your PDF was created!", "iLogic")
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com