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:
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:
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
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,
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
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
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.
we covered the colour table attachment in previous post
then save settings keyin is FILE DESIGN again add this to your batch process script..
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.