How can I script my Macro so that it closes microstation after the macro is done?
Best regards
Robert
Hi Robert,
something like
CadInputQueue.SendKeyin "exit"
would be enough.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Thanks a bunch, this solves my issue with time scheduled automated batching!
Do you also know if you can VBA script so that a file thats in DGN is saved as DWG in the same location as the DGN?
All I need is the code that saves the file in the other format...
I've been using batch convert until now (I have to do this every week for hundreds of files) but I am looking over the solution to time Schedule this aswell.
I also have to convert it back from DWG to DGN after.
Thanks a bunch!
Unknown said:Do you also know if you can VBA script so that a file thats in DGN is saved as DWG in the same location as the DGN?
SaveAs method is what you need. But you have take care about creating a proper file name. Something like this code:
Dim fileName As String fileName = ActiveDesignFile.Name fileName = Replace(ActiveDesignFile.Name, ".dgn", "") fileName = fileName & ".dwg" ActiveDesignFile.SaveAs fileName, True, msdDesignFileFormatDWG
magnificent!
Now all I want is that the working units of these exports always are in meters....
Unknown said:Now all I want is
Isn't it from a song from Love Actually movie? ;-)
Your the best friends should be MicroStation help and search tool at this web as the same topic has been discussed several times.
set units meter millimeter;filedesign
"filedesign" key-in is equal to Ctrl+F (File > Save settings), otherwise the changed units will be not remembered by the model.
Haha you are right :)
wow you are fast to deliver answers!
Ok but will the exported file have those working units? is it possible to set the resolution also?
sorry if I am bombing you with these questions..!
Unknown said:Ok but will the exported file have those working units?
Try it, it's just a key-in ;-)
I am quite sure it will.
Unknown said:is it possible to set the resolution also?
Do you mean (really?) resolution or accuracy?
Resolution is a bit different question and I guess there is no key-in. And why you want to change it? To modify working units is fine, the model content does not change. But when you will change the resolution, your drawing size will be changed also.
Regards,
I would want my new files to have the same acc,res,working area etc as my original files if its possible :)