Batch process- Are these steps possible to do using batch process?

Hi forum,

I have a somewhat overwhelming task infront of me, and was hoping for some help from the forum.

What i have is a set of files that originally came from PDMS. They came in a package of approximately 1000 dgnv7 files. Unfortunately the files do not have any level/ color structure.

I did batch convert the v7dgn files to v8d dgn. After converting the files to v8 the scale is wrong, so I need to fix that. (1meter slab in the V7 file, became 1000meters when converted to V8). At the same time I would like to do a few other things pr file, so I guess this is a good time to try to learn about batch processing and key-in script files. I have never used these tools before, so I am hoping somebody are able to help me out.

The files are basically a large ship that has been split in to 10 sections. Each section consist of around 100 dgn files that again are split on 10 different disciplines. (The file structure looks something like this: Section1-arch1.dgn, Section1-elec1.dgn, Section2-arch10 etc. The level in use has the brilliant name”Level1” for all of the 1000 dgn files…). So If there is a clever/ not to time-consuming way to do this I would like to take all the files for each discipline, and as a minimum, give them a separate color. And maybe also rename the level (Level1) into the name of the discipline it comes from(arc1 etc.), or in to the name of the specific dgn file (Section1-arch1) .

What I am thinking is I will probably have to brake this down in 2 steps, but have no idea how to do it.

My thought was maybe to use batch process to do this on all 1000 dgn files:

  1. Fix the scaling issue
  2. Remove the PDMS color table
  3. Attach my custom color table
  4. Remove all unused levels ( “Level1”, is the only level in use)
  5. Save settings

Then I would probably have to split the files in to 10 folders, one pr. discipline. And if possible run a batch process pr. folder to remap colors, and rename “Level1” to something that makes more sense. Here is an example for the Arc discipline, pr. file:

  1. Change color on all elements
  2. Rename “Level1” to “arch1”, or even better, rename “Level1” in to the exact same name as the specific dgn file “Section1-arch1”

Does anyone have a suggestion on how to do this using batch convert/process without involving programing? Any help would be much appreciated as at the moment I’m stuck already on nr 1-wrong scale… (Unless I fix it manually pr. file, using merge in to master on a blank file, and change the scale during the merge etc.)

-regards

helge

Parents
  • The CSV remapping  will most likely do 90 % of you colour and  level renaming and weights...

    I assume even though everything is on level 1  that they at least used different colours  for specific things which you could then remap as level names ie

    if bolts are always red then you could choose to CSV remap red to new level FASTNERS and weight 1 and this can be done as a batch conversion process too

    The reassigning a  colour table - easist way  is to  record a macro and and  do the steps by hand, then  you can run the  macro from the batch processor I would do that  first as it will change your colours of existing elements 

    You can reassign the  colour table with  ATTACH COLORTABLE  NEW TABLE NAME.TBL  

    IF the new colour table is not in the same path as the  active or default ones in Microstation  then you will need to have the  full file path and name and its better to use "    " incase they are spaces in the name...

    To remove unused levels just  use the  compress option and set it to delete unused levels once manually then there after this can also be  done in batch processor with keyin compress design

    the save settings keyin is  FILE DESIGN  again add this to your batch process script..

    The scale  issue  is a bit more complex can you upload an original untouched V7 file ie dont convert to v8...

    I think it may be a positional units or  just units issue, can you also post a copy  of your current  v8i see file for comparison..

    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 Lorys and Andrew,
    Thank you so much for the feedback. I prefere to use Microstation connect U1, but also have aces to Vi8 SS4. I used the macro recorder in connect and was able to record step 2 to 5, and it seems to work. Actually the macro recorder was really easy and fun to work with!-) But the global scaling issue I do not know how to record. The reason is that the only way I know how to rescale the complete dgn file is by using these steps; 1 Create a new blank dgn file with the same name as the one i want to rescale ( eks;Section1-elec1.dgn ) ( remember i have 1000 files, and they all have different names. So would need to do this pr. file. This step i am not able to record... ). 2.Attatch the file that is in wrong scale to the newly created blank file. While doing "merge in to master" there is an option to scale the attachment. i would set this to 1 to 1000, and the scale is then correct. ( So all files needs to be scaled 1 to 1000 in all directions. Then everything is correct. This is a unit ussue, and something i see often when converting v7 files to v8files. The problem is i cant find a way to change the unit/scale during the conversion to v8 )
    I wonder if these is any other way to rescale that is possible to put in to the batch script? so far i have not been able to find other ways to do a global rescale. Unfortunatly i am not allowed to upload these files, but the scale factor is the same on all files and as described here.
    I have not tried the CSV remap yet, so there might be some more questions when i get there. There is only one color for all files in the complete set... That is why i was thinking of splitting the files in to folders pr diesiplines, and try to have a separate color pr diesipline.
    Thanks for all support so far, it really helps
  • Hi Lorys,

    I uploaded 2 dgn files. One v7 and one v8. The resolution is 100 in the v8 file. If i set it to 100000 the scale is correct. Unfortunatly it did not work out just recording a macro of the steps to change the resolution to 100000 and run it as a script. I guess that would have been to simple... You told me to also uppload a v8i seedfile? Im not avare of using any spesific seed file when converting from v7 to v8. If im using a seed file ( that i can not see from the v8 save settings ) i guess it is probably the standard 3d metric seedfile delivered from bentley.

    Do you have any idea how i could rescale/thange resolution using batch convert/process?

    Thanks

    Helge

    107136.dgn107136.dgn

  • Unknown said:
    I uploaded 2 dgn files. One v7 and one v8 ...

    107136.dgn  107136.dgn

    Two files having the same name?  It would have been helpful to label those files so we could tell which is which.  For example, 107136-V7.dgn and 107136-V8.dgn.

     
    Regards, Jon Summers
    LA Solutions

  • Hi Jon.

    Two files having the same name? It would have been helpful to label those files so we could tell which is which. For example, 107136-V7.dgn and 107136-V8.dgn.

    Ill remeber that for next time, thanks.
    I have one more problem with the V8 file. The file has some colortable attached to it. What i wanted to do was to remove it, and attache another colortable. I am able to do that but the new colortable will not stick. Meaning when i reopen the dgn file the old colortable is basck ( the one i removed ). I simply used detach and attach in the colortable menu to do this, and i also tried the same with key-ins. Do you know if there is a setting that might cause this?
    Regards
    Helge
  • Unknown said:
    What I wanted to do was to remove it, and attach another colortable. I am able to do that but the new colortable will not stick

    Did you Save Settings after attaching the new table?  Ctrl-F or File Design or menu File|Save Settings.

    By the way, you've hijacked your own thread.  Changing the colour table is way off the original topic of batch files.  Prefer to start a new thread for a new question.

     
    Regards, Jon Summers
    LA Solutions

  • we covered the  colour table attachment  in previous post

    You can reassign the  colour table with  ATTACH COLORTABLE  NEW TABLE NAME.TBL  

    IF the new colour table is not in the same path as the  active or default ones in Microstation  then you will need to have the  full file path and name and its better to use "    " incase they are spaces in the name...

    then save settings keyin is  FILE DESIGN  again add this to your batch process script..

    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
  • we covered the  colour table attachment  in previous post

    You can reassign the  colour table with  ATTACH COLORTABLE  NEW TABLE NAME.TBL  

    IF the new colour table is not in the same path as the  active or default ones in Microstation  then you will need to have the  full file path and name and its better to use "    " incase they are spaces in the name...

    then save settings keyin is  FILE DESIGN  again add this to your batch process script..

    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
  • Attaching a batch script which could help for rescaling v7 files(resolution 1000) to v8 DGN with resolution 10000.

    Script checks file resolution so won't scale file if resolution is already 10000.

    #----------------------------------------------------------------------
    #
    #  Command file for batchprocess utility
    #
    #  This command file was originally copied from $(MS_DATA)cmdfiletemplate.txt.
    #  Command file information:
    #       - Lines that start with the '#' character are treated as comments and ignored.
    #       - Max Line length 256
    #----------------------------------------------------------------------
    
    #SET UORSPERSTORAGEUNIT <resolution> 'doesn't work
    #vba run [ScaleFiles]ScaleFileCode 1000 Meter Meter Millimeters
    raster detach all
    reference detach all
    
    level set display on file:all all
    set levels on all;selview all
    
    
    place fence active;point absolute
    lock fence overlap
    vba execute if ActiveModelReference.UORsPerStorageUnit = 1000 then CadInputQueue.SendCommand "scale icon;set item toolsettings usefencetoggle=1;set item toolsettings actvxscale=10;set item toolsettings actvyscale=10"
    #;set item toolsettings proportionaltoggle=1"
    
    point absolute 
    vba execute ActiveModelReference.UORsPerStorageUnit = 10000
    
    
    place fence active;point absolute
    change linestyle scale 1;set item toolsettings usefencetoggle=1;point absolute
    
    view off all;view on 1
    fit view extended
    filedesign
    
    

    Answer Verified By: helgeh 

  • Unknown said:
    We covered the  colour table attachment  in previous post

    So you did!  But that didn't stop helgeh asking the same question again ...

    Unknown said:
    Attaching a batch script which could help for rescaling

    Good post!  I like the use of one-line VBA statements to perform logical operations that otherwise you can't do in a batch script.

     
    Regards, Jon Summers
    LA Solutions

  • Unknown said:
    Attaching a batch script which could help for rescaling

    Good post!  I like the use of one-line VBA statements to perform logical operations that otherwise you can't do in a batch script.

     
    Regards, Jon Summers
    LA Solutions

  • Had to use VBA as hidden key-in "SET UORSPERSTORAGEUNIT <resolution>" doesn't work.
  • Hi!
    Thanks for all the help, I really could not have done this without you!
    About attaching a new colortable, i can not get it working on these files, but i will make a new thread for that.
    -Helge