Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I originally successfully created a LOD via iLogic but realized that by doing so with
Component.IsActive(oOcc.Name) = False
The BOM structure for all of the suppressed parts becomes Reference, which is not what I want.
I've since decided to try to create a View Rep and copy to LOD which should have no effect on the BOM structure.
I can create the View rep but cannot work out or find any code that will copy to LOD. Can anyone assist me please?
(I've left the original lines of code in as shown below incase there may be an easy tweak to my original attempt)
Dim oDoc As Document = ThisDoc.Document Dim oAsmCompDef As AssemblyComponentDefinition = oDoc.ComponentDefinition 'Try 'oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Item("fasteners removed").Activate 'Catch 'oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Add("fasteners removed") 'End Try Try oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item("fasteners removed").Activate Catch oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Add("fasteners removed") End Try Dim oOcc As ComponentOccurrence 'loop through every part 'For Each oOcc In ThisDoc.Document.ComponentDefinition.Occurrences'.AllLeafOccurrences ' If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 4) = "SHCS" Then Component.IsActive(oOcc.Name) = False ' If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 15) = "HEX REGULAR NUT" Then Component.IsActive(oOcc.Name) = False ' If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 12) = "HEX HIGH NUT" Then Component.IsActive(oOcc.Name) = False ' If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 12) = "HEX THIN NUT" Then Component.IsActive(oOcc.Name) = False ' If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 14) = "PREVAILING HEX" Then Component.IsActive(oOcc.Name) = False ' If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 14) = "HEX HEAD SCREW" Then Component.IsActive(oOcc.Name) = False ' If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 13) = "HEX HEAD BOLT" Then Component.IsActive(oOcc.Name) = False ' If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 22) = "HEX SOCKET COUNTERSUNK" Then Component.IsActive(oOcc.Name) = False ' If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 6) = "WASHER" Then Component.IsActive(oOcc.Name) = False 'Next For Each oOcc In ThisDoc.Document.ComponentDefinition.Occurrences'.AllLeafOccurrences If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 4) = "SHCS" Then Component.Visible(oOcc.Name) = False If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 15) = "HEX REGULAR NUT" Then Component.Visible(oOcc.Name) = False If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 12) = "HEX HIGH NUT" Then Component.Visible(oOcc.Name) = False If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 12) = "HEX THIN NUT" Then Component.Visible(oOcc.Name) = False If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 14) = "PREVAILING HEX" Then Component.Visible(oOcc.Name) = False If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 14) = "HEX HEAD SCREW" Then Component.Visible(oOcc.Name) = False If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 13) = "HEX HEAD BOLT" Then Component.Visible(oOcc.Name) = False If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 22) = "HEX SOCKET COUNTERSUNK" Then Component.Visible(oOcc.Name) = False If Left(iProperties.Value(oOcc.Name, "Project", "Description"), 6) = "WASHER" Then Component.Visible(oOcc.Name) = False Next ThisDoc.Save oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item("Master").Activate
It's probably obvious I'm no coder, just chopping and changing to suit.
Any help would much appreciated.
Solved! Go to Solution.