Convert DWG blocks to DGB Cell Library

Is there a way to convert a Civil3D DWG file with multiple blocks all in one model to a dgn cell library with a separate model from each block? I'm looking for a way to convert a DWG block file to dgn cell library.

Parents
  • KeyIn:

    export cells shared c:\folder\filename.cel

    Ivo Blaauw
    = = = = = = = = = = = = =
    Look what the CAD dragged in...

    Answer Verified By: Josh M 

  • Thank you.  I had a chance to try your suggestion.  It works, but I have a couple questions:

    •  Can I specify a seed file, or where does it get its Design File Settings from for the new .cel file?
    • My test run created a design model for each cell.  The model opens with four views (top, top, top, top).  Is there a key-in(s) to have it open only View 1 (top) and with the model zoomed to Fit Extents?
    • Is there a way to write a batch process command file using this “EXPORT CELLS SHARED d:\test.cel” to automatically name the test.cel from the active dgn’s name?  I want to do this in batch to convert several DWG block files into cel files – each dwg file separately into a similarly-named cel file – not all dwgs into one cel file.  In other words, if my active file is named test.dwg I want to export to test.cel in the same folder.
  • OK, I think I have it.

    You want to export the shared cells out of a DWG file into a cell library that will have the name of the DWG file - without having to manually name it, so that you can run that as a batch process. That way, each DWG will generate its own cell library with the same name, and you can get them all done in one pass?

    Hmmm. I'll try to look into that. I'm not the most experienced with batches and scripting, so hopefully someone with more knowledge will be along shortly.

    MaryB

    Power GeoPak 08.11.09.918
    Power InRoads 08.11.09.918
    OpenRoads Designer 2021 R2

        

  • Yes.  That's exactly what I am trying to do.  Thanks for looking.

  • I haven't checked it (not in MicroStation today) but you might be able to make use of the $(basename(_DGNFILE)) as shown here as part of your Export...keyin. As in

    export cells shared c:\Cells\$(basename(_DGNFILE)).cel

    Again, I haven't tried it. You can try the keyin on one file to see if it works. If it does, that would be your keyin for your batch process.

    MaryB

    Power GeoPak 08.11.09.918
    Power InRoads 08.11.09.918
    OpenRoads Designer 2021 R2

        

    Answer Verified By: Josh M 

  • You might  also be able to use the keyin 

    expand set MS_DESIGNSEED = fullpath and filename for your desired seed

    before you use the export... keyin.
    It could be another configuration variable - I pulled that from memory and it's probably wrong...But you may be able t find out which variable you want by looking at your configuration variables and seeing what they use for cell seeds, if there is such a thing.

    MaryB

    Power GeoPak 08.11.09.918
    Power InRoads 08.11.09.918
    OpenRoads Designer 2021 R2

        

  • Thank you.  I got it to work using:

    $ export cells shared "F:\Home\PW\CAD\...Insert rest of path here...\$(basename(_DGNFILE)).cel"

    This should work well since the output path of my .cel files is the same for all dwg files that will be processed.

    The trick I missed was the $ at the beginning of the command line, which is explained in the link you included.

    It worked on a single file as a key-in, so it should work as a Batch Process Command File. 

    Answer Verified By: Josh M 

Reply
  • Thank you.  I got it to work using:

    $ export cells shared "F:\Home\PW\CAD\...Insert rest of path here...\$(basename(_DGNFILE)).cel"

    This should work well since the output path of my .cel files is the same for all dwg files that will be processed.

    The trick I missed was the $ at the beginning of the command line, which is explained in the link you included.

    It worked on a single file as a key-in, so it should work as a Batch Process Command File. 

    Answer Verified By: Josh M 

Children