Automated Transculent - Surfaces - STEP-file

Automated Transculent - Surfaces - STEP-file

Anonymous
Not applicable
649 Views
3 Replies
Message 1 of 4

Automated Transculent - Surfaces - STEP-file

Anonymous
Not applicable

Hello,

 

I need some help. I often get STEP-files where parts are transculent, these assemblies are large.

 

Can somebody help me coding VBA, so all parts in the assembly are switched off the transculent propertie?

 

Thanks in advance.

 

 

0 Likes
650 Views
3 Replies
Replies (3)
Message 2 of 4

Mike.Wohletz
Collaborator
Collaborator

I think you will find what you are looking for in number 5 of this post.

Turn off Translucent using VBA

0 Likes
Message 3 of 4

Anonymous
Not applicable

Hello,

 

I tried the script you mention, before i did the post, but the script doesn't work. In fact it doesn't do anything.

 

So please who can advice me.

0 Likes
Message 4 of 4

Mike.Wohletz
Collaborator
Collaborator

Try this and see if it works for you..

 

  Private Sub TranslucentTest()
   Dim oDoc As Inventor.Document
  Set oDoc = ThisApplication.ActiveDocument
          Call TranslucentOff(oDoc)
    End Sub

   Function TranslucentOff(ByVal oDoc As Document)
        If oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
            Dim oAssembly As Inventor.AssemblyDocument
            Set oAssembly = oDoc
            Dim oRefDoc As Inventor.Document
            For Each oRefDoc In oAssembly.AllReferencedDocuments
               Call TranslucentOff(oRefDoc)
            Next
        ElseIf oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
            Dim oPart As Inventor.PartDocument
            Set oPart = oDoc
            Dim oWorkSurface As Inventor.WorkSurface
            For Each oWorkSurface In oPart.ComponentDefinition.WorkSurfaces
                If oWorkSurface.Translucent = True Then
                    oWorkSurface.Translucent = False
                End If
            Next
        End If
    End Function