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.