snipped code balloon issue

snipped code balloon issue

gokulraj2662000
Community Visitor Community Visitor
210 Views
2 Replies
Message 1 of 3

snipped code balloon issue

gokulraj2662000
Community Visitor
Community Visitor
while using the below code error is showing 
please find error in the code

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim VIEW1 = Sheet_1.DrawingViews.ItemByName("VIEW1")
Dim ptCyl = VIEW1.SheetPoint(-0.3, -0.4)
Dim balloon3 = Sheet_1.Balloons.Add("Assembly8",
{ptCyl}, VIEW1.GetIntent("Part5:1", "balloon"))


gokulraj2662000_0-1727416945185.png

gokulraj2662000_2-1727417159543.png

please help how to use the balloon snipped code

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

James_Willo
Alumni
Alumni

"assembly8" doesn't have an occurrence number? 

Snippet says componentA:1 which suggests it needs a number. 

 

 



James W
Inventor UX Designer
0 Likes
Message 3 of 3

WCrihfield
Mentor
Mentor

Hi @gokulraj2662000.  Below are a couple links to the online help documentation for a couple of the methods you are using in that one line of code, just for reference, and further reading.

IManagedBalloons.Add Method 

IManagedDrawingView.GetIntent Method (ComponentArgument, String, PointIntentEnum, CurveChoiceSpec) 

The first method (Function) being used in Line 11 is the IManagedBalloons.Add method.

The first 'input' that method is asking for is the 'name' you want to assign to the new balloon you are about to add.  I do not think what you specify as this name is important.  However, I am not sure if it allows you to specify the same name for multiple balloons or not.  The documentation is not clear about that little detail.

The second thing it is asking for is an IEnumerable(Of DocumentUnitsPoint2d) for specifying the points of the leader.

The third thing it is asking for is a GeometryIntent, which is what ties things like dimensions or leaders to geometry in views, among other uses.

 

To specify the required GeometryIntent input, you are using the other method named IManagedDrawingView.GetIntent.  That method asks for 2 required inputs, and also has 2 additional inputs that are optional, but are sometimes needed, in more complex situations.

The first thing that method asks for as input, is a ComponentArgument.  This can just be one of 3 different types of things:

  • A String - the exact name of the assembly component, as it appears in the model browser tree
  • An array of Strings - used when the component being specified is not a top level component, where the array of Strings contains the exact names of the component representing the top level sub-assembly component, then the name of the component below that, and so on, including the name of the component you are interested in as the last String in the array.
  • Or a ManagedComponentOccurrence object.

In your case, you are attempting to use the first option...the direct name of the component occurrence ("Part5:1") as the first input for this method.  That will only work if that component is in the top level of the assembly directly.  Then the second input that method is asking for is the 'entity name'.  You are specifying "balloon" there.  If there is not an entity within that part you are specifying, that is named "balloon", then it will not be able to find it, and will likely throw an error.  Have you assigned the "balloon" name to an entity (face, edge, vertex) within that specified part yet?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes