Community
Hi ... I want to change the material of a sheet metal part using inventor api.I tried something like code
Dim partDoc As PartDocument partDoc = inventorApp.Documents.Open(FilePath & filename, False) If partDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then Dim smDef As SheetMetalComponentDefinition smDef = partDoc.ComponentDefinition Dim style As SheetMetalStyle style = smDef.SheetMetalStyles.Item("sheetMetalRule")
But I can't get the code for material change.Please anyone help?
Hi,
I believe you are stuck with Inventor 2014 because SheetMetalStyle.Material is a hidden property now. I think this is dure to the new material API introduced from 2014. But I did not see a new way to change material. The hidden property can still work e.g.
Sub updateDoc() Dim partDoc As PartDocument Set partDoc = ThisApplication.ActiveDocument If partDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then Dim smDef As SheetMetalComponentDefinition Set smDef = partDoc.ComponentDefinition Dim style As SheetMetalStyle Set style = smDef.SheetMetalStyles.Item("sheetMetalRule") style.Material = partDoc.Materials.Item(1) End If End Sub