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: 

Inventor VB.Net "Addin" modification help?

1 REPLY 1
Reply
Message 1 of 2
isocam
308 Views, 1 Reply

Inventor VB.Net "Addin" modification help?

Can anybody help?

 

I vave the following code used in a VB.Net "Addin".

 

Private Sub m_applicationEvents_OnSaveDocument(ByVal DocumentObject As Inventor._Document, ByVal BeforeOrAfter As Inventor.EventTimingEnum, ByVal Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles m_applicationEvents.OnSaveDocument

 

 

REM EXIT THE SUB HERE IF THE "NO" BUTTON IS PRESSED!!!!

 

If BeforeOrAfter = EventTimingEnum.kAfter Then

Try

Dim invVBAProject As InventorVBAProject = m_inventorApplication.VBAProjects.Item(1)

Dim invModule As InventorVBAComponent = invVBAProject.InventorVBAComponents.Item("Module03")

Dim invSub As InventorVBAMember = invModule.InventorVBAMembers.Item("OnSave")

invSub.Execute()

Catch ex As Exception

End Try

End If

End Sub

 

I need to modify the above code so that if the "No" button is pressed (Please see the attached file) I exit the Sub Routine.

 

Does anybody know how to do this?

 

Many thanks in advance!!!!

 

Darren

1 REPLY 1
Message 2 of 2
rossano_praderi
in reply to: isocam

Hi Darren,

 

If DocumentObject.Dirty Then ....

 

The document become dirty (True) on every modification, after save this property is False.

 

I suggest to verify this property after the follow line of your code:

If BeforeOrAfter = EventTimingEnum.kAfter Then

 

 

Bregs

Rossano Praderi



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------

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

Post to forums  

Autodesk Design & Make Report