Quantcast
Channel: MicroStation Programming - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1677

Re: [v8i SS2] Boundary of a TextNode Element

$
0
0

I have one last question on this thread.
Below code

Set oLevel = ActiveDesignFile.Levels("EQUIPMENT-LABEL")
   
    Dim oScanCriteria       As New ElementScanCriteria
    Dim oEnumerator         As ElementEnumerator

    oScanCriteria.ExcludeAllTypes
    oScanCriteria.ExcludeAllLevels
    oScanCriteria.IncludeType msdElementTypeTextNode
    oScanCriteria.IncludeLevel oLevel

    Set oEnumerator = ActiveModelReference.Scan(oScanCriteria)
   
    While oEnumerator.MoveNext
        Set oTextNodeElement = oEnumerator.Current      
        If ExtractBoundary(oPoints, oEnumerator.Current.AsTextNodeElement) Then
            DrawRectangle oPoints, msdDrawingModeTemporary
        End If
    Wend

    Function ExtractBoundary(ByRef points() As Point3d, ByVal oTextNodeElement As TextNodeElement) As Boolean
             oBounds = Range3dInit
             Set oEnumerator = oEnumerator.Current.AsTextNodeElement.GetSubElements
            While oEnumerator.MoveNext
                        oBounds = Range3dUnion(oBounds, oEnumerator.Current.AsTextElement.Boundary)
            Wend
    End Function

This 2nd red loop lines will only scan the Sub Elements of the current textNode right?
So the first red loop lines will scan all the text node elements under EQUIPMENT-LABEL level.

Now can you tell me what is wrong? It won't scan all the textNode elements, instead it will just get the first textNode element and enclosed it in a rectangle.


Viewing all articles
Browse latest Browse all 1677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>