Hi All,
Firstly, I am a VBA (very) newbie. I would like, every time a design file is closed, to set all compress options "on" (ticked) and then run "Compress". The files that I need this to happen on lives in Projectwise and needs to be done without any user input.
Any help would be greatly appreciated.
Hi Dewald,
to compress a design file when it is closed can be done without any VBA code and if something can be done without coding, it should be done without coding (of course exceptions exist). Especially in MicroStation that provides extreme flexibility and powerfull configuration options the configuration should be the first choice.
To set what compress options are on and off by default, configuration variable MS_COMPRESS_OPTIONS can be used. So you can set MS_COMPRESS_OPTIONS=+SPACE_TEXT;+RENDER_SETUP etc. to switch all compress options on. If using ProjectWise, I guess you can do it for all your MicroStation installations using some site or company cfg easily.
The second step is to switch on Preferences > Operation > Compress File On Exit setting, which can be, at least for new users, predefined in upf template.
If from any reason you want to use own code, VBA is not the proper tool. As described in help (but I didn't do hands-on test), OnDesignFileClosed event is fired when the file was closed (after the event), not when is closing (before the event), which means you cannot work with the file anymore. In general, integration with MicroStation events should be done using MDL or MicroStationAPI, which provides more fine-grained and tighter integration with MicroStation engine.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Unknown said:I have approx 1600 models that I want to compress.
It sounds like a job for batch process, simply to open every file and use key-in to compress the file.
Unknown said:I tried XM, V8i and Aecosim, all seem to deliver different results.
I guess you should post question to "normal" MicroStation forum and also to provide more details what does it mean "different results". But they are different products, so they can behave differently, so the question is not if they behave differently, but what exactly you need to achieve.
Regards,