Level Renaming Macro

Anonymous
Anonymous

Hello everyone!

I have a small problem with using VBA in Mictostation V8i. 

I have been using Microstation for the last year and have only now started to really get into the complexities of it.  I have just dived into the world of Visual Basic in Microstation, having a reasonable backround with Lisp Routines and Macros in AutoCAD.  I am finding it extremly confusing!

On top of this then, to comply with the newest version of our CAD procedure, I need to put a Suffix and Prefix on each and every Level in every drawing we upload, along with replacing all instance of underscores _ with dashes - 

So a Level Named Concrete_25 will be changed to BCS-CV-Concrete-25-C-E

I have written 2 lisps and a Macro in AutoCAD to do this - but I have no idea how to do it in Microstation.

Can anyone help me write a routine to do this?

Parents
  • You can do this in a vba but, the easiest method to do this is with a keyin. If you are doing this to multiple file then use a "Key-in Scripts" and "Batch Process utility".

    LEVEL CREATE <level_name> [level_number]

    Create a new level with name “level_name”. Optionally, the level-number of the new level can be specified with “level-number”.

     

    LEVEL PURGE dest:[level-spec2] <level-spec1>

    Force deletes specified “level-spec1”. If the level has any elements, then all the elements are moved to specified “level-spec2”. The destination level specification is optional. If it is not specified, then any elements of the level to be purged are moved to the “Default” level.

    All the infromation is in MS help. Roland

     

    Roland

    V8i SS4 v.08.11.09,829
    AECOsim BD V8i

     

  • try save as v8 with csv and batch processor much easier as can export v8 to v8 with remapping levels.via the csv option..

    Lorys

    Started msnt work 1990 - Retired  Nov 2022 ( oh boy am I old )

    But was long time user V8iss10 (8.11.09.919) dabbler CE  update 16 (10.16.00.80) 

    MicroStation user since 1990 Melbourne Australia.
    click link to PM me 

Reply
  • try save as v8 with csv and batch processor much easier as can export v8 to v8 with remapping levels.via the csv option..

    Lorys

    Started msnt work 1990 - Retired  Nov 2022 ( oh boy am I old )

    But was long time user V8iss10 (8.11.09.919) dabbler CE  update 16 (10.16.00.80) 

    MicroStation user since 1990 Melbourne Australia.
    click link to PM me 

Children
  • Anonymous
    Anonymous in reply to Lorys

    Thank you both very much for your replies.

    Roland - I don't really understand your reply, I am relatively Microstation VBA and its terms.

    Lorys - I had just applied your solution as you poseted it and it works really well.   I have managed to use the Batch Converter tool along with a spreadsheet with a huge list of levels to catch all the incorrectly named levels in my drawings, and this works on 90% of the levels that I am dealing with.

    I have also had a wee look at Key In scripts and believe that these would provide a more streamlined solution, but as this is the VBA forum I will ask elsewhere.

    Thanks again