- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear All,
I have successfully (with much help from this forum) created a Ilogic code that puts 3 balloons on my drawing (first picture) however, I want to attach all three balloons to one leader (second picture). I am using named geometry to define the start points of the balloons leaders.
I have found the following code string in the Inventor API help: BalloonValueSets.Add( Component As Object ) As BalloonValueSet . But I cannot get it to work in my code. Any help is appreciated, thank you in advance! Below is my original code.
Kind regards,
Niek
Dim oDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet = oDoc.ActiveSheet
Dim oTO As TransientObjects = ThisApplication.TransientObjects
Dim oBalloons As Balloons = oSheet.Balloons
Dim oBalloon As Balloon
Dim oView As DrawingView = ActiveSheet.View("ISO").View
Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Ondersteuning:1")
Dim view_ISO = Sheet_1.DrawingViews.ItemByName("ISO")
'Definition of number of values in array
Dim numImportIntents As Integer = 2 ' Aantal named geometries te importeren uit assembly, begint bij 0. één extra oInten(x) betekend numImportIntents +1
'Creation of different arrays
Dim oTG(numImportIntents) As TransientGeometry
Dim oLeaderPoints(numImportIntents) As ObjectCollection
Dim oIntent(numImportIntents) As Inventor.GeometryIntent
'Refrencing of named geometry in each compontent.
oIntent(0) = view_ISO.GetIntent("Staander links", "Balloon", PointIntentEnum.kMidPointIntent)
oIntent(1) = view_ISO.GetIntent("Bovenligger", "Balloon", PointIntentEnum.kMidPointIntent)
oIntent(2) = view_ISO.GetIntent("Eindkap links", "Balloon", PointIntentEnum.kMidPointIntent)
For i = LBound(oTG) To UBound(oTG)
oTG(i) = ThisApplication.TransientGeometry
Next
For i = LBound(oLeaderPoints) To UBound(oLeaderPoints)
oLeaderPoints(i) = ThisApplication.TransientObjects.CreateObjectCollection
Next
'Definition of location of balloon 1
oLeaderPoints(0).Add(oTG(0).CreatePoint2d(oView.Left - 2, oView.Top + 1.5))
oLeaderPoints(0).Add(oIntent(0))
'Creation of balloon
oBalloon = oBalloons.Add(oLeaderPoints(0))
'2nd balloon
oLeaderPoints(1).Add(oTG(1).CreatePoint2d(oView.Left -2 , oView.Top ))
oLeaderPoints(1).Add(oIntent(1))
oBalloon = oBalloons.Add(oLeaderPoints(1))
'3rd ballon
oLeaderPoints(2).Add(oTG(2).CreatePoint2d(oView.Left -2 , oView.Top - 1.5))
oLeaderPoints(2).Add(oIntent(2))
oBalloon = oBalloons.Add(oLeaderPoints(2))
Solved! Go to Solution.