I have a vba script that attaches reference files using the 'ActiveModelReference.Attachments.AddCoincident' function.
I need to modify it to work within the Projectwise environment but I am getting 'File not found' errors.
The filename string is:-
"pw:\\VM110:Development (Login Server)\Documents\Common Data\Mapping\filename.dgn"
If I use the same string in the keyin window using 'rf=', the file will attach.
Is there a different syntax to be used when working with Projectwise from vba?
MicroStation integration with ProjectWise is implemented via an MDL application that calls the ProjectWise native API supplied in the client DLLs. The integration is hooked into the MS GUI via some of the dialog hooks and into certain commands via various MDL system function callbacks, but is not exposed from within the MDL or VBA APIs. The "RF=" command, specifically, is integrated via a command filter that itercepts and decodes any ProjectWise information passed in to the command before the command is executed.
I think that to create an integrated VBA application, you may have to talk to the PW API's yourself. I've dropped a note to some of the MS VBA experts (among whom I do not number!) for help or advice.
I would recommend that you use the PW API. However this does seam to work by sending the rf= command. You can record the operation with the VBA recorder then modify it to what you need to accomplish.
Dim startPoint As Point3d
Dim point As Point3d, point2 As Point3d
Dim lngTemp As Long
Dim modalHandler As New Macro1ModalHandler
' The following statement opens modal dialog "Reference Attachment Settings for ...\A.dgn"
' Send a keyin that can be a command string
CadInputQueue.SendKeyin "rf=pw:\\alpo.bentley.com:alpo-alpo\Documents\User Folders\Michael.Dougherty\DTE\A.dgn"
Class Module Macro1ModalHandler
Private Sub IModalDialogEvents_OnDialogClosed(ByVal DialogBoxName As String, ByVal DialogResult As MsdDialogBoxResult)
Private Sub IModalDialogEvents_OnDialogOpened(ByVal DialogBoxName As String, DialogResult As MsdDialogBoxResult)
If DialogBoxName = "Reference Attachment Settings for ...\A.dgn" Then
' Remove the following line to let the user close the dialog box.
DialogResult = msdDialogBoxResultOK
End If ' Reference Attachment Settings for ...\A.dgn