VB form auto refresh iproperties

VB form auto refresh iproperties

Anonymous
Not applicable
1,521 Views
4 Replies
Message 1 of 5

VB form auto refresh iproperties

Anonymous
Not applicable

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?

0 Likes
Accepted solutions (1)
1,522 Views
4 Replies
Replies (4)
Message 2 of 5

xiaodong_liang
Autodesk Support
Autodesk Support
Accepted solution

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. 

0 Likes
Message 3 of 5

Anonymous
Not applicable

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.

0 Likes
Message 4 of 5

Anonymous
Not applicable

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

0 Likes
Message 5 of 5

Anonymous
Not applicable

'  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

0 Likes