SheetMetal - Styles

SheetMetal - Styles

Anonymous
Not applicable
784 Views
1 Reply
Message 1 of 2

SheetMetal - Styles

Anonymous
Not applicable

I´m trying to update the style in many sheet metal documents by vba in Inventor 2009.

I would update the local styles from the style library.

Is there any way to do this in vba or by iLogic?

 

 

 

 

 

 

0 Likes
785 Views
1 Reply
Reply (1)
Message 2 of 2

Mike.Wohletz
Collaborator
Collaborator

something like this will do what you want I think in .NET, I am sure that you could convert it to VBA.

 

This is using an list of files from an open file dialog and passing the list into the SMStylesUpdate sub

 

       
    Public Sub SMStylesUpdate(ByVal Files As List(Of String))
        For Each I As String In Files
            Dim oDoc As Document = G_oApp.Documents.Open(I)
            If oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
                Dim oPartDoc As PartDocument = oDoc
                If oPartDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
                    ' we know this is a sheet metal part
                    Dim oSheetMetalCompDef As SheetMetalComponentDefinition = oPartDoc.ComponentDefinition
                    Dim oStyles As SheetMetalStyles = oSheetMetalCompDef.SheetMetalStyles
                    For Each oStyle As SheetMetalStyle In oStyles
                        If oStyle.UpToDate = False Then
                            oStyle.UpdateFromGlobal()
                        End If
                    Next
                End If
            End If
        Next
    End Sub

 

0 Likes