09-14-2021
01:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
09-14-2021
01:10 PM
Gang...
Thanks for all the insight. So here's where I ended up and will share the logic....
Creates new View Rep and turns off all reference components at that level. Then activates the original View Rep when the iLogic was initiated....
' Creates a new View Rep "Active Components" and then turns all Reference Components visibility to off. 'It only turns On active Components at this level. 'Then returns back to original active View Rep when logic was initiated. Dim odoc As Document Dim oCompDef As ComponentDefinition odoc = ThisApplication.ActiveDocument oCompDef = odoc.ComponentDefinition 'Sets initial View Rep oActiveViewRep = oCompDef.RepresentationsManager.ActiveDesignViewRepresentation 'Creates New View Rep Dim oviewrep2 As DesignViewRepresentation Try oCompDef.RepresentationsManager.DesignViewRepresentations.Item("Active Components").Activate Catch oviewrep2 = oCompDef.RepresentationsManager.DesignViewRepresentations.Add("Active Components") End Try 'This turns off some object types in view rep If odoc.DocumentType = kAssemblyDocumentObject Then ThisApplication.ActiveDocument.ObjectVisibility.WeldmentSymbols = False 'ThisApplication.ActiveDocument.ObjectVisibility.Welds = False End If 'This sets some parameters to turn off ref components oAssemblyComponents = oCompDef.Occurrences Dim oOccurrence As ComponentOccurrence For Each oOccurrence In oAssemblyComponents If (oOccurrence.BOMStructure = BOMStructureEnum.kReferenceBOMStructure) Then oOccurrence.Visible = False Else oOccurrence.Visible = True End If Next 'Sets the view rep back to the one that was active before the rule was executed oActiveViewRep.Activate
Steve Hilvers
Inventor Certified User / Vault Professional Influencer
Inventor Certified User / Vault Professional Influencer