iLogic LOD of Subassemblies

iLogic LOD of Subassemblies

Anonymous
Not applicable
388 Views
0 Replies
Message 1 of 1

iLogic LOD of Subassemblies

Anonymous
Not applicable

Hi, I thought I'd share this.

 

I typically work with large assemblies and set LOD's only after I have placed the subassemblies.  I need to have the subassembly LOD to match the top level LOD.  Here is the code I'm using.  Works great.

 

SyntaxEditor Code Snippet

'Matches LOD of parent to subassmblies of the same LOD name 
'with help from Curtis Waguespack's blog

'Get parent active LOD name
CurrentLOD = ThisDoc.Document.ComponentDefinition.RepresentationsManager.ActiveLevelofDetailRepresentation.Name

'Get total number of components
Dim oAsmComp As ComponentDefinition
oAsmComp = ThisDoc.Document.ComponentDefinition

TotalOcc = oAsmComp.Occurrences.Count
MsgBox("Total Occurances = " & TotalOcc) 

'Cycle thru components matching LOD to parent
    For i = 1 To TotalOcc
        'Namer = oAsmComp.Occurrences(i).Name
        Try
            oAsmComp.Occurrences(i).SetLevelOfDetailRepresentation(CurrentLOD)
            'MsgBox("Current LOD = " & CurrentLOD & Chr(13) & " Namer = " & Namer & Chr(13) & " Counter = " & i)
        Catch
            'MsgBox("Not an Assembly = " & Namer & Chr(13) & " Counter = " & i)
        End Try
    Next  

 

389 Views
0 Replies
Replies (0)