Inventor Drawing BOM or Parts List To Show Only What Is Ballooned On Each Sheet

Inventor Drawing BOM or Parts List To Show Only What Is Ballooned On Each Sheet

tschaeferZNBXX
Advisor Advisor
5,004 Views
28 Replies
Message 1 of 29

Inventor Drawing BOM or Parts List To Show Only What Is Ballooned On Each Sheet

tschaeferZNBXX
Advisor
Advisor

I have an odd request, does anyone have an idea or add in that will do the follow.

 

On an IDW create a Parts List or BOM for each sheet?  I am looking for an easy way to create this and only show what is ballooned on each sheet of a drawing.

 

kelly.young has edited your subject line for clarity: BOM Question

Thomas "Matt" Schaefer
Engineering Tooling and Vault Manager for Material Handling Systems MHS


*AU Speaker 2018*
* AU Speaker 2017 *
==========================================================
Please use the "Accept as Solution" and "Give Kudos" functions as appropriate to further enhance the value of these forums.
5,005 Views
28 Replies
Replies (28)
Message 2 of 29

jtylerbc
Mentor
Mentor

Yes, that's possible.  I use it occasionally on large builds where we have a primary parts list (which will take up most of a sheet by itself), then individual sheets for assembling certain steps of the build, with a reference parts list only showing what is ballooned on that particular sheet.

 

Create a parts list as normal (which will be the full list for the assembly).  Then edit the list, and use the "Filter" function to apply the "Ballooned Items" filter. 

 

One thing I will point out - my company rarely uses multiple sheets in the same drawing file, so my experience is with using this on separate drawing files, rather than multiple sheets in the same file.  As I haven't really used it exactly the way you are doing, it is possible that it will have quirks in that application that I'm not aware of.

Message 3 of 29

mcgyvr
Consultant
Consultant

yep.. sounds like the out of the box "ballooned items only" parts list filter will do what you need..

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
0 Likes
Message 4 of 29

tschaeferZNBXX
Advisor
Advisor

This is close but I am looking for more of something that will filter and only show the parts ballooned on a particular sheet.  

 

The out of the box filter shows anything ballooned on any sheet of the drawing.

Thomas "Matt" Schaefer
Engineering Tooling and Vault Manager for Material Handling Systems MHS


*AU Speaker 2018*
* AU Speaker 2017 *
==========================================================
Please use the "Accept as Solution" and "Give Kudos" functions as appropriate to further enhance the value of these forums.
0 Likes
Message 5 of 29

jtylerbc
Mentor
Mentor

That's what I was afraid of, hence the caveat I added to my explanation.  I use that filter to achieve the result you're after, but under somewhat different conditions.

0 Likes
Message 6 of 29

mcgyvr
Consultant
Consultant

@tschaeferZNBXX wrote:

This is close but I am looking for more of something that will filter and only show the parts ballooned on a particular sheet.  

 

The out of the box filter shows anything ballooned on any sheet of the drawing.


Yuck..

I forgot and hate that it works like that... 

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
0 Likes
Message 7 of 29

tschaeferZNBXX
Advisor
Advisor

Yes it sucks.  

 

If we had a few options instead of having to create design views for each sheet 😕


@mcgyvr wrote:

@tschaeferZNBXX wrote:

This is close but I am looking for more of something that will filter and only show the parts ballooned on a particular sheet.  

 

The out of the box filter shows anything ballooned on any sheet of the drawing.


Yuck..

I forgot and hate that it works like that... 

 


 

Thomas "Matt" Schaefer
Engineering Tooling and Vault Manager for Material Handling Systems MHS


*AU Speaker 2018*
* AU Speaker 2017 *
==========================================================
Please use the "Accept as Solution" and "Give Kudos" functions as appropriate to further enhance the value of these forums.
0 Likes
Message 8 of 29

swalton
Mentor
Mentor

I have made custom design view reps in the main assembly that match the items I plan to balloon on each sheet.  I then filter each Parts List by the matching Design View.  I don't necessarily display that design rep on the drawing view, because I may want to see components that I don't balloon.

 

 

It's not an easy button, but it can work.  

 

Steve Walton
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Inventor 2025
Vault Professional 2025
0 Likes
Message 9 of 29

MechMachineMan
Advisor
Advisor

One of the options is to use iLogic to accomplish it:

 

This rule can be used on the sheet to change the parts list on the sheet.

 

It could be expanded to go through each sheet as well and apply the changes to all partslists.

 

Sub Main()
	Dim oDoc As Document = ThisDoc.Document
	Dim oSheet As Sheet = oDoc.ActiveSheet
	
	Dim oPL As PartsList = oSheet.PartsLists(1)
	
	For Each oRow In oPL.PartsListRows
		oRow.Visible = False
	Next
	
	For Each oBalloon In oSheet.Balloons
		oIN = oBalloon.BalloonValueSets(1).ItemNumber
		
		For Each oRow In oPL.PartsListRows
			If oRow.Item(1).Value = oIN
				oRow.Visible = True
			End if
		Next
	Next
	
End Sub

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 10 of 29

tschaeferZNBXX
Advisor
Advisor
I get the error "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))".


@MechMachineMan wrote:

One of the options is to use iLogic to accomplish it:

 

This rule can be used on the sheet to change the parts list on the sheet.

 

It could be expanded to go through each sheet as well and apply the changes to all partslists.

 

Sub Main()
	Dim oDoc As Document = ThisDoc.Document
	Dim oSheet As Sheet = oDoc.ActiveSheet
	
	Dim oPL As PartsList = oSheet.PartsLists(1)
	
	For Each oRow In oPL.PartsListRows
		oRow.Visible = False
	Next
	
	For Each oBalloon In oSheet.Balloons
		oIN = oBalloon.BalloonValueSets(1).ItemNumber
		
		For Each oRow In oPL.PartsListRows
			If oRow.Item(1).Value = oIN
				oRow.Visible = True
			End if
		Next
	Next
	
End Sub

 

Thomas "Matt" Schaefer
Engineering Tooling and Vault Manager for Material Handling Systems MHS


*AU Speaker 2018*
* AU Speaker 2017 *
==========================================================
Please use the "Accept as Solution" and "Give Kudos" functions as appropriate to further enhance the value of these forums.
0 Likes
Message 11 of 29

MechMachineMan
Advisor
Advisor

Does the sheet you are running the code on have a partslist placed already? If not, that would be causing errors.

 

Is your balloon a simple "Item number only" balloon, or is it more complex? If so, that could cause errors.

 

 Edit note: Fixed 2 missing colons during debug.

 

Sub Main()

	Dim oDoc As Document = ThisDoc.Document
    If oDoc.DocumentType <> kDrawingDocumentObject Then: MsgBox("Run in drawings only!"): Exit Sub: End If
        
	Dim oSheet As Sheet = oDoc.ActiveSheet
    If oSheet Is Nothing Then: MsgBox("Only valid for dwg files with sheets!"): Exit Sub: End If
	
    If oSheet.PartsLists.Count <> 1 Then: MsgBox("Only valid for sheets with 1 PartsList"):Exit Sub: End If
	Dim oPL As PartsList = oSheet.PartsLists(1)
	
    If oPL.PartsListRows.Count < 1 Then: MsgBox("Only valid for partslists with actual rows"): Exit Sub: End If
	If oSheet.Balloons.Count < 1 Then: MsgBox("Rule only valid for sheets with balloons!"): Exit Sub: End If

     On Error Resume Next
        For Each oRow In oPL.PartsListRows
		oRow.Visible = False
	Next

       If Err.Number <> 0 Then: MsgBox("Issue setting row visibility or accessing rows..."): End If
       Err.Clear

     On Error Resume Next
        Dim oIN As String
	For Each oBalloon In oSheet.Balloons
		oIN = oBalloon.BalloonValueSets(1).ItemNumber
                If Err.Number <> 0 Then: MsgBox("Issue grabbing balloon item number.."): End If
		Err.Clear

		For Each oRow In oPL.PartsListRows
			If oRow.Item(1).Value = oIN
				oRow.Visible = True
			End If
		Next
                If Err.Number <> 0 Then: MsgBox("Issue iterating PL/setting visibility back on"): End If
                Err.Clear
	Next
     On Error GoTo 0
End Sub 

 


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 12 of 29

tschaeferZNBXX
Advisor
Advisor

This works and gives me the errors but it turns all the rows off.  I am not an expert on iLogic but it is close.

Thomas "Matt" Schaefer
Engineering Tooling and Vault Manager for Material Handling Systems MHS


*AU Speaker 2018*
* AU Speaker 2017 *
==========================================================
Please use the "Accept as Solution" and "Give Kudos" functions as appropriate to further enhance the value of these forums.
0 Likes
Message 13 of 29

tschaeferZNBXX
Advisor
Advisor
Thank you for this and everything seems good with the exception it does not appear to read the balloons on the sheet.  It either turns everything on or everything off.


@MechMachineMan wrote:

Does the sheet you are running the code on have a partslist placed already? If not, that would be causing errors.

 

Is your balloon a simple "Item number only" balloon, or is it more complex? If so, that could cause errors.

 

 Edit note: Fixed 2 missing colons during debug.

 

Sub Main()

	Dim oDoc As Document = ThisDoc.Document
    If oDoc.DocumentType <> kDrawingDocumentObject Then: MsgBox("Run in drawings only!"): Exit Sub: End If
        
	Dim oSheet As Sheet = oDoc.ActiveSheet
    If oSheet Is Nothing Then: MsgBox("Only valid for dwg files with sheets!"): Exit Sub: End If
	
    If oSheet.PartsLists.Count <> 1 Then: MsgBox("Only valid for sheets with 1 PartsList"):Exit Sub: End If
	Dim oPL As PartsList = oSheet.PartsLists(1)
	
    If oPL.PartsListRows.Count < 1 Then: MsgBox("Only valid for partslists with actual rows"): Exit Sub: End If
	If oSheet.Balloons.Count < 1 Then: MsgBox("Rule only valid for sheets with balloons!"): Exit Sub: End If

     On Error Resume Next
        For Each oRow In oPL.PartsListRows
		oRow.Visible = False
	Next

       If Err.Number <> 0 Then: MsgBox("Issue setting row visibility or accessing rows..."): End If
       Err.Clear

     On Error Resume Next
        Dim oIN As String
	For Each oBalloon In oSheet.Balloons
		oIN = oBalloon.BalloonValueSets(1).ItemNumber
                If Err.Number <> 0 Then: MsgBox("Issue grabbing balloon item number.."): End If
		Err.Clear

		For Each oRow In oPL.PartsListRows
			If oRow.Item(1).Value = oIN
				oRow.Visible = True
			End If
		Next
                If Err.Number <> 0 Then: MsgBox("Issue iterating PL/setting visibility back on"): End If
                Err.Clear
	Next
     On Error GoTo 0
End Sub 

 


 

Thomas "Matt" Schaefer
Engineering Tooling and Vault Manager for Material Handling Systems MHS


*AU Speaker 2018*
* AU Speaker 2017 *
==========================================================
Please use the "Accept as Solution" and "Give Kudos" functions as appropriate to further enhance the value of these forums.
Message 14 of 29

MechMachineMan
Advisor
Advisor

Hmmm. Interesting. Is it popping up any of the window boxes that are supposed to let you know what is causing the error?


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 15 of 29

tschaeferZNBXX
Advisor
Advisor
Yes if there is an error they do show up.


@MechMachineMan wrote:

Hmmm. Interesting. Is it popping up any of the window boxes that are supposed to let you know what is causing the error?


 

Thomas "Matt" Schaefer
Engineering Tooling and Vault Manager for Material Handling Systems MHS


*AU Speaker 2018*
* AU Speaker 2017 *
==========================================================
Please use the "Accept as Solution" and "Give Kudos" functions as appropriate to further enhance the value of these forums.
0 Likes
Message 16 of 29

MechMachineMan
Advisor
Advisor

Ok.

 

 

The code also works perfectly in the situations I've tested it out, so it must be something to do with your balloons/PartsLists.

 

When you run it on a drawing with a partsList and SOME balloons, relay all of the message boxes that are popping up here so we can figure out what's going on.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 17 of 29

tschaeferZNBXX
Advisor
Advisor

There are no windows that appear, it just turns all the rows off.

 

 

Thomas "Matt" Schaefer
Engineering Tooling and Vault Manager for Material Handling Systems MHS


*AU Speaker 2018*
* AU Speaker 2017 *
==========================================================
Please use the "Accept as Solution" and "Give Kudos" functions as appropriate to further enhance the value of these forums.
0 Likes
Message 18 of 29

MechMachineMan
Advisor
Advisor

Could you possibly make a screen cast, or take a screen shot of one of the drawings you are trying this on?

 

Thanks.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 19 of 29

Anonymous
Not applicable

I just ran into the same issue. It seems that most of the time the "Ballooned Only" filter should include only balloons on the current sheet, but in order not to break existing drawings a new filter should just be added "Ballooned Only This Sheet". Isn't that why there is always (Inventor Version + 1), or better still (Inventor Version Patch +1).

0 Likes
Message 20 of 29

kmgrose
Participant
Participant

This code is great!

 

This is almost exactly what I needed for my application as well!

 

Do you know how to add manual custom parts to the parts list and have those run with this code?

 

I just started looking into this today. So I am going to play around with it this weekend as well to see if I can figure it out as well. This is good stuff for sure.

Respectfully,

Kevin Grose
0 Likes