convert positioned jpgs to jpgs+worldfile or hgr with batch convert

Hi.

I`m having a serious problem when converting raster files with the raster manager's "batch convert" tool.

 I´ve a number of .jpg images possitioned in the model space, the number varis betwen dgn files, is about 5 to 75 raster files per dgn.

 Once georeferenced,  I need to export them to .cot or preferably to .jpg with .hgr file.

 When saving each file individually;  doing file>save as> imagename.cot or imagename.jpg+hgr file, it exports the file correctly. In the case of the .cot, it adds the position, scale and rotation in the header an in the case of teh jpg writes correctly the hgr file.

 BUT, heres comes my problem, after a batch convert processing,  when importing back the generated files to the raster manager, they appear in an incorrect position, VERY far from where they should be.

Even stranger is the fact that some times it has worked during the testing process.  

 I'm getting crazy with this problem, and soon I'll get quite  in a hurry seeing drafters lose time saving files individually.

 Please, give me a hand with this.

 Bye.

 

Parents
  • I have a Macro that can save all the images attached to a design file using "Save As" key-ins. I will attach it to this message and you can see if it does what you are looking for. Right now, it saves the raster attachments of a design file to JPG format. You will probably need to edit the output directory in the Macro (currently set to D:\Temp\Output\), ask me if you need help.

     

    Also, before you use the Macro, you will have to do the following steps to ensure that the sister files are created properly during the export.

     1) Go to MicroStation's "Workspace" menu and click on "Preferences...".  In the "Category" list, choose "Raster Manager" and then go to the "Georeference" tab.  Make sure that "Save Location Info in Sister File if Required" is checked.

    2)  Go to MicroStation's "Workspace" menu and click on "Configuration...".  Fing the configuration named "MS_RASTER_DEFAULTSISTER", set its value to 0 or 1 if you want HGR or to 2 if you want WorlFiles.

    3) Restart MicroStation and try the Macro.

     

    Another "trick" to work around this problem would be to do the 3 steps mentioned above. Then, open the Raster Manager dialog box and set the "Read-Only" toggle of all attached rasters OFF and back ON. This will create sister files for all the attached raster files.  Once the sister files are created, the Raster Convert should work as you expect it too. 


     This is a test

    RasterSaveAs.mvba
  • Hi Pascal,

    You, are, my, hero,_ 

     Days ago I tried  Setting the files in "writable" and convert them to other format. Some times did work and some didnt. Very strange.

     I didnt knkow it automatically did generate the sister file. May be I deleted them thinking it whas a kind of temp file, who knows.

     It works GREAT!!!

    As far as my incoming files are in JPG and the outgoint files ar in JPG+HGR (now it generates worldfiles *.jgw), I dont need to generate new image files, something that really saves much time!.  It generates the *.jgw file in the same directory as the origin image wich is as much as I needed.

     THANK YOU!

    I'll also try your macro wich seems to be very usefull.

     And now, please, let me say that the batch convert combo tool should convert, at least for the files added using the conbo + "add current drawing files" option, (...) should convert the files wich the in model space coords, as it does the "save as".

    I´ll try the macro anyway, may be I need to convert them to cot or who knows...

     thanks thanks thanks !!!!!!

Reply
  • Hi Pascal,

    You, are, my, hero,_ 

     Days ago I tried  Setting the files in "writable" and convert them to other format. Some times did work and some didnt. Very strange.

     I didnt knkow it automatically did generate the sister file. May be I deleted them thinking it whas a kind of temp file, who knows.

     It works GREAT!!!

    As far as my incoming files are in JPG and the outgoint files ar in JPG+HGR (now it generates worldfiles *.jgw), I dont need to generate new image files, something that really saves much time!.  It generates the *.jgw file in the same directory as the origin image wich is as much as I needed.

     THANK YOU!

    I'll also try your macro wich seems to be very usefull.

     And now, please, let me say that the batch convert combo tool should convert, at least for the files added using the conbo + "add current drawing files" option, (...) should convert the files wich the in model space coords, as it does the "save as".

    I´ll try the macro anyway, may be I need to convert them to cot or who knows...

     thanks thanks thanks !!!!!!

Children
No Data