Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

I try this
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
Else
MessageBox.Show("Fail", "Title")

End If

Next

End Sub