Changing text content and element class by batch processing?

Hi,
I try to change a couple of texts an data fields by batch processing and if possible also change the element class for these texts from construction to primary.
Changing text and data fields works well with this batch command:

MDL SILENTLOAD FINDREPLACETEXT,CHNGTXT CHANGE DIALOGTEXT

FIND DIALOG SEARCHSTRING [old text]
FIND DIALOG REPLACESTRING [new text]
CHANGE TEXT ALLFILTERED

but I could not change the class in any way... :(

Is there a possibility to to that?

I tried also to do it by a macro.
The rename part works well again, but not the part for the element class :(

The additional code (red) for the class changing seems not to work

Sub main
Dim startPoint As MbePoint
Dim point As MbePoint, point2 As MbePoint
' Start a command
MbeSendCommand "MDL KEYIN FINDREPLACETEXT,CHNGTXT CHANGE DIALOGTEXT"
' Send a keyin that can be a command string
MbeSendKeyin "FIND DIALOG PAN True"
MbeSendKeyin "FIND DIALOG ZOOM True"
MbeSendKeyin "FIND DIALOG ZOOMLEVEL 14"
MbeSendKeyin "FIND DIALOG SEARCHSTRING "
MbeSendKeyin "FIND DIALOG SEARCHSTRING old Text"
MbeSendKeyin "FIND DIALOG REPLACESTRING new Text"
MbeSendKeyin "CHANGE TEXT ALLFILTERED"

MbeSendKeyin "FIND DIALOG SEARCHSTRING "
MbeSendKeyin "FIND DIALOG SEARCHSTRING new Text"
MbeSendCommand "ACTIVE CLASS PRIMARY "
MbeSendCommand "CHANGE CLASS "

End Sub


I have to change the content and class for 10 textes (always the same) on a lot of drawings.....
perhaps another idea to do that?

Thanks alot
Regards

Parents
  • I have to change the content and class for 10 texts

    Unfortunately MicroStation's Text Replace dialog doesn't capture the text element.  If it did, you could set its class.  There are other issues with the Text Replace tool in V8i, which is why we wrote a VBA project that does a better job...

    VBA Project: Search and Replace Text

    VBA Text Replace tool

    This tool gives you better control over where it looks to find text.  It also implements a better version of regular expressions than is available in V8i.  But you're probable not interested in those bells & whistles.

    VBA Source Code Included

    What you will find interesting is the source code, which is embedded in the VBA project.  You can adapt that to your requirements.  Look for the code behind the Execute button.  That scans your DGN model for various types of element.  You can add a line of VBA to modify the TextElement.Class property.

    Batch Processing

    You'll need to add your own code for iterating a folder of DGN files, then executing text search for each DGN model. Look in this example project for code that builds a list of DGN files.

     
    Regards, Jon Summers
    LA Solutions

  • Hi Jon,
    Of course, I am interested in such goodies... :)
    But ...., when it comes to self-programming ...., thats not my cup of tea and I'm afraid I'll have to pass.
    And while buying such tools, unfortunately, my hands are tied. A disadvantage if you work in a large company and the communication is very difficult.

    That's why I'm very grateful to you and everyone else for all the help I can get.

    Your tool seems to be nice, but I can not solve my problem with it because I am not able to adapt it to my purpose :(

    If I understand correctly, there seems to be no easy way to solve my problem with a standard macro (keyin commands)?

    Thanks
    Regards, Raphael

  • And while buying such tools, unfortunately, my hands are tied

    You don't have to buy anything: the VBA projects mentioned above are all freeware: gratis, no-cost, kostenlos!

    I can not solve my problem with it because I am not able to adapt it to my purpose

    You posted your question to the Programming Forum, so I assumed that you were prepared for some VBA action!  Try posting your question to the MicroStation Forum, where somebody with batch processing experience may have an answer for you.

     
    Regards, Jon Summers
    LA Solutions

  • Jon, yes I know that "this" tool is freeware :)

    Sorry for having posting in the wrong Forum.
    I have not realized that this Forum is just for "real" programming and that Batch and Macro are not considered as such.
    Thoughts of a layman.

    I will try it in the Microstation Forum
    Thanks
    Regards, Raphael

Reply Children
No Data