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

RE: ILocateCommandEvents abruptly exiting subroutine

$
0
0

I don't see anything wrong with your code.  It looks similar to the examples in VBA help.  I have rewritten it to clarify the workings and reduce the number of casts...

Private Sub ILocateCommandEvents_Accept(ByVal ele As Element, pnt As Point3d, ByVal vw As View)
  Debug.Assert ele.IsCellElement
  Dim oCell As CellElement
  Set oCell = ele.AsCellElement
  oCell.ResetElementEnumeration
     
  Do While oCell.MoveToNextElement(True)
    Dim oComponent As Element
    Set oComponent = oCell.CopyCurrentElement
    If oComponent.IsTextNodeElement Then
      Dim oNode As TextNodeElement
      Set oNode = oComponent.AsTextNodeElement
      Debug.Print "Replace text node line 1 with '" & txt & "'"
      oNode.textLine(1) = txt ' Global variable
      oCell.ReplaceCurrentElement oNode
    End If
  Loop
  oCell.Rewrite
End Sub


Viewing all articles
Browse latest Browse all 7260

Trending Articles



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