RefRename.mvba

I'd like to start an open source project on codeplex and develop the  "RefRename.mvba" into a robust solution. There are a number of wrinkles to iron out with this idea, first and foremost is the ownership of the code and if Bentley would allow it. But the real question is if the programmers in the MicroStation Community would be interested in such a project.

So, if you might  be willing to contribute to the solution reply to this post and let’s see if this thing has legs.

Some info on RefRename.mvba said:

Bentley SELECT-Support ticketno:[8000537120]:

Solution

The example: RefRename.mvba can be downloaded from the following URL:

ftp://ftp.bentley.com/pub/knowledgebase/attachments/RefRename.mvba

This VBA example will change the reference file attachment by using 2 arguments. The 1st argument is the existing reference's full path and file name, the 2nd argument is the new reference's full path and file name.

Steps:

1. Download V BA example "RefRename.mvba"

2. Place application in location pointed by MS_VBASEARCHDIRECTORIES (default is ...\Bentley\Workspace\System\vba\)

3. Start MicroStation (or open command file to be used in Batch processor).

4. Key-in:

vba load RefRename.mvba

vba run [refRename]startapp

Example:

Change the reference name of a file called "testref-01.dgn" to a new name "testref-02.dgn". Both files are in the same folder c:\references\

Key-in:

vba load RefRename.mvba

vba run [refRename]startapp c:\references\testref-01.dgn c:\references\testref-02.dgn

Notes:

-If file contains unresolved (red) references, a runtime error will report. The unresolved references need to be resolved or detached.

-If there is undisplayed references, this will also cause the runtime error, enable "Cache when display off " in reference preferences.