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

ILocateCommandEvents abruptly exiting subroutine

$
0
0

Hi all. I'm working on an implementation of ILocateCommandEvents and I've encountered a problem where every time I try to modify a textnode contained within a cell, it abruptly exits the subroutine. I've been messing with it for hours now, and I can't seem to make any headway. Below is the code of the sub that keeps exiting.

Private Sub ILocateCommandEvents_Accept(ByVal ele As Element, pnt As Point3d, ByVal vw As View)
    
    ele.AsCellElement.ResetElementEnumeration
    
    Do While ele.AsCellElement.MoveToNextElement(True)
        Dim te As Element
        Set te = ele.AsCellElement.CopyCurrentElement
        If te.IsTextNodeElement Then
            te.AsTextNodeElement.textLine(1) = txt
            ele.AsCellElement.ReplaceCurrentElement te
        End If
    Loop
    ele.Redraw
    ele.Rewrite
End Sub

txt is defined elsewhere in the code, but I checked it with a debug.print (txt) call and it's there. What happens when I step through the code is that I get to the line te.AsTextNodeElement.textLine(1) = txt and it just abruptly exits the sub and goes back to the listening phase.

Viewing all articles
Browse latest Browse all 7260

Trending Articles



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