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: 

How to change sheet metal Rule for changing material.

1 REPLY 1
Reply
Message 1 of 2
arunkgvm
684 Views, 1 Reply

How to change sheet metal Rule for changing material.

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?

--- *AM* ----
Tags (1)
1 REPLY 1
Message 2 of 2
xiaodong_liang
in reply to: arunkgvm

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

 

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

Post to forums  

Autodesk Design & Make Report