Inventor iLogic Save As Event Trigger

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello guys,
I'm trying to create a part number generator through iLogic and I intend to add the iLogic code to the Standard Part.ipt template.
What I want to be able to do is ask the user once they have created their design from the template, after they select save, whether they want to create a part number (which opens the part number generator form) or whether they want to save their rubbish design in the "Useless designs" folder.
This I have managed to do. (see attached image)
However, in the event that a "useless design" becomes an "interesting design", I want the user to be asked the question on the 'save as' trigger event. But this isnt available. ... Or.. the user wants to save Useless design_1 to Useless design_2.
How can I get around it?
+ First Save - Does the user want to create a part Number?
+ Yes -- > Open User Form +No ---> Open Save As Dialog Box
+ Second Save - Does the User want to create a part number now?
+ Yes ---> Open user form + No --> Document.Save
+ User Selects Save As ..
----> User enters filename they require, presses save.
----> This triggers question box (Do you want to create a part number?)
Currently as the user presses No, it closes the part and doesnt save the file.
Here is the code I have so far:
question = MessageBox.Show("Would you like to Generate a Unique Part Number?"&vbLf _
&"Current Part Number: "&iProperties.Value("Project", "Part Number"), "iLogic Message Box", MessageBoxButtons.YesNo )
If question = vbYes Then
'open the user form
iLogicForm.Show("Part Number Generator")
Else If question = vbNo Then
'Do nothing
''Save the document
ThisDoc.Document.Save
MessageBox.Show("Saved.")
End If
'