- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
By the way, here is another route for controlling the visibility of SurfaceBody geometry within a drawing view of a multi-body part. This simple example uses a property of the DrawingView object called DrawingCurves, which will retrieve all view geometry for the model reference you input into it. Then you can loop through the contents of that collection of geometry to turn the visibility of the geometry off. This example is just getting the first view on the active sheet of the drawing, then attempting to get the third body in the part, but you can change any of that as needed.
Dim oDDoc As DrawingDocument = ThisDoc.Document
Dim oView As DrawingView = oDDoc.ActiveSheet.DrawingViews.Item(1)
Dim oModel As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument
If oModel.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
Dim oPDoc As PartDocument = oModel
If oPDoc.ComponentDefinition.HasMultipleSolidBodies = False Then Exit Sub
Dim oBodies As SurfaceBodies = oPDoc.ComponentDefinition.SurfaceBodies
Dim oBody3 As SurfaceBody = oBodies.Item(3)
Dim oBodyGeomInView As DrawingCurvesEnumerator = oView.DrawingCurves(oBody3)
If oBodyGeomInView.Count = 0 Then Exit Sub
For Each oDC As DrawingCurve In oBodyGeomInView
For Each oDCS As DrawingCurveSegment In oDC.Segments
oDCS.Visible = False
Next
Next
End If
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS)
.
Wesley Crihfield
(Not an Autodesk Employee)