Message 1 of 4
How to stack balloons by VB

Not applicable
06-19-2020
05:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
With the "acmDevGuide.chm", I can already create balloons through VB, but they are all isolated,like the 1 and 2 as shown in the figure。How to achieve the effect of 3 and 4, by McadBalloon.AddLeader or McadBalloon.AttachGeometry ?
But I don't know how to set these parameters
pic1
Sub AttachGeometry(Geometry As IDispatch, ArrowheadLocation As VARIANT, ViewId As [in, optional] VARIANT, Index As [in, optional] VARIANT, LeafNode As [in, optional] VARIANT)
Parts Lists and Balloons Sample Code
Dim oSymBB As McadSymbolBBMgr
Dim oPartRef As McadPartReference
On Error Resume Next
Set oSymBB = ThisDrawing.Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr")
Set oPartRef = ThisDrawing.ModelSpace.AddCustomObject("AcmPartRef")
Dim pt(0 To 2) As Double
pt(0) = 0: pt(1) = 0: pt(2) = 0
oPartRef.Origin = pt
Dim partData(0 To 3, 0 To 1) As String
partData(0, 0) = "NAME"
partData(0, 1) = "Some Part"
partData(1, 0) = "MATERIAL"
partData(1, 1) = "Steel"
partData(2, 0) = "NOTE"
partData(2, 1) = "A test"
partData(3, 0) = "VENDOR"
partData(3, 1) = "ACME"
Dim oBOMMgr As McadBOMMgr
Set oBOMMgr = oSymBB.BOMMgr
Call oBOMMgr.SetPartData(oPartRef, partData)
Dim oBOM As McadBOM
If oBOMMgr.BOMTableExists("testBOM") Then
Set oBOM = oBOMMgr.GetBOMTable(ThisDrawing.ModelSpace, "testBOM")
Else
Set oBOM = oBOMMgr.AddBOMTable("testBOM", ThisDrawing.ModelSpace)
End If
Dim oItem As McadBOMItem
Set oItem = oBOM.AddItem(oPartRef.ObjectID, oBOM.Items.Count + 1)
Dim oBalloon As McadBalloon
Set oBalloon = ThisDrawing.ModelSpace.AddCustomObject("AcmBalloon")
Dim points(0 To 5) As Double
points(0) = 0: points(1) = 0: points(2) = 0
points(3) = 2: points(4) = 1: points(5) = 0
oBalloon.AppendBOMItem oItem
oBalloon.BalloonType = sbCircularBalloon
oBalloon.Origin = pt
oBalloon.AddLeader points
oBalloon.[Scale] = 1
Dim plist As McadPartList
Set plist = ThisDrawing.ModelSpace.AddCustomObject("AcmPartList")
plist.BOM = oBOM
pt(0) = -1#
pt(1) = 0#
plist.Origin = pt
ThisDrawing.Application.Update
ZoomExtents