Exporting the Model Data tab - not Structured or Parts Only

Exporting the Model Data tab - not Structured or Parts Only

RNDinov8r
Collaborator Collaborator
2,642 Views
12 Replies
Message 1 of 13

Exporting the Model Data tab - not Structured or Parts Only

RNDinov8r
Collaborator
Collaborator

So, is this even possible. Given how we use our BOM data in the other two tables, is it possible to export only the data in the "Model Data" to a spread sheet?

RNDinov8r_0-1613496556493.png

 

Currently using IV2020 and not Vault Based. One of the things that is being discussed is building a top level model with sub assemblies, all be it empty files initially, to help get an idea of project scope...and to use it for tracking and progress. 

 

I know I can use the export button in the upper right, but that exports either the Structured or Parts Only BOM...and I would prefer to not have to edit those tables (column deletion) after they are edited. 

0 Likes
Accepted solutions (1)
2,643 Views
12 Replies
Replies (12)
Message 2 of 13

imajar
Advisor
Advisor

What in the model data tab are you needing that the structured does not have?

 

If you want to show "all levels", then go to the structured tab, click the magnifier button, click view properties, change level to "all levels", then when you export the structured BOM, it will include the full assembly structure.


Aaron Jarrett, PE
Inventor 2019 | i7-6700K 64GB NVidia M4000
LinkedIn

Life is Good.
0 Likes
Message 3 of 13

imajar
Advisor
Advisor

As a side note, I did recently see an app in the appstore that said something about exporting BOM to excel with more options. . . Maybe give that a shot. . .


Aaron Jarrett, PE
Inventor 2019 | i7-6700K 64GB NVidia M4000
LinkedIn

Life is Good.
0 Likes
Message 4 of 13

RNDinov8r
Collaborator
Collaborator

I am aware of how to expand all the levels when exporting. My deal is that I don't want to carry all of the columns over that are in the structured Tab. Because the "export" tool built into the BOM UI does not allow me to select columns, or to export to a template that has embedded macros (unlike exporting from a parts list in an IDW), I just want to quickly export only the columns shown to a generic spread sheet. 

Message 5 of 13

imajar
Advisor
Advisor

It's a pain, but the only thing I can think to do would be to remove the unwanted columns from the BOM before exporting.  Outside of that, the remaining options would be exploring add-ins or writing your own code.  


Aaron Jarrett, PE
Inventor 2019 | i7-6700K 64GB NVidia M4000
LinkedIn

Life is Good.
0 Likes
Message 6 of 13

A.Acheson
Mentor
Mentor

@RNDinov8r 

Link below last message and step 1 of that macro will export parts tab and filter by custom columns. Small tweaking to the code change part to structured etc will get what you are after. There could be other methods to work with macro enabled templates also on the customization forum.

 

https://forums.autodesk.com/t5/inventor-customization/is-there-a-way-to-make-this-run-faster/td-p/99...

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 7 of 13

johnsonshiue
Community Manager
Community Manager

Hi Chad,

 

I am not sure if you are aware of a low-tech approach. You can simply expand all nodes and multi-select all rows -> Copy and Paste it to a spreadsheet without having to export.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 8 of 13

RNDinov8r
Collaborator
Collaborator
Accepted solution

Alan,

 

That is a good option, which I can actually see functionality for on some other things, but I came up with a method that basically calls one Structured BOM format, exports the bom, and then replaces that format I pulled in with the original structure.

 

this is my code:

'Make sure that the correct structured BOM template is available.
'Import the BOM Tree for exporting too.
Dim oAsmDoc As AssemblyDocument = ThisDoc.Document
Dim oAsmDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition
Dim oBOM As BOM = oAsmDef.BOM
 
Dim filename As String = "K:\Inventor\R2020 Inventor\Customization\BOMTree.xml"
Call oBOM.importBOMCustomization(filename)
'______________________________________________________________________________
'Export the BOM using the BOMTree Structure template
ThisBOM.Export("Structured", "BOM FileTree", kMicrosoftExcelFormat)
'kMicrosoftAccessFormat			= Microsoft Access
'_______________________________________________________________________________
'Reset to the orignal Structured BOM format 
Dim filename2 As String = "K:\Inventor\R2020 Inventor\Customization\StucturedBOMStructure.xml"
Call oBOM.ImportBOMCustomization(filename2)


So, I have this even to trigger on the close of my top level assembly.

When we design models, A lot of the guys want to "set up" a structure before they start making parts.
My intent was to emulate this spread sheet (minus the formatting niceties). So, every time you close the model you will have an up-to -date look at the status of the model.

RNDinov8r_0-1613567577625.png

It is possible that using the code in Alan's linked post, I could export to a specific template? that's for the future. for now, this gets me around the issue of manual/dual entry of a lot of data. All of the columns in that table are edited either via the BOM now, or using iPropWiz 7.

Message 9 of 13

RNDinov8r
Collaborator
Collaborator

Alan, 

 

Looked at that link a little closer and it solved a problem I had which was, for this operation, I only wanted the first level, but our standard structured BOM is all levels. I was able to pull snippets, so I export to my format a first level only, then reset the Strucutred BOM to all levels. this is the updated code.

'Make sure that the correct structured BOM template is available.
'Import the BOM Tree for exporting too.
Dim oAsmDoc As AssemblyDocument = ThisDoc.Document
Dim oAsmDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition
Dim oBOM As BOM = oAsmDef.BOM
 
Dim filename As String = "K:\Inventor\R2020 Inventor\Customization\BOMTree.xml"
Call oBOM.ImportBOMCustomization(filename)
'______________________________________________________________________________
'Export the BOM using the BOMTree Structure template
oBOM.StructuredViewEnabled = True 
oBOM.StructuredViewFirstLevelOnly = True 'sets my BOM to only one level which is all I need. Because of 1 level only, no delimiter is needed
ThisBOM.Export("Structured", "BOM FileTree", kMicrosoftExcelFormat)
'kMicrosoftAccessFormat			= Microsoft Access
'_______________________________________________________________________________
'Reset to the orignal Structured BOM format 
Dim filename2 As String = "K:\Inventor\R2020 Inventor\Customization\StucturedBOMStructure.xml"
Call oBOM.ImportBOMCustomization(filename2)
oBOM.StructuredViewEnabled = True
oBOM.StructuredViewFirstLevelOnly = False 'resetting to all levels which is our standard view.
oBOM.StructuredViewDelimiter = "." 'delimiter is needed since we have many levels.
Message 10 of 13

A.Acheson
Mentor
Mentor

@RNDinov8r 

 

When you say export to a specific template are you talking about excel template.xlsx or will it be macro enabled in the future? The example I provided exports in an indirect fashion to a macro enabled file. I think I have seen direct exporting to template file but it would involve doing all excel processing if needed  through the ilogic code which is more involved.

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 11 of 13

RNDinov8r
Collaborator
Collaborator

Alan, 

 

As I am by no means an expert at coding, it wasn't apparent to me that any of the code in that link was doing that. If it is, that's great. Ideally, I think I would want to export to an xlsx template (maybe starting at a certain cell?), This would allow me to embed some conditional formatting based on values that get imported into cells.

 

My assumption would be if I can export to a specific xlsx file, I could just as easily export to a macro enabled xlsm file? It's just a matter of pointing at a different template file?

0 Likes
Message 12 of 13

A.Acheson
Mentor
Mentor

@RNDinov8r 

 

The ilogic code creates a new excel file each time sorts the columns according to the xml file,  then runs the excel embedded macro in the template to copy that excel information to the template then saves out to an .xlsx at the end.  Two separate process working together. 

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 13 of 13

andersonafsilva
Community Visitor
Community Visitor

In Model data tab, it's possible to group parts by model state, in structured or part only isn't...

0 Likes