- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We've used Inventor professional here for a number of years and struggled with attaching qty text on all 4 quadrants of the balloon based on location of the leader. I've created a symbol with prompted text (displays as '#"X) but that doesn't help me attach it to the center of a balloon (can't be done) plus it's another step done after the balloons are placed.
Ultimately see the attached image to see what I want to be created when I attach a balloon. The qty beside the balloon is the qty for that particular area of interest, not the whole view nor the whole dwg.
Using Inventor Professional 2015
64-Bit Edition
Thanks for your help.
BR,
Michael Wardas
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Michael,
Can't you use the built in split balloon to do this?
see my screencast: http://autode.sk/2oN3tlR
Kudo's are also appreciated
Succes on your project, and have a nice day
Herm Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thanks for the response.
However I'm looking to specify a qty for a particular area of interest as opposed to the total BOM qty as per my previous attached example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Michael,
Please find the following VBA code to draw the text across 3'0 clock and 9'o clock. Similarly, the code can be extended for 9'o clock and 12'o clock.
On running this code, it will ask to select a balloon. After selection, 2 texts are generated and positioned at 3'o clock and 9'o clock.
Sub Main()
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
Dim oBalloon As Balloon
Set oBalloon = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingBalloonFilter, "Select a balloon")
Dim oStyle As BalloonStyle
For Each oStyle In oDrawDoc.StylesManager.BalloonStyles
If oStyle.Name = "Balloon Qty" Then
Set oStyle = oDrawDoc.StylesManager.BalloonStyles.Item("Balloon Qty")
End If
Next
If oStyle Is Nothing Then
Set oStyle = oDrawDoc.StylesManager.BalloonStyles.Item(1).Copy("Balloon Qty")
End If
oStyle.BalloonType = BalloonTypeEnum.kCircularWithOneEntryBalloonType
oStyle.Properties = "PartsListProperty='45575'"
oBalloon.Style = oStyle
Dim strQty As String
strQty = oBalloon.BalloonValueSets.Item(1).Value
strQty = strQty & "X"
oBalloon.Style = oDrawDoc.StylesManager.BalloonStyles.Item(1)
oBalloon.SetBalloonType (BalloonTypeEnum.kCircularWithOneEntryBalloonType)
Call oStyle.Delete
Dim txtPt3o As Point2d
Set txtPt3o = ThisApplication.TransientGeometry.CreatePoint2d(oBalloon.Position.X, oBalloon.Position.Y)
txtPt3o.X = txtPt3o.X + oBalloon.Style.BalloonDiameter / 2
txtPt3o.Y = txtPt3o.Y + oDrawDoc.StylesManager.TextStyles.Item(1).FontSize / 2
Dim oText3o As Inventor.GeneralNote
Set oText3o = oDrawDoc.Sheets.Item(1).DrawingNotes.GeneralNotes.AddFitted(txtPt3o, strQty)
Dim txtPt9o As Point2d
Set txtPt9o = ThisApplication.TransientGeometry.CreatePoint2d(oBalloon.Position.X, oBalloon.Position.Y)
txtPt9o.X = (txtPt9o.X - (oBalloon.Style.BalloonDiameter / 2)) - (oDrawDoc.StylesManager.TextStyles.Item(1).WidthScale * 0.6)
txtPt9o.Y = txtPt9o.Y + oDrawDoc.StylesManager.TextStyles.Item(1).FontSize / 2
Dim oText9o As Inventor.GeneralNote
Set oText9o = oDrawDoc.Sheets.Item(1).DrawingNotes.GeneralNotes.AddFitted(txtPt9o, strQty)
End Sub
Please feel free to contact if there is any doubt.
If solves your problem, click on "Accept as solution" / give a "Kudo"
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This works great!
I will try to add the 12 and 6 oclock positions.
Is there an easy way to be 'prompted' for the text when inserting so I don't have to go back and edit?
Many thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
One other thing is it easy to make the text follow the balloon like a symbol?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I just tried messing around to see if you could attach a leader to the balloon so then you could use a leader note that would follow it... but that failed.
So it looks like you would have to use assets or something to locate the balloon and catch the balloon location changes with an event and relocate the text notes in relation to the new geometry...
'This attached code is test I did with LeaderNotes that failed when trying to use it with balloons. Even in the API documentation, none of the objects listed for valid geometry intent include balloons...
Sub Main()
oDrawDoc = ThisApplication.ActiveDocument
'Dim oBalloon As Balloon
'oBalloon = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingBalloonFilter, "Select a balloon")
oBalloon = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select a balloon")
Call AddGenNoteWithLeader(oBalloon)
End Sub
Dim oDrawDoc As DrawingDocument
Sub AddGenNoteWithLeader(oBalloon As Object)
Dim ballPt3o As Point2d
ballPt3o = ThisApplication.TransientGeometry.CreatePoint2d(oBalloon.Position.X, oBalloon.Position.Y)
Dim txtPt3o As Point2d
txtPt3o = ThisApplication.TransientGeometry.CreatePoint2d(oBalloon.Position.X, oBalloon.Position.Y)
txtPt3o.X = ballPt3o.X + 5'+ oBalloon.Style.BalloonDiameter / 2
txtPt3o.Y = ballPt3o.Y + 4'+ oDrawDoc.StylesManager.TextStyles.Item(1).FontSize / 2
Dim oLeaderPoints As ObjectCollection
oLeaderPoints = ThisApplication.TransientObjects.CreateObjectCollection
'Where to place the text
oLeaderPoints.Add(txtPt3o)
'What to attach leader arrow to
Dim oGeometryIntent As GeometryIntent
'oGeometryIntent = ThisApplication.ActiveDocument.ActiveSheet.CreateGeometryIntent(oCurve)
'oGeometryIntent = oDrawDoc.ActiveSheet.CreateGeometryIntent(ballPt3o, ballPt3o)
oGeometryIntent = oDrawDoc.ActiveSheet.CreateGeometryIntent(oBalloon)
oLeaderPoints.Add(oGeometryIntent)
Dim oText3o As Inventor.LeaderNote
Try
oText3o = oDrawDoc.Sheets.Item(1).DrawingNotes.LeaderNotes.Add(oLeaderPoints, "Hey")
oText3o.LeaderVisible = False
Catch
MsgBox("You is has failed")
End Try
End Sub
--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization
iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread
Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects
Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help
Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Micheal,
One other thing is it easy to make the text follow the balloon like a symbol?
Please name the symbol with example image. Let you know the possibility.
Is there an easy way to be 'prompted' for the text when inserting so I don't have to go back and edit?
Yes, It can be achieved through a Windows application which contains textbox.
Required text can be entered in that textbox.
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network
