finding balloons attached to other balloons via API

finding balloons attached to other balloons via API

w.klausner
Explorer Explorer
856 Views
3 Replies
Message 1 of 4

finding balloons attached to other balloons via API

w.klausner
Explorer
Explorer

The following code allows me to enumerate all balloons on a specific drawing sheet:

Sub enumBalloons()
  Dim oDoc As DrawingDocument
  Set oDoc = ThisApplication.ActiveDocument

  Dim oSheet As Sheet
  Set oSheet = oDoc.ActiveSheet

  Dim oBalloon As Balloon
  For Each oBalloon in oSheet.Balloons
    debug.print oBalloon.BalloonValueSets.Item(1).ItemNumber
  Next
End Sub

But it ignores those balloons attached to other balloons as for example this type of balloons:

balloons attached to other balloons: how to access them?balloons attached to other balloons: how to access them?

Does anybody know how to access this specific type of balloons via API?

0 Likes
Accepted solutions (2)
857 Views
3 Replies
Replies (3)
Message 2 of 4

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @w.klausner 

Two attached balloons counts as one Balloon. This balloon however has two BalloonValueSets representing each "balloon bubble". Try this code 🙂

Sub enumBalloons()
  Dim oDoc As DrawingDocument
  Set oDoc = ThisApplication.ActiveDocument

  Dim oSheet As Sheet
  Set oSheet = oDoc.ActiveSheet

  Dim oBalloon As Balloon
  Dim oBVS As BalloonValueSet
  For Each oBalloon In oSheet.Balloons
  For Each oBVS In oBalloon.BalloonValueSets
    Debug.Print oBVS.ItemNumber
    Next
  Next
End Sub

 

Message 3 of 4

w.klausner
Explorer
Explorer

thank you so much!
It worked out perfectly and helped me in my task!!

Message 4 of 4

freesbee
Collaborator
Collaborator
Accepted solution

...this clearly answers also my original question that was posted here (Wolfy was very diligent in posting the question explicitly)!

Thanks a lot!!

Massimo Frison
CAD R&D // PDM Admin · Hekuma GmbH