Quantcast
Channel: ProjectWise Design Integration Wiki
Viewing all 1890 articles
Browse latest View live

Unable to see datasources on Windows 10

$
0
0
Revision 1 posted to Project Delivery: Content Management Wiki by Dana Guthrie on 10/31/2016 7:00:15 PM

 Product(s):ProjectWise Administrator
 Version(s):08.11.11.590
 Area: ProjectWise Administrator
 Subarea: Application Configurations
 Original Author:Dana Guthrie, Bentley Technical Support Group

Background

I am unable to see the datasources from my windows 10 workstation using ProjectWise Administrator SS4 08.11.11.590

Solution

ProjectWise Administrator and ProjectWise Explorer SS4 version(s) are not supported on Windows 10 operating system.

To be able to see the ProjectWise datasources on a SS4 08.11.11.590 server:

  1. Uninstall all ProjectWise SS4 software from the client machine (Explorer and Admin)
  2. Install the ProjectWise Connect Edition 10.00.01.67 version of both the Explorer and Admin.
  3. When you launch ProjectWise Admin connect edition and login to an older (SS4) datasource, you will be prompted with a message:
  4. "The server you are connecting to is running a different version of ProjectWise.  ProjectWise Administrator only supports connections to the Matching version of ProjectWise Integration Server.  If you proceed, full administrative capabilities may not be available."  This just means that any new capabilities that may be in the connect edition will not work with older datasource.
  5. Click okay to the message. 

Note: You cannot mix versions of ProjectWise on a single machine.  In other words you can not have PWE SS4 installed with PW admin Connect edition.  Explorer and Admin must be of the same version.

See Also


Using The ProjectWise API In VBA

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Robert Hook on 12/6/2016 1:17:06 PM

ProjectWise's API can be accessed via VBA, allowing you to extend applications beyond the desktop. If you need to work with data that is stored in ProjectWise in your corporate environment, you can automate many tasks just by using VBA and the ProjectWise API. To use the API, you need to declare the functions that you plan to use. By encapsulating these calls, you can reuse them in many applications. In this article, we will use the simple process of logging in, checking out, allowing processing, and checking in of multiple documents in a ProjectWise document store. We need to declare the functions that will be used, then organize the application into reusable parts, and finally test the application.

First, set up the calls that need to be exposed to VBA from the ProjectWise API. The aaAPI class module is used to expose the C-based functions of the ProjectWise API to VBA. They are kept in one module to allow them to be reused in the application. There is also a Utility module to expose other functions that are necessary for both this and future projects.

The next phase is to build a set of classes that encapsulate the parts of ProjectWise that we will be working with. First is the datasource, which is in the clsPWDataSource class. This will be the point of the login and contain a reference to the collection of Projects that make up a datasource. Next, define the clsPWProject, which represents the Project information and contains a collection of documents. Next, define the clsPWDocument, which is the document class. Finally, there is the clsPWAttribute, which contains the document attributes.

The datasource class has the following properties and methods:

class_initialize

This method is called when a new reference to a datasource is created and contains the aaApi_initialize function call, which enables the rest of the aaApi calls to work.

login

This method calls the aaApi_login function to connect to the datasource.

loginDlgThis method calls the aaApi_loginDlg function, which presents a user interface to login to the datasource.

'---------------------------------------------------------------------------------------+
'
'   Copyright: (c) 2006 Bentley Systems, Incorporated. All rights reserved.
'
'---------------------------------------------------------------------------------------+
'---------------------------------------------------------------------------------------+
' Module:   clsPWDataSource.cls
' Status:
' Date:
' Author:
' Version:  1.0
'
' This class is a Connection to ProjectWise Datasource
'
'---------------------------------------------------------------------------------------+
Option Explicit

'---------------------------------------------------------------------------------------+
'
'   Private Members
'
'---------------------------------------------------------------------------------------+

' User Information
Private strUserName As String
Private strPassword As String
Private strDataSource As String
Private blIsLoggedIn As Boolean
Private blIsMCMLoaded As Boolean

'Document Information
Private lngDocID As Long
Private lngProjectID As Long
Private strDocumentName As String
Private lngSetID As Long
Private lngAttibuteCount As Long
Private strAttributes(0, 0) As String
Private strGUID As String

'---------------------------------------------------------------------------------------+
'
'   Public Members
'
'---------------------------------------------------------------------------------------+
Public Documents As Collection
Public Projects As Collection

'---------------------------------------------------------------------------------------+
'
'   Public Properties
'
'---------------------------------------------------------------------------------------+
'User Name
Public Property Get UserName() As String
    UserName = StrConv(strUserName, vbFromUnicode)
End Property
Public Property Let UserName(ByVal strNewUserName As String)
       strUserName = StrConv(strNewUserName, vbUnicode)
End Property

'Password
Public Property Let UserPassword(ByVal strNewPassword As String)
       strPassword = StrConv(strNewPassword, vbUnicode)
End Property

'Datasource
Public Property Get datasource() As String
    datasource = StrConv(strDataSource, vbFromUnicode)
End Property
Public Property Let datasource(ByVal strNewDataSource As String)
       strDataSource = StrConv(strNewDataSource, vbUnicode)
End Property
'System
Public Property Get IsMCMLoaded() As Boolean
    IsMCMLoaded = blIsMCMLoaded
End Property
'---------------------------------------------------------------------------------------+
'
'   Login Properties and Methods
'
'---------------------------------------------------------------------------------------+
Public Property Get IsloggedIn() As Boolean
    IsloggedIn = blIsLoggedIn
End Property

'*---------------------------------------------------------------------------------**''**
' @description      Logs a user into ProjectWise
' @param            lngDataSourceType       IN Datasource type to log into
' @param            strLoginDataSourceName  IN Datasource to log into
' @param            strLoginUserName        IN User name
' @param            strLoginPassword        IN User password
' @return
' @version          1.0
' @dependencies
' @example
' @remarks
' @alinkjoin
' @group
'---------------+---------------+---------------+---------------+---------------+------''
Public Sub Login(lngDataSourceType As DataSourceTypes, strLoginDataSourceName As String, strLoginUserName As String, strLoginPassword As String)
    
    Dim lOK As Long
    
    UserName = strLoginUserName
    UserPassword = strLoginPassword
    datasource = strLoginDataSourceName

    lOK = aaApi_Login(lngDataSourceType, StrConv(strLoginDataSourceName, vbUnicode), StrConv(strLoginUserName, vbUnicode), StrConv(strLoginPassword, vbUnicode), "")
    
    If lOK <> 1 Then
        blIsLoggedIn = False
    Else
        blIsLoggedIn = True
        BuildDataSourceInfo
    End If
    
End Sub
'*---------------------------------------------------------------------------------**''**
' @description      Logs a user into ProjectWise
' @param            lngDataSourceType       IN Datasource type to log into
' @param            strLoginDataSourceName  IN Datasource to log into
' @param            strLoginUserName        IN User name
' @param            strLoginPassword        IN User password
' @return
' @version          1.0
' @dependencies
' @example
' @remarks
' @alinkjoin
' @group
'---------------+---------------+---------------+---------------+---------------+------''
Public Sub LoginDlg(lngDataSourceType As DataSourceTypes, strLoginDataSourceName As String, strLoginUserName As String, strLoginPassword As String)
    
    Dim lOK As Long
    
    UserName = strLoginUserName
    UserPassword = strLoginPassword
    datasource = strLoginDataSourceName

    lOK = aaApi_LoginDlg(lngDataSourceType, "", Len(strLoginDataSourceName), "", "", "")
    
    If lOK <> 1 Then
        blIsLoggedIn = False
    Else
        blIsLoggedIn = True
        BuildDataSourceInfo
    End If
    
End Sub
'---------------------------------------------------------------------------------------+
'
'   Project Properties and Methods
'
'---------------------------------------------------------------------------------------+
Sub NavigateHierarchy(lngPID As Long)
Dim projectDatabuffer As Long
Dim numDocuments As Long
Dim iCount As Long
Dim oProject As clsPWProject

projectDatabuffer = aaApi_SelectProjectDataBuffer(lngPID)
numDocuments = aaApi_SelectDocumentsByProjectId(lngPID)
'Process top level only.
For iCount = 0 To numDocuments - 1
    Set oProject = New clsPWProject
    oProject.ProjectID = aaApi_DmsDataBufferGetNumericProperty(projectDatabuffer, PROJ_PROP_ID, iCount)
    oProject.ProjectName = VBStringFromPtrW(aaApi_DmsDataBufferGetStringProperty(projectDatabuffer, PROJ_PROP_NAME, iCount))
    oProject.Description = VBStringFromPtrW(aaApi_DmsDataBufferGetStringProperty(projectDatabuffer, PROJ_PROP_DESC, iCount))
    oProject.BuildDocumentCollection
    Projects.Add oProject
Next iCount

Dim subProjectDataBuffer As Long
Dim numChildren As Long
Dim iSubCount As Long
Dim childProjID As Long

subProjectDataBuffer = aaApi_SelectProjectDataBufferChilds(lngPID)
numChildren = aaApi_DmsDataBufferGetCount(subProjectDataBuffer)
For iSubCount = 0 To numChildren - 1
childProjID = aaApi_DmsDataBufferGetNumericProperty(subProjectDataBuffer, PROJ_PROP_ID, iSubCount)
    Call NavigateHierarchy(childProjID)
Next iSubCount
aaApi_DmsDataBufferFree subProjectDataBuffer

aaApi_DmsDataBufferFree projectDatabuffer

End Sub
Sub BuildProjectCollection2()
Dim projectDatabuffer As Long
Dim iTopLevelProjects As Long
Dim iCount As Long
Dim lngPID As Long

iTopLevelProjects = aaApi_SelectTopLevelProjects()
If iTopLevelProjects < 0 Then
    MsgBox "error on projects collection" & GetLastErrorMessage & GetLastErrorDetail
    Exit Sub
End If
For iCount = 0 To iTopLevelProjects
    lngPID = aaApi_GetProjectId(iCount)
    Call NavigateHierarchy(lngPID)
Next iCount
End Sub
Sub BuildProjectCollection()
Dim projectDatabuffer As Long
Dim iTopLevelProjects As Long

projectDatabuffer = aaApi_DmsDataBufferSelect(AADMSBUFFER_PROJECT)
If projectDatabuffer = 0 Then
    MsgBox "error on projects collection" & GetLastErrorMessage & GetLastErrorDetail
    Exit Sub
End If

Dim numberOfProjects As Long
Dim oProject As clsPWProject
Dim iCount As Long

numberOfProjects = aaApi_DmsDataBufferGetCount(projectDatabuffer)

For iCount = 0 To numberOfProjects - 1
    Set oProject = New clsPWProject
    oProject.ProjectID = aaApi_DmsDataBufferGetNumericProperty(projectDatabuffer, PROJ_PROP_ID, iCount)
    oProject.ProjectName = VBStringFromPtrW(aaApi_DmsDataBufferGetStringProperty(projectDatabuffer, PROJ_PROP_NAME, iCount))
    oProject.Description = VBStringFromPtrW(aaApi_DmsDataBufferGetStringProperty(projectDatabuffer, PROJ_PROP_DESC, iCount))
    oProject.BuildDocumentCollection
    Projects.Add oProject
Next iCount
aaApi_DmsDataBufferFree (projectDatabuffer)
End Sub


Private Sub BuildDataSourceInfo()
    
    Set Documents = New Collection
    Set Projects = New Collection
    
    BuildProjectCollection
End Sub

Private Sub Class_Initialize()
    ' See if MCM is loaded
    If Utility.MDLIsLoaded("MCM") <> True Then
        aaApi_Initialize AAMODULE_ALL
        blIsLoggedIn = False
        blIsMCMLoaded = False
    Else
        blIsMCMLoaded = True
        blIsLoggedIn = True
    End If
    
End Sub

Private Sub Class_Terminate()
    
    'Logout
    If datasource <> "" Then
        aaApi_Logout datasource
    End If
    
    Call aaApi_Uninitialize
    blIsLoggedIn = False
    
End Sub

 

The project class has the following properties and methods:

BuildDocumentCollection

This method iterates through the Documents in the project and creates a collection of clsPWDocuments.

CreateDocument

This method allows a new document to be inserted into the project

'---------------------------------------------------------------------------------------+
'
'   Copyright: (c) 2006 Bentley Systems, Incorporated. All rights reserved.
'
'---------------------------------------------------------------------------------------+
'---------------------------------------------------------------------------------------+
' Module:   clsPWProject.cls
' Status:
' Date:
' Author:
' Version:  1.0
'
' This class is a Connection to ProjectWise DataSource
'
'---------------------------------------------------------------------------------------+
Option Explicit
Private lngDataSource As Long
Public lngProjectID As Long
Public strName As String
Public strDescription As String
Private Documents As Collection

Public Property Let ProjectID(id As Long)
lngProjectID = id
End Property

Public Property Get ProjectID() As Long
ProjectID = lngProjectID
End Property

Public Property Get ProjectName() As String
ProjectName = strName
End Property

Public Property Let ProjectName(strNameIn As String)
strName = strNameIn
End Property

Public Property Let DataSourceID(datasource As Long)
lngDataSource = datasource
End Property

Public Property Get DataSourceID() As Long
DataSourceID = lngDataSource
End Property

Public Property Let Description(strDesc As String)
strDescription = strDesc
End Property

Public Property Get Description() As String
Description = strDescription
End Property

Public Sub BuildDocumentCollection()
Dim oDocument As clsPWDocument
Dim numberOfDocuments As Long
Dim projectDocumentsBuffer As Long
Dim pAADocSelect As AADOCSELECT_ITEM
pAADocSelect.lProjectId = lngProjectID

'numberOfDocuments = aaApi_SelectDocumentsByProjectId(lngProjectID)
numberOfDocuments = aaApi_SelectDocuments(VarPtr(pAADocSelect), 0, 0)
If numberOfDocuments < 0 Then
    MsgBox "error building doc list " & GetLastErrorMessage & GetLastErrorDetail
Exit Sub
End If

Dim iCount As Long
Dim id As Long
Dim lngDocType As Long

For iCount = 0 To numberOfDocuments - 1
id = aaApi_GetDocumentNumericProperty(DOC_PROP_ID, iCount)

If id <> 0 Then
Set oDocument = New clsPWDocument
    oDocument.DocumentID = id
    oDocument.ProjectID = lngProjectID
    oDocument.name = VBStringFromPtrW(aaApi_GetDocumentStringProperty(DOC_PROP_NAME, iCount))
    lngDocType = aaApi_GetDocumentNumericProperty(DOC_PROP_ITEMTYPE, iCount)
    oDocument.DocType = lngDocType
    Documents.Add oDocument
End If
Next iCount
'aaApi_DmsDataBufferFree projectDocumentsBuffer

End Sub
Property Get DocumentsCollection() As Collection
Set DocumentsCollection = Documents
End Property
Private Sub Class_Initialize()
Set Documents = New Collection
End Sub

''*---------------------------------------------------------------------------------**''**
'' @description      Create a document in the ProjectWise database
'' @param            lngProjectID    IN Project ID to create the document
'' @param            strDocument     IN Path and name of the document
'' @return           True if the document was created successfully else False
'' @version          1.0
'' @dependencies
'' @example
'' @remarks
'' @alinkjoin
'' @group
''---------------+---------------+---------------+---------------+---------------+------''
Public Function CreateDocument(lngProjectID As Long, strDocument As String) As Long

    Dim lngAppID As Long
    Dim lngWorkSpceID As Long
    Dim lngAttID As Long
    Dim strFileName As String
    Dim strFileExt As String
    Dim strWorkingDir As String
    Dim status As Long
    Dim oDocument As clsPWDocument

    lngAppID = 1
    strWorkingDir = Space(MAX_STRINGLEN)

    ' Parse file
    strFileName = fileNameParse(strDocument, FileNameOnlyType)
    strFileExt = fileNameParse(strDocument, FileExtOnlyType)
    strFileName = strFileName + "." + strFileExt

    ' Get IDs
    lngWorkSpceID = aaApi_GetWorkspaceProfileId(lngProjectID, 0)
    strFileExt = StrConv(strFileExt, vbUnicode)
    lngAppID = aaApi_GetFExtensionApplication(strFileExt)

    status = aaApi_CreateDocument(lngDocID, lngProjectID, 0, AADMS_FTYPE_UNKNOWN, AADMS_ITYPE, lngAppID, 0, _
                                 lngWorkSpceID, StrConv(strDocument, vbUnicode), _
                                 StrConv(strFileName, vbUnicode), _
                                 StrConv(strFileName, vbUnicode), _
                                 vbNullChar, vbNullChar, False, _
                                 AADMSDOCCREF_DEFAULT, strWorkingDir, MAX_STRINGLEN, lngAttID)
    If status <> 0 Then
    oDocument = New clsPWDocument
    oDocument.Initialize lngProjectID, lngDocID
    oDocument.DocType = aaApi_GetDocumentNumericProperty(DOC_PROP_ITEMTYPE, iCount)
    Documents.Add oDocument
    End If
    
    CreateDocument = lngDocID

End Function

 

The Documents collection holds the documents in this project. To add a document, the CreateDocument method is called on the project that holds the document.

The document class has the following properties and methods: CheckIn and CheckOut methods.

CheckInChecks in the document that already exists in the project.
CheckOutChecks out a document from a project.
CopyOutCopies out the document to a local storage for working.
InitializeSets the document ID, project ID, and path for the document in the programmatic object.

The document is checked in and out using the

'---------------------------------------------------------------------------------------+
'
'   Copyright: (c) 2006 Bentley Systems, Incorporated. All rights reserved.
'
'---------------------------------------------------------------------------------------+
'---------------------------------------------------------------------------------------+
' Module:   clsPWDocument.cls
'
' This class contains information about a document from ProjectWise
'
'---------------------------------------------------------------------------------------+
Option Explicit

'---------------------------------------------------------------------------------------+
'
'   Private Members
'
'---------------------------------------------------------------------------------------+
'Document Information
Private blnIsCheckOut As Boolean
Private lngDocID As Long
Private lngProjID As Long
Private strDocumentName As String
Private strFullDocumentName As String
Private strCheckedOutName As String
Private lngDocItemType As Long
Private lngSetID As Long
Private lngAttibuteCount As Long
Private strPathToCheckedOutFile As String
Private strGUID As String

'---------------------------------------------------------------------------------------+
'
'   Public Property
'
'---------------------------------------------------------------------------------------+
Public Attributes As Collection
Public Property Get FullFileName() As String
    FullFileName = strFullDocumentName
End Property
Public Property Let FullFileName(name As String)
    FullFileName = name
End Property
'Datasource
Public Property Get DocumentID() As Long
    DocumentID = lngDocID
End Property
Public Property Let DocumentID(id As Long)
    lngDocID = id
End Property

Public Property Get ProjectID() As Long
    ProjectID = lngProjID
End Property
Public Property Let ProjectID(id As Long)
    lngProjID = id
End Property

Public Property Get name() As String
    name = strDocumentName
End Property
Public Property Let name(strName As String)
    strDocumentName = strName
End Property
Public Property Let DocType(DocType As Long)
lngDocItemType = DocType
End Property
Public Property Get DocType() As Long
    DocType = lngDocItemType
End Property
Public Property Get CheckedOutName() As String
    CheckedOutName = strCheckedOutName
End Property
Public Property Get IsCheckOut() As Boolean
    IsCheckOut = blnIsCheckOut
End Property

Public Property Get AttributeCount() As Long
    AttributeCount = lngAttibuteCount
End Property

'*---------------------------------------------------------------------------------**''**
' @description      Checks in the document with the provided ProjectID and DocumentID
' @param            lngProjectID    IN Project ID of the document
' @param            lngDocumentID   IN Document ID
' @return           True if the document was checked in successfully else False
' @version          1.0
' @dependencies
' @example
' @remarks
' @alinkjoin
' @group
'---------------+---------------+---------------+---------------+---------------+------''
Public Function CheckIn() As Long
    CheckIn = 0
    If IsCheckOut Then
        CheckIn = aaApi_CheckInDocument(lngProjID, lngDocID)
    End If
    blnIsCheckOut = False
End Function

'*---------------------------------------------------------------------------------**''**
' @description      Retrieves the documents attributes and add them to the collection
' @param
' @return
' @version          1.0
' @dependencies
' @example
' @remarks
' @alinkjoin
' @group
'---------------+---------------+---------------+---------------+---------------+------''
Private Function PopulateAttributes()
        
    If aaApi_SelectEnvByProjectId(lngProjID) > 0 Then
        Dim lngEnvID As Long
        Dim lngTabNo As Long
        Dim count As Long
        Dim attributeDataBuffer As Long
        
        lngEnvID = aaApi_GetEnvId(0)
        lngTabNo = aaApi_GetEnvNumericProperty(ENV_PROP_TABLEID, 0)
            
        attributeDataBuffer = aaApi_SelectLinkDataDataBuffer(lngTabNo, AADMSLDT_DOCUMENT, lngProjID, lngDocID, vbNullChar, 0, 0, 0)
        
        If attributeDataBuffer <> 0 Then
            Dim i As Long
            
            count = aaApi_GetLinkDataDataBufferColumnCount(attributeDataBuffer)
            
            lngAttibuteCount = count
            
            For i = 0 To count - 1
                Dim docAtt As clsAttribute
                Set docAtt = New clsAttribute
            
                docAtt.ColumName = VBStringFromPtrW(aaApi_DmsDataBufferGetStringProperty(attributeDataBuffer, LINKDATA_PROP_COLUMN_NAME, i))
                docAtt.RowValue = VBStringFromPtrW(aaApi_GetLinkDataDataBufferColumnValue(attributeDataBuffer, 0, i))
                Attributes.Add docAtt
            Next
            
            aaApi_DmsDataBufferFree attributeDataBuffer
        
        End If
            
    End If

End Function


'*---------------------------------------------------------------------------------**''**
' @description      Checks out the document with the provided ProjectID and DocumentID
' @param            lngProjectID    IN Project ID of the document
' @param            lngDocumentID   IN Document ID
' @return           Nothing
' @version          1.0
' @dependencies
' @example
' @remarks
' @alinkjoin
' @group
'---------------+---------------+---------------+---------------+---------------+------''
Public Function CheckOut() As Long
Dim status As Long
Dim strName As String
Dim strSize As Long
Dim strWorkingDir As String

strWorkingDir = "d:\data\PWStuff\"

strSize = 512

    CheckOut = aaApi_CheckOutDocument(lngProjID, lngDocID, StrPtr(strWorkingDir), strFullDocumentName, MAX_STRINGLEN)
    
    If CheckOut = 1 Then
        lngProjID = lngProjID
        lngDocID = lngDocID
        blnIsCheckOut = True
        
'        status = aaApi_GetDocumentCheckedOutFileName(lngProjID, lngDocID, StrPtr(strName), strSize)
'        If status = 0 Then
'            'strCheckedOutName = VBStringFromPtrW()
'        End If
        
    End If
    
End Function

'*---------------------------------------------------------------------------------**''**
' @description      Initialize the document object.
' @param
' @return           Returns 1 if the document was selected successfully.
' @version          1.0
' @dependencies
' @example
' @remarks
' @alinkjoin
' @group
'---------------+---------------+---------------+---------------+---------------+------''
Public Function Initialize(lngProjectID As Long, lngDocumentID As Long) As Long
        
    lngProjID = lngProjectID
    lngDocID = lngDocumentID
    blnIsCheckOut = True
    
    aaApi_SelectDocument lngProjectID, lngDocumentID
    strDocumentName = VBStringFromPtrW(aaApi_GetDocumentStringProperty(DOC_PROP_FILENAME, 0))
    aaApi_GetDocumentFileName lngProjectID, lngDocumentID, strFullDocumentName, MAX_STRINGLEN
    
    PopulateAttributes

End Function

'*---------------------------------------------------------------------------------**''**
' @description      Copy out the document with the provided ProjectID and DocumentID.
' @param
' @return           Returns 1 if the document was copied out successfully.
' @version          1.0
' @dependencies
' @example
' @remarks
' @alinkjoin
' @group
'---------------+---------------+---------------+---------------+---------------+------''
Public Function CopyOut() As Long

    CopyOut = aaApi_CopyOutDocument(lngProjID, lngProjID, "d:\data\pwstuff\", strDocumentName, MAX_STRINGLEN)

    If CopyOut = 1 Then

        lngProjID = lngProjectID
        lngDocID = lngDocumentID
        blnIsCheckOut = True

        PopulateAttributes

    End If

End Function

Private Sub Class_Initialize()
    
    strDocumentName = Space$(MAX_STRINGLEN)
    strFullDocumentName = Space$(MAX_STRINGLEN)
    
    Set Attributes = New Collection
    
End Sub

Private Sub Class_Terminate()
    
    Set Attributes = Nothing
    
End Sub
The main objects are supported by two helper modules that wrap functions for common and future use. First is the Utility module that contains some calls to get error reporting and process string data passed from VBA to MDL (or the ProjectWise API). Also included are calls to MDL functions that are used to work with MicroStation. The next module is the aaApi module, which contains definitions for all the ProjectWise API functions that are used in the Objects. This is done to allow the expansion of the ProjectWise API exposed without having to rebuild the Objects. These modules can also be referenced from other VBA projects, allowing for reuse of the code.

To start, create an instance of the datasource object, which in its initialization initializes the ProjectWise API. Next, we need to be able to explore the datasource hierarchy, which is made up of Projects and Documents. The datasource allows us to build the collection of Projects, each of which having a collection of Documents. The Document object has the properties and methods necessary for working with the document in the ProjectWise context.

In the sample application, we build the objects and then process the datasource to find each design file, subsequently allowing the application to open each one and process the file. This application uses the non-interactive login, which means that we have to hardcode the login information directly into the application. First, the code creates the clsPWConnection object and after we have a connection, the application then can login. The project and document collections are created when the login is complete and finally, the sample application iterates through the collection of projects. Within each project, it iterates through the documents.

'---------------------------------------------------------------------------------------+
'
'   Copyright: (c) 2006 Bentley Systems, Incorporated. All rights reserved.
'
'---------------------------------------------------------------------------------------+
'---------------------------------------------------------------------------------------+
' Module:   BDNzineExample
' Status:
' Date:
' Author:
' Version:  1.0
'
' This module demonstrates a simple connection to ProjectWise
'
'---------------------------------------------------------------------------------------+

Option Explicit

Sub BDNzineCheckOutAndProcessFiles()
Dim oPW As clsPWDataSource
Dim oDocItem As clsPWDocument
Dim lngProjectID As Long
Dim lngDocumentID As Long
Dim oProject As clsPWProject
Dim oDocument As clsPWDocument
Dim extString As String
Dim lStatus As Long
Dim oview As View
Dim oDesignFile As DesignFile
Dim pOriginalDGNFileName As String

'Save off the original file name to allow reopening the file at the end of the process.
pOriginalDGNFileName = ActiveDesignFile.FullName

 ' Create an instance of the clsPWDataSource class.
   Set oPW = New clsPWDataSource
   oPW.Login AAAPIDB_UNKNOWN, "computername:PWSample", "john.public", "a1b2c3d4"
   Debug.Print "Datasource : " + oPW.datasource
   Debug.Print "User Logged in : " + oPW.UserName
   If oPW.IsloggedIn Then
       oPW.BuildProjectCollection
       If Not oPW.Projects Is Nothing Then
           For Each oProject In oPW.Projects
               Debug.Print "the project id is " & oProject.ProjectID & " the Project name is " & oProject.ProjectName
               If Not oProject.DocumentsCollection Is Nothing Then
                   For Each oDocument In oProject.DocumentsCollection
                       Debug.Print "the document id is " & oDocument.DocumentID & " the file name is " & oDocument.name
                       extString = InStrRev(oDocument.name, ".dgn")
                       If extString > 0 Then
                           oDocument.CheckOut
                           Set oDesignFile = OpenDesignFile(StrConv(oDocument.FullFileName, vbFromUnicode), True)
                           For Each oview In oDesignFile.Views
                               If oview.IsOpen Then
                                   oview.Fit True
                               End If
                           Next oview
                           oDesignFile.Close
                           oDocument.CheckIn
                       End If
                       Next oDocument
               End If
           Next oProject
       End If
       Else
           MsgBox "Error on login " & GetLastErrorMessage & " " & GetLastErrorDetail
       End If
   'You don't need to logout since the destructor for the PWConnection class will do that for you.
   Set oPW = Nothing
   'This is done to leave us in a file, not in a blank MicroStation session.
   If oPW Is Nothing Then
       OpenDesignFile pOriginalDGNFileName, False
   End If
End Sub

Lastly, the code above refers to a utility method VBStringFromPtrWthat takes in the address of a WideChar Unicode string and returns an ANSI C MultiByte string:  The code for the utility function is provided below.  Make sure to place your constants and declare statements near the top of an appropriate "utility" source code module so it can be easily be shared among any VBA project needing such a conversion.

'---------------------------------------------------------------------------------------+
'
'   Public constant definitions
'
'---------------------------------------------------------------------------------------+
Public Const CP_ACP = 0

Public Declare Function WideCharToMultiByte Lib "kernel32" (ByVal codepage As Long, ByVal dwFlags As Long, lpWideCharStr As Any, ByVal cchWideChar As Long, lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpDefaultChar As String, ByVal lpUsedDefaultChar As Long) As Long
Public Declare Function lstrlenW Lib "kernel32" (lpString As Any) As Long

'*---------------------------------------------------------------------------------**''**
' @description      Returns the string before first null char encountered (if any)
'                   from an ANSII string.
' @param
' @return           Returns the string
' @version          1.0
' @dependencies     VBIDE, IWshRuntimeLibrary
' @example
' @remarks
' @alinkjoin
' @group
' @bsimethod                                                    BSI-DEVSPT      06/04
'---------------+---------------+---------------+---------------+---------------+------''
' Returns the string before first null char encountered (if any) from an ANSII string.
Public Function GetStrFromBufferA(sz As String) As String
    If InStr(sz, vbNullChar) Then
        GetStrFromBufferA = Left$(sz, InStr(sz, vbNullChar) - 1)
    Else
        ' If sz had no null char, the Left$ function
        ' above would return a zero length string ("").
        GetStrFromBufferA = sz
    End If
End Function

'*---------------------------------------------------------------------------------**''**
' @description      Returns an ANSI string from a pointer to a Unicode string
' @param
' @return           Returns an ANSI string from a pointer to a Unicode string
' @version          1.0
' @dependencies
' @example
' @remarks
' @alinkjoin
' @group
' @bsimethod                                                    BSI-DEVSPT      06/04
'---------------+---------------+---------------+---------------+---------------+------''
Public Function VBStringFromPtrW(lpszW As Long) As String
    Dim sRtn As String
    sRtn = String$(lstrlenW(ByVal lpszW) * 2, 0)   ' 2 bytes/char
    ' WideCharToMultiByte also returns Unicode string length
    Call WideCharToMultiByte(CP_ACP, 0, ByVal lpszW, -1, ByVal sRtn, Len(sRtn), 0, 0)
    VBStringFromPtrW = GetStrFromBufferA(sRtn)
End Function
Tags: ProjectWise API, VBA, ProjectWise SELECTsupport

SharePoint/ProjectWise Web Server Single Sign On Setup

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Molly Watts on 12/12/2016 8:18:41 PM

Original Question: SharePoint/ProjectWise Web Server Single Sign On Setup by jjussal

Hello,

I am trying to set up single sign on for SharePoint/Web Parts but I am running into a road block. I have followed the technotes and the implementation guide to set everything up but user permissions aren't carrying through as I would expect.

 

I set up a delegate user to log on to the web parts expecting that other users who log on to the site will only see the projects/folders they have rights to see but this doesn't seem to be the case. Other users are still able to see everything the delegate user can see which we don't want. The delegate user has been enabled as a delegate user through PW admin, configured them as the delegate user on the Web Servers, and we have added the SharePoint Servers to the trusted server section in the Integration Server's dmskrnl file.

 

Any help would be appreciated by anyone who might have had some similar issues with this setup.

 

Thanks,

Jutin


Verified Answer: RE: SharePoint/ProjectWise Web Server Single Sign On Setup by Ranveer.Basra

Hi Jutin

***Please make sure you are a  ProjectWise Administrator before you are doing this as well a administrator on servers who can make changes***

Integration Server:

Open the DMSKRNL.CFG

Under the [Trusted Server] Section add ProjectWise SPSERVER (or name of the SharePoint Server) = <IP address>

SharepointServer1 =44.55.6.777

Go the [DB] section at the bottom of the file: for the datasource you are goign to use add SSO=1

[db0]

Description==ProjectWise

DisplayName=ProjectWiseDataSource

InterfaceType=ODBC

Name=ProjWise

Type=Microsoft SQL Server

SSO=1

Now make sure you are logged in as a ProjectWise Administrative account: Create a user which is going to be used as the delegated user. Under the Settings Tab --> User Settings --> Expand Administrative and check the 'Enable as delegate user'

On your SharePoint server:

Go to Start --> Programs --> Bentley --> ProjectWise v8XM --> WebParts --> ProjectWise Web Parts Single SignOn Settings and point to the delegated user you just created. Save it and hit OK. On the SharePoint Site open the ProjectWise Navigation WebParts: Check the box for 'Use Windows Credentials (SSO)'

Now make sure the user has a domain account that is logging in to the ProjectWise Data source and has logged on to the his/her computer before they try to access the Web Parts.

On Client(s) Machine:

Under Internert Explorer go to Tools -->  Options:

 Under the Security Tab --> select Internet  -->  Click Custom Level:

Scroll down to the User Authentication section and turn on 'Automatic logon with current username and password' Click OK

Click on the Advance TAB scroll down to 'Security' and select 'Enable Integrated Windows Authentication (requires restart)

I usually do a iisreset as well clear the local user cache when testing. You should see the user who is logged on to the local machine and is a user in ProjectWise logged in to the web part via the delegated user.

Ranveer

ProjectWise Design Integration V8i

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Molly Watts on 12/19/2016 2:15:46 PM

Integration / Caching /Gateway - ProjectWise Design Integration V8i

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Molly Watts on 12/19/2016 2:15:49 PM

Installation - Integration / Caching /Gateway - ProjectWise Design Integration V8i

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Molly Watts on 12/19/2016 2:20:24 PM

ProjectWise Fails to Start in Secure Mode

$
0
0
Revision 1 posted to Project Delivery: Content Management Wiki by Molly Watts on 12/19/2016 2:20:25 PM
 Product(s):ProjectWise Design Integration V8i
 Version(s):10.00.01.67
 Environment:N\A
 Area:Integration / Caching /Gateway
 Subarea:Installation

Problem

XXXXXXXProblemXXXXXXX



Solution

XXXXXXXSolutionXXXXXXX



See Also

XXXXXXX(Add more links as needed for other relevant Be Communities content.)XXXXXXX



 Original Author:Molly Watts
Tags: installation, Integration / Caching /Gateway, 10.00.01.67, ProjectWise, en, SELECTsupport, ProjectWise Design Integration V8i

Utilizing Templates in ProjectWise Deliverables Management

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Molly Watts on 12/19/2016 8:44:10 PM

Quite often PWDM users need to send packages to the same distribution list, or use a different default schedule and don't want to reenter the information each time.  This process will show how to utilize drafts as a template to have the information pre populated.

note: this example is based on using the Portal, however the same process can be following when using the ProjectWise Deliverables Management Connector for ProjectWise Explorer

 

  1. Create New Transmittal

     

  2. Enter subject to clearly define the use of the template and any other information that might be used for most of the future transmittals (Purpose, Comments, Cover Letter)

     

     

  3. Select the Recipients tab and Click “Add Recipients” Select the recipients that will be normally be receiving this type of package, and change the “Acknowledge” and “Response” settings per user as necessary

4. Click “Save Draft” 

5. Any internal participant to the project will now be able to log in, and browse to the Drafts page, and use any of the created templates to initiate a New Transmittal

6. Clicking the “Use as a template” button will start a new transmittal with all the information saved in the draft (General, Recipients, Documents, Scheduling) 

7. Change/add any details as needed and issue transmittal

 

Tags: ProjectWise Deliverables Management

PWDM Variables available for the Cover Letter Template

$
0
0
Revision 1 posted to Project Delivery: Content Management Wiki by Molly Watts on 12/21/2016 3:44:42 PM

 

Transmittal variables

Variable

Description

{$Project.Name$}

The name of the CONNECTED project the transmittal is sent from

{$Transmittal.Code$}

Transmittal package ID

{$Transmittal.Subject$}

The subject of the transmittal

{$Transmittal.Comments$}

Transmittal comments

{$Transmittal.Purpose$}

The name of the purpose assigned to this transmittal

{$Transmittal.AcknowledgementDueDate$}

The date that acknowledgement for this transmittal is due

{$Transmittal.ResponseDueDate$}

The date that responses for this transmittal are due

{$Transmittal.CreatedDate$}

The date the transmittal was created

{$Transmittal.CurrentDate$}

The date the cover letter was generated (generally the transmittal issue date)

{$Transmittal.CurrentUserFullname$}

The name of the user who issued the transmittal

{$Transmittal.CurrentUserOrganization$}

The name of the company that the transmittal issuer belongs to

{$Transmittal.CurrentUserEmail$}

The email address of the transmittal issuer

 

Document variables

Variable

Description

{$Document.FileName$}

File name

{$Document.FileSize$}

File size

{$Document.Name$}

Document name

{$Document.Path$}

Document path in the transmittal package

{$Document.ReferenceOf$}

Name of document this document is a reference of

 

Document attribute values

Depends on the attributes configured in the portal settings. Below are only examples.

Variable

Description

{$DocumentAttribute.GetValue(Description)$}

Document description

{$DocumentAttribute.GetValue(State)$}

Document state

{$DocumentAttribute.GetValue(Version)$}

Document version

 

Reference document variables

Variable

Description

{$Reference.FileName$}

Reference file name

{$Reference.FileSize$}

Reference file size

{$Reference.Name$}

Reference document name

{$Reference.Path$}

Reference path in the package

{$Reference.ReferenceOf$}

Name of document this reference is a reference of

 

Reference attribute values

Depends on the attributes configured in the portal settings. Below are only examples.

Variable

Description

{$ReferenceAttribute.GetValue(State)$}

Document state

{$ReferenceAttribute.GetValue(Version)$}

Document version

 

Transmittal recipient variables

Variable

Description

{$Recipient.Comments$}

Comments entered about the recipient

{$Recipient.Company$}

The name of the organization the recipient belongs to

{$Recipient.e-mail$}

The recipient's email address

{$Recipient.Name$}

The recipient's name

{$Recipient.ResponseRequired$}

Indicates if the recipient is required to respond - Substituted with "Y" or "N"

{$Recipient.Title$}

The recipient's title

 

Folder variables

Variable

Description

{$Folder.Name$}

Folder name in the transmittal package

{$Folder.Path$}

Folder path in the transmittal package

 

Repeater variables

Variable

Description

{$Formula$}{$DocumentRepeater.Index$} + 1

Indicates that this template line needs to be repeated for every document in the transmittal.

{$Formula$}{$FolderRepeater.Index$} + 1

Indicates that this template line needs to be repeated for every folder in the transmittal.

{$Formula$}{$RecipientRepeater.Index$} + 1

Indicates that this template line needs to be repeated for every recipient in the transmittal.

{$Formula$}{$ReferenceRepeater.Index$} + 1

Indicates that this template line needs to be repeated for every reference in the transmittal.

Tags: ProjectWise Deliverables Management

Incorrect sizes generated when creating iCS for PDF renditions

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by marion powell on 12/27/2016 3:25:21 PM
Product(s):Bentley i-model Composition Server
Version(s):08.11.11.590
Environment:N\A
Area:N/A
Subarea:N\A

Problem Description

When I submit a PDF Rendition, the size of the pdf is incorrect.  It does not correspond to the paper size set in the settings file being used in the Source File Presentation in PW Admin.

Steps to Resolve

  1. An invalid printer was set in the IP.CFG file on the iCS for PDF server. Setting the IP_DCS_RENDITION_PRINTER variable to the default settings of "ProjectWise Dynamic Composition Server" corrected the problem.
  2. IP.CFG is located in the following directory on the iCS for PDF server: C:\Program Files (x86)\ProjectWise InterPlot Organizer\config
 Original Author:Marion Powell
Tags: 08.11.11.590, Bentley i-model Composition Server, ProjectWise, en, SELECTsupport

Integration - AutoCAD - ProjectWise Explorer Client V8i

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Van Kendall on 12/29/2016 7:41:37 PM

Enable / Disable integration - Integration - AutoCAD - ProjectWise Explorer Client V8i

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Van Kendall on 12/29/2016 7:42:20 PM

Getting error, "Exception in idacad19_1odma.arx ARX Command" opening AutoCad 2014 files.

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Van Kendall on 12/29/2016 7:42:20 PM
 Product(s):ProjectWise Explorer Client V8i
 Version(s):08.11.11.605
 Environment:Windows 7 64 bit
 Area:Integration - AutoCAD
 Subarea:Enable / Disable integration

Problem

User is getting the following error when opening AutoCad files from ProjectWise Explorer V8i SS4 version 08.11.11.605. The user has AutoCad 2014 loaded with the ProjectWise Integration Module for Autodesk AutoCAD 2104 version 08.11.11.749

 
"Exception in idacad19_1odma.arx ARX Command"
"Unhandled Exception C0000005 (Access Violation Reading 0x0000) at address 9718EC58h"
 

Solution

Removing the ProjectWise Integration Module for Autodesk AutoCAD 2104 version 08.11.11.749 and loading the ProjectWise Integration Module for AutoCAD 2014 version 08.11.11.855 fixed the issue.





 Original Author:Van Kendall
Tags: Enable / Disable integrationWindows 7 64 bit, 08.11.11.590, Integration - AutoCAD, ProjectWise, ProjectWise Explorer Client V8i, en, SELECTsupport

MISC - ProjectWise Explorer Client V8i

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Raul Guerrero on 12/30/2016 1:48:13 AM

Last Error 58030 Unable to create new document version

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Raul Guerrero on 12/30/2016 1:48:13 AM
Product(s):ProjectWise Explorer Client V8i
Version(s):10.00.01.67
Environment:Windows 7 64 bit
Area:MISC
Subarea:N\A

Problem Description

Last Error 58030
Unable to create new document version.
Unable to create a directory for document version.
Getting Last error 58030, couldn't create folder when attempting to version a file.
The problem started when IP addresses were changed. The caching server was given a new IP address as well. The user has modified all DMSconfigs to the new IP address.
Steps to Resolve

Steps To Resolve

DNS issue. Had user report findings to their network group.
This issue was resolved when the old IP address was found in the Hosts file in the ProjectWise Integration server. Once they updated the Hosts file everything starting working as expected.

 

See Also

http://communities.bentley.com/products/projectwise/content_management/w/wiki/13671.error-58060-error-creating-a-new-folder-cannot-createdelete-folders-solution-500000090006

 Original Author:Raul Guerrero
Tags: MISCWindows 7 64 bit, 10.00.01.67, ProjectWise, ProjectWise Explorer Client V8i, en, SELECTsupport

Field Data Management

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Jesse Dringoli on 1/3/2017 2:31:19 PM

This is a placeholder article for Field Data Management

Example article on Field Data Management

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Jesse Dringoli on 1/3/2017 2:32:01 PM

Just a test article

Another example article

$
0
0
Revision 1 posted to Project Delivery: Content Management Wiki by Jesse Dringoli on 1/3/2017 2:32:15 PM

Just a test

Bentley i-model Composition Server V8i

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Jesse Dringoli on 1/3/2017 3:32:16 PM

Folder descriptions displaying instead of name?

$
0
0
Current Revision posted to Project Delivery: Content Management Wiki by Molly Watts on 1/6/2017 3:07:28 PM

Original Question: Folder descriptions displaying instead of name? by Martin Aitken

I (and others) have folder description being displayed in the tree view instead of the names.

I have been told to untick the "Display Descriptions" box in the Setting tab but I do not have that option available.  This is the view I have had since getting access to PW so I haven't changed anything myself.

Can someone advise please?

Thanks

 


Verified Answer: RE: Folder descriptions displaying instead of name? by Jeff Burrill

It appears that your account isn't granted the option to "Allow user to change settings" in the User Interface node (where the setting "Display descriptions" resides), which is why it does not appear in the node list. In fact, with the exception of Document List, it looks like your account is not permitted to make changes to any of the other settings nodes.

If you are an administrator you can make the change in ProjectWise Administrator. If not, you'll need to talk to your ProjectWise admin person to get the setting changed.


Question: RE: Folder descriptions displaying instead of name? by Martin AitkenThanks Jeff, I have contacted the administrator to see if they can do this for me
Question: RE: Folder descriptions displaying instead of name? by JRODLook under your User options, settings tab, User Interface then look for "Display Descriptions" if it is checked you will see Descriptions instead of file or Project names.

Viewing all 1890 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>