Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Switching to new material library - how to?

2 REPLIES 2
Reply
Message 1 of 3
jaco011
231 Views, 2 Replies

Switching to new material library - how to?

Hi all,

 

We want to create a new material and appearance library and switch in all our current files to these new materials en appearances. Someone with advise how to approach this? 

 

We have a lot of files, so it would be nice to switch it by using the vault. I don't know if the vault can see which materials / appearances are used? And how to do this?

 

Or is there a way to switch it by using ilogic? For example, code that checks if the open files contains materials / appearances from the old library? Online I only find code for getting material for the library, but not to analyse used materials (and from which library these came)

Hope someone has experience with this and can help me out!

Labels (4)
2 REPLIES 2
Message 2 of 3
WCrihfield
in reply to: jaco011

Hi @jaco011.  I do not have Vault, so I could not advise about that side of your question, but I may be able to help you devise a plan or process for a task like this through code means.  In order for a document to be able to use a material or appearance, there must first be a copy of that Asset (object used to store material, appearance, & physical property data) locally within that document, not just in a library somewhere.  So, within each Part type document will be copies of every Asset it is currently using for something, and potentially a copy of every Asset that it has used in the past, if they have not been purged.  The document itself can not simply be assigned an entire material library as its reference, but you can set the 'active' material/appearance library in the project settings.  Also, just in case you were not yet aware, the same library can be used for both materials and appearances.  Each MaterialAsset has a reference to an appearance type Asset, and a physical properties type Asset.  Also, there is not an AppearanceAsset or PhysicalPropertiesAsset type API objects, they just properties of the MaterialAsset which refer to generic Asset API objects.

 

Will the 'new' material/appearance (in your new library) have the exact same name as the 'old' material/appearance that already exists in the existing documents?  If not, you may have to plan creating on a 2 factor list, which has the old name, and the new name, for reference later in the automation process.  Then within the individual existing documents, a code could cycle through each local asset, check if its name is in the 'old' side of the list.  If found, it can get the new asset name, try to find it in your new library, try to copy it to the document, and replace the old asset.  There may be other similar processes, but this one seems fairly logical, and potentially doable.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 3
jaco011
in reply to: WCrihfield

Thanks for your reply. I will use this info while designing our workflow

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report