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

RE: ILocateCommandEvents abruptly exiting subroutine

$
0
0

[quote user="Darin Rodberg"]The textnode has 1 TextLine[/quote]

I tried your code on a standalone text node, and it works OK.  I think the problem may be that the node is inside a cell.  You may need to do something like this...

Do While oCell.MoveToNextElement(True)
    Dim oComponent As Element
    Set oComponent = oCell.CopyCurrentElement
    If oComponent.IsTextNodeElement Then
      Dim oNode As TextNodeElement
      '  Make a copy of the TextNodeElement
      Set oNode = oComponent.AsTextNodeElement.Clone
      Debug.Print "Replace text node line 1 with '" & txt & "'"
      oNode.textLine(1) = txt ' Global variable
      oCell.ReplaceCurrentElement oNode
    End If
  Loop


Viewing all articles
Browse latest Browse all 7260

Trending Articles



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