§Sub CreateBalloon()
§ ' get symbol
library object
§ Dim symMgr As
McadSymbolBBMgr
§ Set symMgr =
Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr")
§
§ ' get BOM
manager
§ Dim symBOMMgr As McadBOMMgr
§ Set symBOMMgr =
symMgr.BOMMgr
§
§ ' get the
BOM table in the drawing
§ Dim symBOM As McadBOM
§ Set symBOM =
symBOMMgr.GetBOMTable(ThisDrawing.ModelSpace, "")
§
§ ' add
Balloon to the last BOM item
§ Dim symBalloon As McadBalloon
§ Set symBalloon =
ThisDrawing.ModelSpace.AddCustomObject("AcmBalloon")
§
§ Dim origin(2) As Double
§ origin(0) =
10: origin(1) = 10
§
§ symBalloon.Move symBalloon.origin,
origin
§ symBalloon.BalloonType =
sbCircularBalloon
§
§ Dim leaderPoints(0
To 5) As Double
§ leaderPoints(0)
= 150: leaderPoints(1) = 125
§ leaderPoints(3) = 170: leaderPoints(4) =
140
§
§ symBalloon.AddLeader leaderPoints
§ symBalloon.AppendBOMItem
symBOM.Items(True)(0)
§
§ ' add a
Parts List
§ Dim symPartList As McadPartList
§ Set symPartList
= ThisDrawing.ModelSpace.AddCustomObject("AcmPartList")
§
§ symPartList.BOM = symBOM
§ symPartList.Title = "First"
§
§ Dim origin2(2) As
Double
§ origin2(0) =
280: origin2(1) = 20
§ symPartList.origin = origin2
§
§ ThisDrawing.Application.Update
§End
Sub