Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have inventor 2020 and I made this code to change the sheetmetal defaults in all sheetmetal parts in an assembly
But this error appears when I run the code.
:
Sub Main() Dim thisAssyDoc As AssemblyDocument = CType(ThisDoc.Document, AssemblyDocument) ChangeToTest(thisAssyDoc) End Sub Sub ChangeToTest(assemblyDoc As AssemblyDocument) For Each subCompOcc As ComponentOccurrence In assemblyDoc.ComponentDefinition.Occurrences Dim oDoc As PartDocument oDoc = ThisApplication.ActiveDocument Dim oCompDef As SheetMetalComponentDefinition If oCompDef is oDoc.ComponentDefinition Then oCompDef.SheetMetalStyles.Item("18ga GA JKT (Test)").Activate ElseIf oDoc.SubType = DocumentTypeEnum.kAssemblyDocumentObject Then ChangeToTest(oDoc.Definition.Document) End If Next End Sub
Solved! Go to Solution.