Hi team
I am replacing the text using vba. I am trying to save the file with another name using VBA.
is it possible to save using vba? how?
Please advice
Thanks!
its working fine . thanks!
Sorry. i am using DesignFile.SaveAs . its updating current file also. plaese advice
DesignFile.SaveAs . its updating current file also. plaese advice
V8
is it due to auto save config ? but if i disable auto save config , changes are not available in new file.
Ramakrishnan Sivasubramanian said:I am using DesignFile.SaveAs. It's updating current file also ... If i disable auto save config , changes are not available in new file
DesignFile.SaveAs
You need to understand how MicroStation works.
In its default mode, MicroStation saves changes automatically. If you call DesignFile.SaveAs, then the new file will have the same state as the active file at the time you save it.
In other words, a user doesn't normally have to use menu File=>Save, because the save happened already.
Regards, Jon Summers LA Solutions
Good Morning Jon. I have a requirement to save the changes in new file. is there any way to achieve?
Please advice.
Hi,
Ramakrishnan Sivasubramanian said:Sorry. i am using DesignFile.SaveAs . its updating current file also.
DesignFile.SaveAs . its updating current file also.
No, SaveAs method never updates current file. It takes existing file and saves it to another one.
When any update of current file happens, it's probably a consequence or side effect of MicroStation configuration and the saving process itself.
Ramakrishnan Sivasubramanian said:but if i disable auto save config , changes are not available in new file.
I did not test it, but I guess it's because the saving process takes the file itself, not data in memory, not saved to the file yet.
Ramakrishnan Sivasubramanian said:I have a requirement to save the changes in new file.
Unfortunately it is too vague specification. How changes are done? By user, by some application? Are they saved to active model? Or is your requirement to do not change the original file, but the new one should be enhanced with new elements?
Ramakrishnan Sivasubramanian said:is there any way to achieve?
Probably yes, but it's hard to say without knowing context and requirements/workflow clearly defined.
VBA is limited user tool, so often something else (C/C++ in case of V8) should be used when tight integration with MicroStation is required. But before a decision about the right tool is done, you must be able to simulate the whole process manually and describe the step including conditions and context.
If you goal is to do not modify the original file (this is how I understand your complains that original file is modified), maybe to create new empty file, to merge a reference (the original file) and to add new elements there is a better way.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Are you making your changes before or after you Save As?
If you are making the changes before you Save As, then you are making changes to the active file. You will want to Save As, then make the changes.
MaryB
Power GeoPak 08.11.09.918Power InRoads 08.11.09.918OpenRoads Designer 2021 R2