A bug in VBA when editing a textnode inside a nested cell. Microstation CE version 10.15.00.74

 I noticed that when I perform a VBA edit of a textnode inside a nested cell, the application gives the textnode a new ID, but much to my chagrin does NOT inform the database. This means if I’m holding a reference to that element in a variable, I lose the handle as the original textnode no longer exists. Even worse when you use the function “ActiveModelReference.GetLastValidGraphicalElement” it doesn’t see the newly created element. Uggghhhh!!!!

The only solution I found was to iterate through the nested cell and grab the element with the highest ID to regain the handle. To reiterate this error only occurs in nested cells (cell within a cell) not standard cells. Has the bug been reported already? 

I  have written code to un-nest these cells, but I'm always wary of making unnecessary edits to elements. Have others encountered this? 

  • I noticed that when I perform a VBA edit of a textnode inside a nested cell, the application gives the textnode a new ID

    Without seeing your code, it's hard to diagnose the problem.

    Why should your application assign a new element ID?  It's MicroStation that assigns IDs: as far as we programmers are concerned the element ID is a read-only field.

     
    Regards, Jon Summers
    LA Solutions

  • I didn’t post code because it wasn’t code specific it seem to happen with any type of change to a textnode inside nested cells. I agree why would the MICROSTATION application (not my VBA application) do this?
     
    At any rate upon writing some simple code to share, and running on a clean file I can’t duplicate this error. Maybe it had something to do with text that was converted from AutoCAD in specific files. I did have issues with files the had AutoCAD specific UserAttributeData. When those linkages were removed everything proceeded as normal. I guess I jumped the gun assuming this problem occurred in every file. I will have to reevaluate the root cause. Sorry for the errant post.