Attach balloon from list

Attach balloon from list

Mario-Villada
Advocate Advocate
846 Views
4 Replies
Message 1 of 5

Attach balloon from list

Mario-Villada
Advocate
Advocate

Using the GUI, when selecting a balloon and right click with the mouse, a context menu appears with the option "Attach balloon from list" . I wonder if there is a way of repeat this behavior with API calls. Any ideas?

 

At the end of the day what I want is to have several balloons next to each other in a row, only the first one will be attached to some geometry in a drawing view.

 

Thanks in advance.

 

Mario.

847 Views
4 Replies
Replies (4)
Message 2 of 5

Mario-Villada
Advocate
Advocate

The following code (Delphi) attempts to attach a virtual balloon next to an already created balloon, but i am getting an 'unspecified error'

Inv:= GetInventorApplication;
TG := Inv.TransientGeometry;
oDwg := Inv.ActiveDocument as DrawingDocument;
oDV := oDwg.ActiveSheet.DrawingViews.Item[1];
oSheet := oDwg.ActiveSheet;

oBlln := oDwg.SelectSet.Item[1] as Balloon;
oPartsList := oDwg.ActiveSheet.PartsLists.Item[1];
oAssemblydoc := oPartsList.ReferencedFile.ReferencedDocument as assemblyDocument;
oBomRow := oAssemblydoc.ComponentDefinition.BOM.BOMViews.Item['Parts Only'].BOMRows.Item[3];
oLeaderPoints := Inv.TransientObjects.CreateObjectCollection(emptyparam);
oGintent := oSheet.CreateGeometryIntent(oBlln,KCircularLeftPointIntent);//HERE MIGHT BE THE ERROR
oLeaderPoints.Add(oGintent);
oSheet.Balloons.Add(oLeaderpoints,oBomRow,emptyparam,emptyparam,emptyparam,emptyparam) ;//ERROR HERE

any ideas?

thanks.

0 Likes
Message 3 of 5

Mario-Villada
Advocate
Advocate

I realized that my previous code works if the BomRow corresponds to a virtual component, but my goal is to attach a balloon that corresponds to an actual component.

 

As a different approach for solving this problem I tried to use the Control definitions object, I was able to fire up the dialog box that asks me to tick the items in the part list I want to attach, and I  am stucked here. so my question is ; Is there any way to pass the item numbers in the parts list as parametres for this command and bypass the dialog box?.

 

This is the code:

 

oControlDefs := Inv.CommandManager.ControlDefinitions;
oControlDef := oControlDefs.Item['DLxBalloonSymAttachCustomCmd'];
oControlDef.Execute;

 

Waht is the difference between Virtual and Custom component? 

 

Anyone?

0 Likes
Message 4 of 5

Josh_Hudson97
Advocate
Advocate

@Mario-Villada Did you ever figure this one out? I'm wanting to so the same thing. I'm fairly new to iLogic, but been trying to do this and can't find anything online for it

If I've helped you out drop the post a like, if I've given you a solution mark as solved. It's us, 'The community' that makes this place work 😄
0 Likes
Message 5 of 5

Mario-Villada
Advocate
Advocate

Unfortunately no, I only got to attach a balloon to a part shown in a view but i could not attached another balloon to it.

this was done years ago!, thanks for bringing back good memories.

 

Good luck.

 

Mario.

0 Likes