Hi
I'm really new to VBA and haven't really gotten a grip of how it works. I've managed to write some VBA-code for placing text by coordinates.
Set oText = CreateTextElement1(Nothing, ooDate, point_text_Date, Matrix3dIdentity)ActiveModelReference.AddElement oText
But now I would like to edit that text, and I have no clue how to. I've searched a lot after "edit text VBA microstation" and most answers is for when you need to search for some text, and replace it if found.
What I'm not really sure of is if I can select text in a particular coordinate by VBA, and then replace it by some text. Is there a command for selecting elements?
I've also seen a lot about the element enumerator in these cases. Could that be used for coordinates as well?
Would it make a difference if that text was inside a cell?
Running Openbuildigs, connect, update 5.
Regards,
Robert
Robert Högberg said: I would like to edit that text, and I have no clue how
Robert Högberg said:I've also seen a lot about the element enumerator in these cases
Here's an article about Text Search and Replace with MicroStation VBA.
The VBA project you can download from that link is not locked: it includes the source code. It shows how to use the Model.Scan method to make an ElementEnumerator of text elements. It shows how to find text elements inside cell instances. It shows how to find text elements inside text nodes. It shows how to find text in tags, even though — from the programmer's point of view — tag elements aren't text elements!
Model.Scan
ElementEnumerator
Regards, Jon Summers LA Solutions
Thank you. I'll have a look at that!