How to stack balloons by VB

How to stack balloons by VB

Anonymous
Not applicable
1,341 Views
3 Replies
Message 1 of 4

How to stack balloons by VB

Anonymous
Not applicable

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

 pic1pic1

 

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
0 Likes
1,342 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

I need help, please

0 Likes
Message 3 of 4

Anonymous
Not applicable

The existing balloon, appendBOMItem again.so easy...

 

0 Likes
Message 4 of 4

lena.talkhina
Alumni
Alumni

Welcome to the Autodesk Community @Anonymous !

 

Great to see you here on Visual Basic Customization forum.

Hope you will find a solution soon.

Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям! | Do you find the posts helpful? "LIKE" these posts!
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.



Лена Талхина/Lena Talkhina
Менеджер Сообщества - Русский/Community Manager - Russian

0 Likes