Message 1 of 24
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to update all styles in a 3D-document with VBA. I'm using Inventor 2018.3.3 (German).
I already wrote a code, that updates LightingStyles, TextStyles, RenderStyles, Materials and SheetMetalStyles, but I cannot find APIs for the last two styles (see picture). Are there any APIs to update these "DimensionStyles" and "StandardStyles" from 3D Annotations?
If anyone needs it, here is my code:
Public Sub Refresh3D_Styles()
Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
'Beleuchtungsstile
Dim oLightingStyle As LightingStyle
For Each oLightingStyle In oDoc.LightingStyles
If oLightingStyle.UpToDate = False Then
oLightingStyle.UpdateFromGlobal
End If
Next
'Textstile
Dim oTextStyle As TextStyle
For Each oTextStyle In oDoc.TextStyles
If oTextStyle.UpToDate = False Then
oTextStyle.UpdateFromGlobal
End If
Next
'Darstellungen (Farben)
Dim oRenderStyle As RenderStyle
For Each oRenderStyle In oDoc.RenderStyles
If oRenderStyle.UpToDate = False Then
oRenderStyle.UpdateFromGlobal
End If
Next
'Materialien
Dim oMaterial As Material
For Each oMaterial In oDoc.Materials
If oMaterial.UpToDate = False Then
oMaterial.UpdateFromGlobal
End If
Next
'Blechstile
If oDoc.ComponentDefinition.Type = kSheetMetalComponentDefinitionObject Then
Dim oSheetMetalStyle As SheetMetalStyle
For Each oSheetMetalStyle In oDoc.ComponentDefinition.SheetMetalStyles
If oSheetMetalStyle.UpToDate = False Then
oSheetMetalStyle.UpdateFromGlobal
End If
Next
End If
End Sub
Kind regards
Michael
Solved! Go to Solution.