Update node text

Hi! I'm updating some text from excel to Microstation. Until now I'd been able to update Text and Tags, but I have problems with Text nodes, here is my code:

If myWS.Cells(FileRow, 2) = "NODE" Then
Set myNode = myDGN.GetElementByID(myID)     'Store ID High and Low
myNode.TextLine(1) = myWS.Cells(FileRow, 4)    'Store new Textnode Value
myNode.Rewrite                                                            'Write TextNode
End If

The error is "Run time error -69652(ffeefec) at the line three. I have been looking for information regarding the text nodes, but I can't find something similar, even in the help files.

Thanks!

Parents
  • Hi Romaca,

    I use the below snippet to test TextNodeElement.TextLine(1), all work fine.

    Sub Macro1()
    Dim myNode As TextNodeElement
    Set myNode = ActiveModelReference.GetElementByID(DLongFromLong(2341))
    myNode.TextLine(1) = "New Textnode Value"
    myNode.Rewrite
    End Sub

    So I guess maybe your myWS.Cells(FileRow, 4) 's type is not a string. Trying

    myNode.TextLine(1) = CStr(myWS.Cells(FileRow, 4))

    HTH,

    Yongan



  • Trouble with TextNodeElement

    Unknown said:

    If you look at this thread trouble with TextNodeElements, you will find that others have had problems with the TextNodeElement and VBA in the context of a CellElement that contains a TextNodeElement. According to their evidence, the problem occurs with V8i and not previous versions of MicroStation.

     
    Regards, Jon Summers
    LA Solutions

  • Dea Jon,

     Is there a work around to this ?

     "as luck would have it"  I run into the same problem on Friday. My text node is part of a cell I didnot/cannot create the cell. I just need to change thte contents of the single line of the text node.

     Making any changes tot eh text node fails. Geting a new object based on the element id and then editing it also fails when the text node changes.

    I have texted with V8i and V8i Beta 2 both have the same issue.

    Best Regards,

    Ian Emery

  • Unknown said:
    Is there a work around to this ?

    The other thread discussed this problem in the context of TextNodeElements in a cell. Apparently a TR was raised — maybe you can ask him for the number. File your own Service Request tied to that TR number: the more SRs there are linked to a TR, the higher its profile (one hopes).

     
    Regards, Jon Summers
    LA Solutions

Reply Children
No Data