Hi @berry.lejeune. Here is an example iLogic rule which uses the 'Pick' method I mentioned. So, after you run the rule, it will prompt you to select an existing Balloon with your mouse, then proceed with the rest of the code. The Inventor API process for attaching an extra balloon to an existing balloon requires us to specify either an Inventor.DrawingBOMRow type object, or an Inventor.ComponentOccurrence type object as the input for specify which balloon to add. The extra Balloon is added to an existing Balloon using the Balloon.BalloonValueSets.Add() method. Since I am still not sure how you want to specify which Balloon to add, I decided to use a Dictionary type collection variable. Those can store a list of pairs of data, with each pair having a Key, and a Value (similar to a NameValueMap). I choose to get the parent DrawingBOM object from the existing Balloon that you select, then loop through its rows, adding the referenced Document.DisplayName (or maybe the ItemNumber) as the Key of each pair, and either the DrawingBOMRow or the ComponentOccurrence as the Value of each pair. Then it should present you with a list of those DisplayNames, allowing you to choose one. Then it gets the associated DrawingBOMRow or ComponentOccurrence object, and uses that in the BalloonValueSets.Add method. I left a lot of lines in there and commented out, so you can play around with which combination may work best for you.
Dim oBalloon As Inventor.Balloon = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingBalloonFilter, "Select a Balloon.")
If oBalloon Is Nothing Then Exit Sub
Dim oDBOM As DrawingBOM = oBalloon.BalloonValueSets.Item(1).ReferencedRow.Parent
Dim oDict As New Dictionary(Of String, Inventor.DrawingBOMRow)
'Dim oDict As New Dictionary(Of String, Inventor.ComponentOccurrence)
For Each oRow As DrawingBOMRow In oDBOM.DrawingBOMRows
Dim oRowDoc As Inventor.Document = Nothing
'Dim sItemNum As String = ""
'Dim oRowOcc1 As ComponentOccurrence = Nothing
Try : oRowDoc = oRow.BOMRow.ComponentDefinitions.Item(1).Document : Catch : End Try
'Try : oRowOcc1 = oRow.BOMRow.ComponentOccurrences.Item(1) : Catch : End Try
'Try : sItemNum = oRow.BOMRow.ItemNumber : Catch : End Try
If oRowDoc Is Nothing Then Continue For
oDict.Add(oRowDoc.DisplayName, oRow)
'oDict.Add(oRowDoc.DisplayName, oRowOcc1)
Next
Dim sChosen As String = InputListBox("Choose one.", oDict.Keys.ToArray, "", "Document DisplayNames")
If sChosen = "" Then Exit Sub
Dim oDBOMRow As DrawingBOMRow = oDict.Item(sChosen)
oBalloon.BalloonValueSets.Add(oDBOMRow)
'Dim oOcc As ComponentOccurrence = oDict.Item(sChosen)
'oBalloon.BalloonValueSets.Add(oOcc)
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)