Using iLogic to look for missing balloons

Using iLogic to look for missing balloons

Anonymous
Not applicable
2,340 Views
11 Replies
Message 1 of 12

Using iLogic to look for missing balloons

Anonymous
Not applicable

I found this code by "inventor guru" which works perfect to list all missing ballons. But it doesn't work for iParts, as it lists ALL the missing balloons, not checking against active BOM (also shows the hidden members)

 

I would think its possible to modify it to check if QTY is more than 0, then list the items.

 

Anyone know how to achieve this?

 

 

Dim oDrawDoc As DrawingDocument = ThisDoc.Document
 Dim oSheet As Sheet = oDrawDoc.ActiveSheet
 Dim oPartsList As PartsList = oSheet.PartsLists.Item(1)
 Dim s As String
 Dim msg as String = ""

For Each oRow As PartsListRow In oPartsList.PartsListRows
 If Not oRow.Ballooned Then
 s = ""
For Each oCell As PartsListCell In oRow
 s = s & oCell.Value & " "
Next
 msg = msg & s & vbNewLine

End If
 Next

'show results
 MsgBox(msg)

 

0 Likes
Accepted solutions (2)
2,341 Views
11 Replies
Replies (11)
Message 2 of 12

waynehelley
Collaborator
Collaborator
Accepted solution

Try using this...

 

If Not oRow.Ballooned And oRow.Item(2).Value > 0 Then

 

You will just need to tweak it so that the numeric value within the brackets, matches the column number of the Qty column. 

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
0 Likes
Message 3 of 12

Anonymous
Not applicable

Oh, perfect. Thanks!

 

I have a lot of piping in my assembly, which reports qty as e.g. "100.00 mm". So I get an error saying "Conversion from string "100.000 mm" to type 'Double' is not valid."

 

Do you know a way to avoid this?

0 Likes
Message 4 of 12

bradeneuropeArthur
Mentor
Mentor

Hi,

 

I don't get any error message!

 

The values are represented in the message!

 

if your code is different then use:

 

.Tostring to represent the value.

or

.Cstr to represent the value.

 

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 12

Anonymous
Not applicable

This is because I have piping in the assembly. Instead of reporting QTY as 1 or 2, it reports the pipe length (in my example, 100mm) On "regular" assemblies I see that it works fine.

0 Likes
Message 6 of 12

bradeneuropeArthur
Mentor
Mentor

I don't get a error for these components with ie 100mm Qty.

 

please post  a screen shot

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 7 of 12

Anonymous
Not applicable

Oh, that was strange. It works if I manually remove "mm", but as long as I have text, if wont check if the value is large than 0...

0 Likes
Message 8 of 12

bradeneuropeArthur
Mentor
Mentor
Accepted solution

Hi,

 

I see the error too.

 

Do this to solve it:

 

If Not oRow.Ballooned And oRow.Item(2).Value > "0" Then

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 9 of 12

Anonymous
Not applicable

Perfect, thanks a lot!

0 Likes
Message 10 of 12

freesbee
Collaborator
Collaborator

...my task is similar but a little bit different, and currently I am in trouble in enumerating balloons attached to other balloons.

For example in the situation under here 407 and 408 are definitely referring to the correct PartlistROW, but they are ignored by the ActiveSheet.Balloons collection, and I am not able to identify the right way to catch them.

Any idea?

4TheForum.png

Massimo Frison
CAD R&D // PDM Admin · Hekuma GmbH
0 Likes
Message 11 of 12

dg8MW9N
Contributor
Contributor

@freesbee 

You may be able to apply the last iLogic code in the following post to help:

Solved: Inventor 2022 Parts List Balloon Indicating Icons - Autodesk Community - Inventor

 

Thanks to @Curtis_Waguespack 

 

0 Likes
Message 12 of 12

pl.sivakumar
Advocate
Advocate

Thanks for your code of Missing balloon,

 

I  made a small correction on that, If not found ( No missing balloon)Message box will not sow,

 

If msg = ""

Else

 MsgBox(msg)

End If

Dim oDrawDoc As DrawingDocument = ThisDoc.Document
 Dim oSheet As Sheet = oDrawDoc.ActiveSheet
 Dim oPartsList As PartsList = oSheet.PartsLists.Item(1)
 Dim s As String
 Dim msg As String = ""

For Each oRow As PartsListRow In oPartsList.PartsListRows
 If Not oRow.Ballooned Then
 s = ""
For Each oCell As PartsListCell In oRow
 s = s & oCell.Value & " "
Next
 msg = msg & s & vbNewLine

End If
 Next
If msg = ""
	Else
'show results
 MsgBox(msg)
End If

 

0 Likes