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: 

New Materials not added to local document

0 REPLIES 0
Reply
Message 1 of 1
vandargo
262 Views, 0 Replies

New Materials not added to local document

Hi All,

  I am using the following snippet to create a new material;

 

Dim oNewMaterial As Material


Try
oNewMaterial = oPartDoc.Materials.Add(MatName, newDensity)
oNewMaterial.LinearExpansion = newLinearExpansion
oNewMaterial.PoissonsRatio = newPoissonsRation
oNewMaterial.SpecificHeat = newSpecificHeat
oNewMaterial.ThermalConductivity = newThermalConductivity
oNewMaterial.UltimateTensileStrength = newUltimateTensileStrength
oNewMaterial.YieldStrength = newYieldStrength
oNewMaterial.YoungsModulus = newYoungsModulus

oPartDoc.ComponentDefinition.Material = oNewMaterial
Catch
oPartDoc.ComponentDefinition.Material = oPartDoc.Materials.Item(MatName)
End Try

 

 

This allows me to create the material, and if it already exists, to select it as the current material.

 

It works fine on the surface.  The new material exists if looked up under the iproperties.  It exists on the materials drop-down list under Tools/Material and Appearance. It contains all the information I want.  Lovely.

 

If I go to the materials browser, it doesn't exist anywhere that is visible.  If I try to create the material through this interface, it tells me the material exists... but where is it?!?

 

I don't really care too much, because this new Materials interface so far has been pretty unfriendly, and I've been avoiding it... But, I'm working on adding the materials to structural shapes in the content center, and the material selection is looking at the library.  With hundreds of materials, and no viable material library to import, I'm looking at entering these one by one if I can't automate it.

 

Thanks for your help.

V.

 

Inventor Professional 2013 sp1.1

 

0 REPLIES 0

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

Post to forums  

Autodesk Design & Make Report