Analyze existing ballons

Analyze existing ballons

RichardErnstberger
Enthusiast Enthusiast
304 Views
3 Replies
Message 1 of 4

Analyze existing ballons

RichardErnstberger
Enthusiast
Enthusiast

Hi all,
I'm writing a routine to check all placed balloons in a drawing.

 

My first check criteria, the attached document for the balloon is fairly easy as there's a sample

in the API docs: "Find component referenced by balloon"
The sample gives the file name of the referenced document as well as a ComponentDefinition object.

 

The second criteria is what I'm currently struggling with:

I must find the assembly the referenced document belongs to.

 

My attempt was to use the ComponentDefinition and query its Occurrences() property.
Unfortunately this property returns nothing when the attached doc is a part,

for an assembly it returns the occurrences.

As we typically use "parts only" BOM structure I'm out of luck here.

 

I've looked up and down, tried to examine the GeometryIntent related to the balloon but didn't come any further.

 

I realize that this search may not be that easy, as the ballooned part may be present in a number of assemblys.
But as the balloons refer to a drawing view I assumed there's a chance to get the right assembly displayed in the drawing view.


So my question is:
is there a way to step upwards from the balloon and it's information about the referenced part (and it's ComponentDefinition) to the related assembly?

 

Many thanks in advance for any useful information.
This will also include a statement like this kind of search is not possible.

 

Kind regards,
Richard

0 Likes
305 Views
3 Replies
Replies (3)
Message 2 of 4

Michael.Navara
Advisor
Advisor

You can get this information easily using this tool VBA Object Browser for Inventor.

 
 

2023-03-30_17-35-58.png

EDIT: Link updated

0 Likes
Message 3 of 4

RichardErnstberger
Enthusiast
Enthusiast

Hi Michael,

many thanks for your reply.

I was not aware of this tool but it looks interesting.

 

Unfortunately it was not helpful in my case.

 

Dealing with the Inventor API for 13 years i was aware of the object structure.

As stated in my post, i was just at the point you described bot got no occurrences listed, the object count was 0.

 

So i had to go a long way around this easy looking opportunity.

I must look through the drawing curves which i can list for each part displayed in the view the balloon belongs to.

Stepping through these curves i can compare against the drawing curve referenced in the geometry intent of the balloon.

This allows me to find the desired instance of my ballooned part.

The drawback is: the geometry comparison against the drawing curves has to deal with a lot of different geometry types, lines, arcs, circles, splines, polylines.

So far i have tested it the results are good but i expect a lot of situations where the comparison will fail because of different geometry types.

For the next time, i will try to work with my solution to see how many unhandled situations will appear.

 

Regards,

Richard

0 Likes
Message 4 of 4

jjstr8
Collaborator
Collaborator

@RichardErnstberger:  Maybe I'm misunderstanding what you're looking for, but doesn't DrawingDocument.Sheetx(x).Balloons(x).ParentView.ReferencedDocumentDescriptor give you what you want?  Or even DrawingDocument.Sheets(x).PartsLists(x).ReferencedDocumentDescriptor?

0 Likes