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 - distinguish if assembly saved a file or I manually did it

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
david.kirschner07
436 Views, 2 Replies

iLogic - distinguish if assembly saved a file or I manually did it

Hi,

I would need your advice in the following issue:

I remind a user with a Yes/No MsgBox not to forget to edit the iProperties, because it is often a missed step. I trigger this rule "Before save the document", but the problem occurs when I have an assembly with lots of parts. Then the saving triggers the iLogic and I have to click on the button every time a part is saved. 

 

Is there a way to distinguish somehow in iLogic if the part is saved by the user or by an assembly?

Then i would include an "if statement"  before I prompt the user.

 

Here is the basic code:

'Reminder to edit the iProperties
Dim buttonValue As Integer
buttonValue = MessageBox.Show("Don't forget to fill out the iProperties! Would you like to do it now?", "Reminder" ,MessageBoxButtons.YesNo)
	' yes is 6, no is 7

If buttonValue = 6 Then
	Call OpeniProperties
End If

 

Thanks for your help in advance!

Tags (3)
Labels (3)
2 REPLIES 2
Message 2 of 3

you could try this before the code you already have.

 

Dim activeDocName As String = ThisApplication.ActiveDocument.FullFileName
Dim thisDocName As string = ThisDoc.Document.FullFileName

If (activeDocName <> thisDocName) Then
    ' the script was not trigerd by the active document
    Return
End If

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3

Thank you very much for the quick reply, it was a super idea!

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report