Reattach balloon through ilogic

Reattach balloon through ilogic

parth_moradiya
Contributor Contributor
658 Views
12 Replies
Message 1 of 13

Reattach balloon through ilogic

parth_moradiya
Contributor
Contributor

Hi All,

 

I created a model configurator through ilogic. In drawing, I have already given the the balloon to a component. but when I change the model and that original; component suppressed and other component unsuppressed. but in drawing balloon also keep getting disappeared as component change. so, how do I reattach the balloon with ilogic when component change.

0 Likes
Accepted solutions (2)
659 Views
12 Replies
Replies (12)
Message 2 of 13

Curtis_Waguespack
Consultant
Consultant

@parth_moradiya, there are 3 functions to help with this, they can be found in the snippets as shown.

 

Curtis_Waguespack_0-1738252010037.png

 

reference link:

Inventor 2025 Help | Drawing Functions Reference (iLogic) | Autodesk

Balloon functions

Balloon functions for drawings are tied to a particular view.

Balloons.Reattach

For views of assembly documents, this function checks for unattached balloons in the view and attaches them to a component, if possible. The first choice is a component at the arrowhead location. If none is found, the closest eligible component without a balloon is used. If the balloon cannot be attached at this time, it is moved to a hidden layer. The hidden layer is a layer created (if necessary) for this purpose.

 

Note: This function requires that the Preserve Orphaned Annotations option is set for the drawing (under Tools >Options  > Document Settings).
If this option is not set, the function sets it automatically.

Balloons.AttachToComponent(“componentName”)

Specifies a component that requires a balloon. The componentName specifies a component occurrence, such as "Pin:1". When you use this function, balloons are only reattached to the components that you specify. If you do not use this function, balloons are reattached to any available component (unless disqualified by the DoNotAttachToComponent function).

Balloons.DoNotAttachToComponent(“componentName”)

Specifies a component that does not require a balloon. The componentName specifies a component occurrence, such as "Pin:1".

 

 

 

 

EESignature

0 Likes
Message 3 of 13

parth_moradiya
Contributor
Contributor

Hi Curis,

 

I have used that snippets but it is not doing anything while running the rule. It is not attaching any balloons. Is there any thing that I need to keep in mind? 

If possible, can you show me little use like how that three of snippets will be used with short example?

Thanks.

0 Likes
Message 4 of 13

Curtis_Waguespack
Consultant
Consultant

@parth_moradiya, be certain that the rule is referencing the correct view. That is a common issue I run into, where I forget the change the View name in the code, and it runs on View1 but the balloons are on another view.

 

But generally this will work

 

Curtis_Waguespack_0-1738256331590.png Curtis_Waguespack_1-1738256355185.png

 

ActiveSheet.View("VIEW5").Balloons.Reattach

 

 

Curtis_Waguespack_2-1738256396285.png

 

After running that function, are you seeing the balloon remain magenta colored, or does it just disappear?

 

 

 

EESignature

0 Likes
Message 5 of 13

parth_moradiya
Contributor
Contributor

Hi Curtis,

 

Like You showed in pictures, when you changed wheel your balloon staying in magenta colour but in my case balloon is just disappearing while component change.

 

I want to make it reappear somehow. In part list item number is same but balloon is being completely disappear.

 

Thanks.

0 Likes
Message 6 of 13

Curtis_Waguespack
Consultant
Consultant
Accepted solution

@parth_moradiya 

 

Ensure the Preserve Orphaned Annotations option is on: Tools > Options  > Document Settings

 

Curtis_Waguespack_0-1738261372919.png

 

Once that is turned on do you now see the balloon stay visible and colored magenta when changing the model?

 

If so does running this (with the correct view name) reattach it?

ActiveSheet.View("VIEW5").Balloons.Reattach

 

If not, check the layers for a layer called something like "X iLogicHidden Symbol". This layer is created and turned off when a balloon can not be reattached.

 

Curtis_Waguespack_0-1738262089766.png

 

 

EESignature

0 Likes
Message 7 of 13

parth_moradiya
Contributor
Contributor

Hi Curtis

 

it is working now 

 

thank you very much.

Message 8 of 13

parth_moradiya
Contributor
Contributor

Hi Curtis,

 

Some time balloon is reattaching to nearby components resulting in different number.

 

What if we uncheck  Preserve Orphaned Annotations option which will result in disappearing of balloon and then again include balloon with specific component with below snippet.

 

ActiveSheet.View("VIEW1").Balloons.AttachToComponent("Pin:1")

 

But the problem is when I use this snippet with component name for example 000842:1, it is not including balloon for that component in drawing.

 

Is this the right method to use above snippet or I need to use it any other way.

 

Thanks.

 

 

0 Likes
Message 9 of 13

Curtis_Waguespack
Consultant
Consultant

 


@parth_moradiya wrote:

But the problem is when I use this snippet with component name for example 000842:1, it is not including balloon for that component in drawing.


@parth_moradiya, is the balloon for 000842:1 ending up on the layer described in my last post? If that is the case then that is the indicating that it can not find suitable geometry to attach to.

 

Having said that, and explored your current approach, let me say that I have moved away from using these iLogic functions, and have just started to use and recommend the Balloons.Add function. I find this to be a more reliable approach overall.

 

See the attached 2022 file set to explore this.

 

Hope this helps,
Curtis

 

Curtis_Waguespack_2-1738348275859.png

 

 

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim VIEW1 = Sheet_1.DrawingViews.ItemByName("VIEW1")
Dim Pt1 = VIEW1.SheetPoint(1.4, 0.4)
Dim Face = VIEW1.GetIntent("BBBB", "Face1", intent := PointIntentEnum.kMidPointIntent , nearPoint := Pt1)

Dim balloon1 = Sheet_1.Balloons.Add("ComponentA:1 balloon", {Pt1}, Face)

 

 

open the assembly and run the rule, then go to the drawing and run the rule to see it update the balloon

 

Curtis_Waguespack_0-1738348193543.pngCurtis_Waguespack_1-1738348231920.png

 

 

EESignature

0 Likes
Message 10 of 13

parth_moradiya
Contributor
Contributor

Hi Curtis,

 

Thank you for your guidance. I will use this approach. 

 

Thanks.

Message 11 of 13

parth_moradiya
Contributor
Contributor

Hi Curtis,

 

This code working fine with part and entity in it.

 

But what if it is sub assembly and there is a part in it and named entity in it. (main assembly, subassembly, part, entity)

 

Dim Face = VIEW1.GetIntent("Assembly1:1:Part1:1", "Face0", intent := PointIntentEnum.kMidPointIntent , nearPoint := Pt1

 

I am using this code line but it says component not found. 

 

Is this the right way or any otherway?

 

Thanks.

0 Likes
Message 12 of 13

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi @parth_moradiya 

 

Good question. You can extract the syntax needed from your drawing by right clicking on the drawing curve as shown and choosing iLogic > Capture Current State

 

 

Curtis_Waguespack_1-1738674960695.png

 

This will result in a Code Clipboard with the code needed to get that geometry intent object from the nested component

 

You can then click the OK button and go to the rule and right click in the rule and choose Paste. The important bit is that use of the curly brackets to indicated a string array is being passed in, that includes that MakePath down to the part using commas as separators, as shown.

 

Dim Face = VIEW1.GetIntent({"Sub1:1", "BBBB"}, "Face1", intent := PointIntentEnum.kMidPointIntent , nearPoint := Pt1)

 

Curtis_Waguespack_2-1738675073448.png

 

 

Running the rule will give you different results based on the sub assemblies BOM structure. If the sub's BOM structure is Normal the balloon will reference the sub assembly, if the sub is Reference, the balloon will reference the part.

 

Curtis_Waguespack_0-1738674902752.png

 

Hope that helps,

Curtis

 

EESignature

0 Likes
Message 13 of 13

parth_moradiya
Contributor
Contributor

Hi Curtis,

 

Thank you. It is working now.