Message 1 of 4
How to distinguish between curvloop face and curvloop opening?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
I get curveloops from wall reference by next function:
Function GetCrvls(doc As Document, refer As Reference) As List(Of CurveLoop)
Dim lcrvs As New List(Of CurveLoop)
Dim elem As Element = doc.GetElement(refer.ElementId)
Dim opt As Options = New Options
opt.ComputeReferences = True
opt.View = doc.ActiveView
Dim geoElem As GeometryElement = elem.Geometry(opt)
Dim stableRefString As String = refer.ConvertToStableRepresentation(doc)
For Each gObj As GeometryObject In geoElem
Dim solid As Solid = TryCast(gObj, Solid)
If (Not (solid) Is Nothing) Then
For Each f As Face In solid.Faces
Dim r As Reference = f.Reference
If (r Is Nothing) Then
Continue For
End If
Dim j As Integer = 0
If r.ConvertToStableRepresentation(doc).Equals(stableRefString) Then
For Each crvl As CurveLoop In f.GetEdgesAsCurveLoops
lcrvs.Add(crvl)
Next
End If
Next
End If
Next
Return lcrvs
End Function
Always before that I got a curvloop in the zero element of the list that repeated the outer contour of the reference, and in all the rest - curvloops of openings. But now I am faced with the fact that the reference outline is not zero in the list. Can someone tell me how to find a curvloop that follows the outline of the reference?