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

LevelOfDetailRepresentation

Hello together,

 

I am looking for a possibility to list all parts, assemblies and subassemblies which are suppressed by a LevelOfDetailRepresentation.

 

 

This works for an assembly without subassemblies:

 

Dim asm As AssemblyDocument
        asm = m_inventorApplication.ActiveDocument

        Dim acd As AssemblyComponentDefinition
        acd = asm.ComponentDefinition

        Dim rm As RepresentationsManager
        rm = acd.RepresentationsManager

        Dim nvm As NameValueMap
        nvm = m_inventorApplication.TransientObjects.CreateNameValueMap()

        Dim doc As AssemblyDocument
        Dim occ As ComponentOccurrence

        ListBox1.Items.Clear()
        ListBox2.Items.Clear()

        Dim lod As LevelOfDetailRepresentation
        For Each lod In rm.LevelOfDetailRepresentations
            ListBox1.Items.Add(lod.Name)
            ListBox2.Items.Add(lod.Name)
            Call nvm.Add("LevelOfDetailRepresentation", lod.Name)
            doc = m_inventorApplication.Documents.OpenWithOptions(asm.FullFileName, nvm, False)
            Call nvm.Clear()

            For Each occ In doc.ComponentDefinition.Occurrences
                If occ.Suppressed = True Then
                    ListBox2.Items.Add("    " + occ.Name + " Suppressed = " + Str(occ.Suppressed))
                End If

                ListBox1.Items.Add("    " + occ.Name + " Suppressed = " + Str(occ.Suppressed))
            Next

            ' Don't forget to close the document not used anymore
            If Not lod Is rm.ActiveLevelOfDetailRepresentation Then
                Call doc.Close(True)
            End If
        Next

 

Thank you very much

 

Georg