Message 1 of 3
Change visibility for Surfaces in an Assembly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Not sure what I'm doing wrong or if it is a bug but if I could get some help I would appreciate it. I have and Assembly with some Sub-Assemblies in it. In those Sub-Assemblies are some parts with surfaces that where from copying other parts into it. We use those copied in surfaces to do a sculpt but it leaves the surface visible. I have tried numerous ways to try and turn off the visibility but nothing I try seems to work. Does anyone have an idea of what I am doing wrong here.
Sub Main()
Dim oAsm = ThisDoc.Document
Dim oAsmDef As ComponentDefinition = oAsm.ComponentDefinition
HideCompositeSurfaces(oAsmDef, "Carriage Base:1")
End Sub
Sub HideCompositeSurfaces(oAsmDef As ComponentDefinition, targetName As String)
Dim target As ComponentOccurrence = Nothing
Dim oLeafOccs As ComponentOccurrencesEnumerator = oAsmDef.Occurrences.AllLeafOccurrences
Dim oOcc As ComponentOccurrence
For Each oOcc In oLeafOccs
If oOcc.Name = targetName Then
target = oOcc
End If
Next
Dim oContainingOccurrence As ComponentOccurrence = target.ContainingOccurrence
Dim oContainingOccurrenceDef As ComponentDefinition = oContainingOccurrence.Definition
For Each oWorkSurface In target.Definition.WorkSurfaces
' Dim oWorkSurfaceProxy As WorkSurfaceProxy = Nothing
' oContainingOccurrence.CreateGeometryProxy(oWorkSurface, oWorkSurfaceProxy)
oWorkSurface.Visible = False
Next
End Sub