In Inventor 2014, is it possible to export a list of all of the materials in a given material library..? As text, or into Excel, or something similar?
I have a material library in Inventor 2014 containing lots of custom defined materials. I would like to create a master list that I can give to someone who isn't using Inventor. The only property that I really need to export is the material name, e.g.' CSA G40.21-44W'.
In this case, engineering is trying to coordinate better with purchasing, by making sure that materials are specified in the same way in both departments.
So far the only methods I have found to do this are to screenshot the opened material library window... Or hand type. Both of which can be done, but it would be nice if there was an easier way.
Thanks!
Al
Solved! Go to Solution.
Solved by 4donwan4. Go to Solution.
At this time there is not a way to export this as you would like. This is just a limitation at this time. If you would like to enter a wish list item asking for this to be considered as an enhancement please use the following link.
http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=1109794
Don
Following up on this. Not sure is this is now available in 2015, but we're still on 2013 and the "workaround" was this:
Create a new assembly and add virtual components to it. Depending on how large your database is this may be several hundred. Then assign each component a material under Bill of Materials.
You can then bring this into a Parts List in a drawing, then export that Parts List to Excel.
Not exactly a "solution" but something that can work in a pinch
I needed the same feature so I wrote a small macro to save the info to a text file.
Here it is in case anyone else finds it usefull. I attached a print out of the InventorMaterial Library as an example.
Public Sub ExportMaterialNames()
'This sub will print out the names of all materials and their related assets in the active material library to a text file.
Dim InvApp As Inventor.Application, AML As AssetLibrary, cat As AssetCategory, ma As MaterialAsset
'Get the Inventor Application object.
Set InvApp = ThisApplication
'Get the Active Material Library.
Set AML = InvApp.ActiveMaterialLibrary
'Setup the stream writer.
Dim tFile As FileSystemObject, SW As TextStream, tFilePath As String
Set tFile = New FileSystemObject
tFilePath = "C:\Material Library - " & AML.DisplayName & ".txt"
Set SW = tFile.CreateTextFile(tFilePath, True)
'Print to text file.
SW.WriteLine "#############################################################################################################################"
SW.WriteLine "Library Display Name: " & AML.DisplayName
SW.WriteLine "Library Internal Name: " & AML.InternalName
SW.WriteLine "Library is Read-Only: " & AML.IsReadOnly
SW.WriteLine "Category Count: " & AML.MaterialAssetCategories.count
SW.WriteLine "Material Count: " & AML.MaterialAssets.count
SW.WriteLine "Appearance Count: " & AML.AppearanceAssets.count
SW.WriteLine "Physical Properties Count: " & AML.PhysicalAssets.count
SW.WriteLine "Library Location: " & AML.FullFileName
SW.WriteLine "#############################################################################################################################"
For Each cat In AML.MaterialAssetCategories
SW.WriteLine "-----------------------------------------------------------------------------------------------------------------------------"
SW.WriteLine "Category: " & cat.DisplayName
SW.WriteLine "-----------------------------------------------------------------------------------------------------------------------------"
For Each ma In cat.Assets
SW.WriteLine vbTab & "Material Name: " & ma.DisplayName
SW.WriteLine vbTab & "Internal Name: " & ma.Name
SW.WriteLine vbTab & vbTab & "-------------------------------------------------------------------------------------------------------------"
SW.WriteLine vbTab & vbTab & "Linked Appearance Asset: " & ma.AppearanceAsset.DisplayName
SW.WriteLine vbTab & vbTab & vbTab & "Appearance Asset Category: " & ma.AppearanceAsset.CategoryName
SW.WriteLine vbTab & vbTab & vbTab & "Appearance Asset Internal Name: " & ma.AppearanceAsset.Name
SW.WriteLine vbTab & vbTab & vbTab & "Appearance Asset Has Texture: " & ma.AppearanceAsset.HasTexture
SW.WriteLine vbTab & vbTab & vbTab & "Appearance Asset Is Read-Only: " & ma.AppearanceAsset.IsReadOnly
SW.WriteLine vbTab & vbTab & vbTab & "Appearance Asset Is Used: " & ma.AppearanceAsset.IsUsed
SW.WriteLine vbTab & vbTab & "-------------------------------------------------------------------------------------------------------------"
SW.WriteLine vbTab & vbTab & "Linked Physical Asset: " & ma.PhysicalPropertiesAsset.DisplayName
SW.WriteLine vbTab & vbTab & vbTab & "Physical Asset Category: " & ma.PhysicalPropertiesAsset.CategoryName
SW.WriteLine vbTab & vbTab & vbTab & "Physical Asset Internal Name: " & ma.PhysicalPropertiesAsset.Name
SW.WriteLine vbTab & vbTab & vbTab & "Appearance Asset Has Texture: " & ma.PhysicalPropertiesAsset.HasTexture
SW.WriteLine vbTab & vbTab & vbTab & "Appearance Asset Is Read-Only: " & ma.PhysicalPropertiesAsset.IsReadOnly
SW.WriteLine vbTab & vbTab & vbTab & "Appearance Asset Is Used: " & ma.PhysicalPropertiesAsset.IsUsed
SW.WriteLine vbTab & "---------------------------------------------------------------------------------------------------------------------"
Next
Next
SW.WriteLine "-----------------------------------------------------------------------------------------------------------------------------"
SW.WriteLine "-----------------------------------------------------------------------------------------------------------------------------"
SW.Close
MsgBox ("Created Material Library file:" & vbCrLf & tFilePath)
End Sub
I was able to export my material list by creating an excel spreadsheet called "Material" in my current Project directory and then using the following iLogic rule:
MultiValue.List("PART_MATERIAL") = iProperties.Materials iProperties.Material=PART_MATERIAL GoExcel.CellValues("Material.xls", "Sheet1", "A2", "A1000") = MultiValue.List("PART_MATERIAL")
The only hitch was that for some reason it made me save a copy of the "Material" spreadsheet when I ran it, but the copy had all of the materials in it, so it got the job done!
.. and vote here at ideas:
Can't understand why it hasn't got more votes, this is something everybody should wish for.
regards Silvia