02-02-2023
12:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-02-2023
12:25 AM
Dim oDoc As PartDocument = ThisDoc.Document If oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then Dim oSheetMetalComponentDef As Inventor.SheetMetalComponentDefinition = oDoc.ComponentDefinition oSheetMetalComponentDef.SheetMetalStyles.Item("Default").Activate End If
First, oDoc as Document won't work, there is no componentdefinition within it. use PartDocument
Then check if it is a sheetmetal doc with subtype to prevent errors.
I can't see 'Sheetmetal' declared in your script and with object model i couldnt find 'setactivestyle' anywhere.