Adding a balloon to a component within a sub assembly

Adding a balloon to a component within a sub assembly

leebrg
Contributor Contributor
253 Views
2 Replies
Message 1 of 3

Adding a balloon to a component within a sub assembly

leebrg
Contributor
Contributor

Hello,

As the title says, I want to add a balloon to a part within a sub assembly.
I wrote the code below using the fragment code, but I get an error saying that the plate is a part within a sub assembly and cannot be found.

Does anyone know how to solve it?

 

Thank you in advance.

 

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim VIEW1 = Sheet_1.DrawingViews.ItemByName("VIEW1")
Dim ptCyl = view1.SheetPoint(0, 0)
Dim balloon1 = Sheet_1.Balloons.Add("Plate:1 balloon", {ptCyl}, PointIntentEnum.kMidPointIntent)

 

0 Likes
254 Views
2 Replies
Replies (2)
Message 2 of 3

m_baczewski
Advocate
Advocate

Hi,

When adding a part number, you need an edge to attach the balloon to, and that's missing in your case. It should look something like this:

 

Krawedz2 = WIDOK1.GetIntent("BP2_BLACHA_1", "Krawedz1",PointIntentEnum.kMidPointIntent) // intent
punktWstawienia = WIDOK1.SheetPoint(1, 0) 
balloon1 = oSheet.Balloons.Add("Front: 1 balloon", {punktWstawienia}, Krawedz2)
aSheet.Balloons.Item(1).Position = ThisServer.TransientGeometry.CreatePoint2d(Krawedz2.PointOnSheet.X-3.5, Krawedz2.PointOnSheet.Y)

 

m_baczewski_0-1739196114836.png

 

0 Likes
Message 3 of 3

leebrg
Contributor
Contributor

Thanks for your reply.


I attached the code incorrectly.
I checked the code you modified, and the problem is that the error occurs in Krawedz2.
I can't get getintent.
It seems that the drawing element of the part is not read because it is a part within a sub-assembly.
Do you know a solution for this?

0 Likes