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: 

VB form auto refresh iproperties

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
gary.belisle
1333 Views, 4 Replies

VB form auto refresh iproperties

I'm creating a VB.exe (Visual Basic 2010 Express) tool that displays iProperties for Inventor using a running session of Inventor. How do I automatically refresh the display on the form when you switch the active inventor document tab within Inventor?

---------------------------------------------------------------------
i7-4800MQ Dell Precision M6800, Win 7 Enterprise 64-bit, 16GB RAM
Autodesk Product Design Suite Ultimate 2015
Autodesk Vault Professional 2015
PLM 360
4 REPLIES 4
Message 2 of 5

Hi,

 

you could delegate the event ApplicationEvents.OnActivateDocument.   in this event, when BeforeOrAfter =kAfter , get the current activate document, get its iProperties and update your dialog accordingly. 

Message 3 of 5

I received the same solution from Dan Vang. Thanks to you both. I was able to get this to work. When I change the document in Inventor the form refreshes nicely.

---------------------------------------------------------------------
i7-4800MQ Dell Precision M6800, Win 7 Enterprise 64-bit, 16GB RAM
Autodesk Product Design Suite Ultimate 2015
Autodesk Vault Professional 2015
PLM 360
Message 4 of 5
bastiaanm
in reply to: gary.belisle

Hello Gary.Belisle,

I try also uptodate Iproperties in Inventor. Can you help me with some code? (Visual Basic 2010 Express)

I am surprised that it is not standard that iProperties being shown live within Inventor.

Thanks, Bastiaan Maalman

Message 5 of 5
gary.belisle
in reply to: bastiaanm

'  Add these two declatations

Dim _invApp As Inventor.Application

Public appEvents As Inventor.ApplicationEvents

 

'  Add this subroutine

Public Sub appEvents_OnActivateDocument(ByVal docObject As Inventor.Document, _

                                                                        ByVal b_or_a As Inventor.EventTimingEnum, _

                                                                        ByVal context As Inventor.NameValueMap, _

                                                                        ByRef handlingCode As Inventor.HandlingCodeEnum)

   If b_or_a = Inventor.EventTimingEnum.kAfter Then

       '  Add your cade to this subroutine. for example below, iproperties are refreshed by performing

       '  a button click after an inventor document is activated.

       MsgBox("Document activated!")

       Me.Invoke(New Action(AddressOf Button_RefreshProperties.Performclick))

   End If

End Sub

 

Public Sub YourMainSub()

   ' Add these to your main sub routine.

   appEvents = _invApp.ApplicationEvents

   AddHandler appEvents.OnActivateDocument, AddressOf Me.appEvents_OnActivateDocument

End Sub

---------------------------------------------------------------------
i7-4800MQ Dell Precision M6800, Win 7 Enterprise 64-bit, 16GB RAM
Autodesk Product Design Suite Ultimate 2015
Autodesk Vault Professional 2015
PLM 360

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

Post to forums  

Autodesk Design & Make Report