Split levels in to separate dgn ( or dwg) files?

I have a dgn file with many (200) levels, that i need to split in to one single dgn file pr level. Would that be possible to do in plane microstation ?

  • From what it sounds like you are describing, you could create a "script file" that starts with a list of all the levels and then adds in steps to isolate each level and (using a fence) save that out. Something like this:

    active level "text"
    of=*
    selview 1
    place fence allfiles
    selview 1
    fit view extended 1
    ff="textDGN"
    selview 1
    on=*
    selview 1

    The above example sequence assumes the level (text) has something on it and uses view one throughout the sequence. You can use that as the "template" for your specific file, which you would need to iterate for each level. You would also need to determine what each filename is that you want to create -- "textDGN" is just an example here... that gets saved to MS_DEF. Further, you can concatenate all that into one statement (each "command" separated by a semi-colon):

    active level "text";of=*;selview 1;place fence allfiles;selview 1;fit view extended 1;ff="textDGN";selview 1;on=*;selview 1

      

    Answer Verified By: helgeh 

  • First off  run the compress function from File > compress> options select all then run compress design

    This will help get rid of unused levels

    now from the level manager > export 

    This will give you a csv table you can manipulate to extract all the level names

    you can then use this to create the above script  mentioned by phil earlier post,  over and  over  using excel to  change which level is on next and what to call the new file

    then export this out as a  script file..then run the script

    but personally I would  just use the level manager by hand to scroll through the lelves and  level display manager to turn all off . set first level  on, then

    us this keyin

     fit view extended;%d; place fence design;%d;sf=    

    ( which I would  add to an F key say F1  just for this job... put back to help latter or make  a new F key menu and edit  that)

    Then once I have the right level on, run the F key use the  levelname thats on to name the export and save out  the contents

    ( SF=  removes all in fence to new file where FF just copies contents)

    Then delete the level from levelmanager

    and make the next level  on and repeat the F key to extract the data and repeat the process

    If I had to do this for many files then yes I write a script for each one using the extracted level names...

    Even with 200 level names I think I could do faster manually for one file and  F key rather than writing the script for one file...

    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 

  • Hi, and thanks for all your the help so far, I really appreciate it.
    I am new to microstation and still a bit stuck im afraid. If I try Lorys approach with the key in he sent (copy paste from how it was written by Lorys) (fit view extended;%d; place fence design;%d;sf= ) , and then (ff=) I get this message NO FENCE DEFINED. So I am wondering if I am doing something wrong or if it is something with the first key in. I do not see any fence, am I supposed. Regarding Phils script file approach I think I understand what to write in the template file, but I have not used a script file before. Im am just guessing now, but Is that just a .txt file that I save and insert somewhere in microstation and run it. If so, where do I run it from. I tried to search the forum for more info about script files, but have not yet been able to find much.
    Regards
    Helge
  • Regarding the script file, yes, that is an ASCII text file. I have used a technique before where you populate an Excel spreadsheet and copy-and-paste between that and an ASCII text file and you end up with the end result that you can start within MicroStation by adding an @ symbol in front of the file. If you would like some help, copy the levels in your file over to an Excel spreadsheet and attach that to a reply (click the Advanced Reply Editor link for information on how to do that).

      

  • Hi Phil, that was quick!=) I don't want to take to much of your time, and do not have access to the project from home. But if you could show me on the small sample I sent you ( layer 1 to 4), then I could try it out myself and on the project tomorrow. I will also need to know where I run it from in microstation, is it in the key in browser. Thanks!

    LEVEL1-4test.xlsx