Can't display more than one BalloonTip (consequently)

Can't display more than one BalloonTip (consequently)

Maxim-CADman77
Advisor Advisor
154 Views
5 Replies
Message 1 of 6

Can't display more than one BalloonTip (consequently)

Maxim-CADman77
Advisor
Advisor

I want to get a clear understanding of possibilities and limitations of BalloonTip object.
I've found minimal working sample of BalloonTip-related code here, but for some reason Inventor ignores my attempt to consequently show two BalloonTips (it just shows the first one).

My iLogic-code is:

Option Explicit On

Dim invApp As Inventor.Application = ThisApplication
Dim uiMgr As UserInterfaceManager = invApp.UserInterfaceManager
Dim blnTips As BalloonTips= uiMgr.BalloonTips

Dim myBlnIntName, myBlnTitle As String
myBlnIntName = Now.ToString("ss")
myBlnTitle = myBlnIntName

Dim myBlnTip As BalloonTip
Try
	myBlnTip = blnTips(myBlnIntName)
Catch
	myBlnTip = blnTips.Add(myBlnIntName, myBlnTitle, "1-True")
End Try
myBlnTip.Display()
myBlnTip.Delete

' Threading.Thread.Sleep(9999)

myBlnTip = blnTips.Add(myBlnIntName, myBlnTitle, "2-False")
myBlnTip.Display()
myBlnTip.Delete

Dear @MjDeck  could you, please clarify what I'm missing?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Accepted solutions (1)
155 Views
5 Replies
Replies (5)
Message 2 of 6

MjDeck
Autodesk
Autodesk

Hi Maxim - can you try with a different InternalName for the second balloon? The documentation says that the internal name must be unique. (However, you have deleted the first one before creating the second one.)


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 3 of 6

Maxim-CADman77
Advisor
Advisor

This does not help (in fact I've tried this before posing to forum).


I've tried to replace line 22 with two lines:

 

 

myBlnTip = blnTips.Add(myBlnIntName & 1, myBlnTitle, "2-False")
logger.Info("myBlnTip.InternalName-2: " & myBlnTip.InternalName)

 

 

Logger reports the InternalName change (three digits insead of two for first) but my Inventor still not shows the second BalloonTip instance.

Moreover if I uncomment line 20 I get the delay BEFORE the first BalloonTip which is not what I would expect.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 4 of 6

MjDeck
Autodesk
Autodesk
Accepted solution

Here is a sample based on your rule. This worked for me.


Mike Deck
Software Developer
Autodesk, Inc.

Message 5 of 6

Maxim-CADman77
Advisor
Advisor

Thank you so much - your sample works (even so I don't understand why the cycle with 20 iterations of 50millisecond delay is needed).
Hope you could answer one more related question:

Can the same BalloonTip be consequently displayed with different messages?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 6 of 6

MjDeck
Autodesk
Autodesk

The cycle calls DoEvents to give Inventor a chance to show the balloon tip and respond to events. It's there so that you can see the first tip for a while before it gets deleted.
Yes, I think you can show the same tip with different messages. The BalloonTip.Message property is read/write.


Mike Deck
Software Developer
Autodesk, Inc.