Hello,
I wanna make a code in VBA, Inventor 2011.
I'm tried set the Active Style in SheetMetal, but I received an error:
Private Sub CmdOk_Click()
SheetMetal.SetActiveStyle ("X01.009.014")
End Sub
Compile error:
Variable not defined
Does anybody can help me?
Thanks in advance.
Ladimir Abdala
Solved! Go to Solution.
Solved by ladimirabdala. Go to Solution.
Here is the answer:
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument
Dim oSheetMetalCompDef As SheetMetalComponentDefinition
Set oSheetMetalCompDef = oPartDoc.ComponentDefinition
Dim oStyle As SheetMetalStyle
'This is the main code line:
oSheetMetalCompDef.SheetMetalStyles.Item("Another_Sheet_Metal_Rule").Activate
NEXT STEP:
How change the Material Style in VBA????
Look at the box in the "Sheet Metal Defults" on the Sheet Metal Ribow.
Finally:
Dim oMaterial As Material
Set oMaterial = oPartDoc.Materials.Item("CFF ABNT 1008 - 1,50 mm")
oPartDoc.ComponentDefinition.Material = oMaterial