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: 

Deleting Materials

1 REPLY 1
Reply
Message 1 of 2
Anonymous
239 Views, 1 Reply

Deleting Materials

I only need 4 materials. Steel, Mild, Stainless Steel, UHMW, and AR. How
can I modify inventor to have only these materials so I don't have to
constantly sift through 100 different materials?

I tried deleting them out of the materials.xml file, but it didn't seem to
have an effect on inventor.
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Styles (including materials) can exist in two locations; the library and
locally within a document. Removing unwanted styles from the xml file
removes them from the library but not for any documents they might exist in.
Typically the local styles are ones that have been used from the library and
are copied locally so the document will behave correctly even when used
somewhere where that style doesn't exist. It looks like there are a lot of
local materials in the standard part template. I don't know why.

Here's a program that will delete (or purge as it's referred to in the
user-interface) all local materials that aren't being used for the active
document. If you do this for the template then all of your parts will be
clean and you can still used materials from the library.

Public Sub PurgeLocalMaterials()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oMaterial As Material
For Each oMaterial In oDoc.Materials
If oMaterial.StyleLocation = kLocalStyleLocation And Not
oMaterial.InUse Then
oMaterial.Delete
End If
Next
End Sub
--
Brian Ekins
Autodesk Inventor API

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report