Inventor 2013 - List materials from all libraries

Inventor 2013 - List materials from all libraries

Raider_71
Collaborator Collaborator
944 Views
4 Replies
Message 1 of 5

Inventor 2013 - List materials from all libraries

Raider_71
Collaborator
Collaborator

Hi is it posible to list all the materials from all libraries and catagories from Inventor 2013?

 

I am using this at the moment:

 Dim oMat As Inventor.Material
         For Each oMat In oApp.StylesManager.Materials
            comboMaterial.Items.Add(oMat.Name.ToString)
         Next

This works but only pulls through and lists the "Inventor Material Library" materials by default. 

What is strange though is that when I apply a material from another library to a part then its almost like that library is now active and if the routine is run again it only pulls through materials from that library and not the "Inventor Material Library" again.

 

I know in 2014 its better supported but is there a way to get all materials in 2013?

0 Likes
945 Views
4 Replies
Replies (4)
Message 2 of 5

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

This posts seems to answer your question: http://forums.autodesk.com/t5/Inventor-Customization/Material-Asset-Inventor-2014/td-p/4336533

 

I think the same should be possible in Inventor 2013 as well.

 

Cheers,

 

 



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 5

Raider_71
Collaborator
Collaborator

Hi Adam,

 

I have seen that before but its only valid for 2014

 

This code works in 2014 but not in 2013:

 

        For Each alib As Inventor.AssetLibrary In oApp.AssetLibraries
            For Each matasset As Inventor.MaterialAsset In alib.MaterialAssets
                ComboBox1.Items.Add(matasset.DisplayName)
            Next
        Next

 

Any advice?

 

Cheers

Pieter

0 Likes
Message 4 of 5

adam.nagy
Autodesk Support
Autodesk Support

Hi Pieter,

I got the following feedback:
>>>>>
In Inventor 2013 we have not APIs to access the non-active material library, the StylesManager.Materials returns the materials in the active library(if no document open this returns the active library defined in current project, otherwise it returns the active library in document), while the PartDocument/AssemblyDocument.Materials returns the both materials in the document and active library. I could not find a workaround for this case.
<<<<<

Sorry 😞

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 5 of 5

Raider_71
Collaborator
Collaborator

Thanks Adam,

 

At least I know that it cant be done and I can stop searching for a solution... 🙂

 

Cheers

Pieter

0 Likes