I am very new to Bentley products and am trying to use the ProjectWise API within an AutoCAD environment. I have been programming in VB.NET only for AutoCAD and have no experience with C++ and C#. Any C# code I have needed I translated online.

We have PW V8i S3 installed on the company server which our section is piggybacking off. I am trying to do some simple information retieval from the PW database in AutoCAD. Initially I just want to get attribute information for drawing that is currently open.

I have read as much as I can about this but it all seems to not add up to me yet.

I have tried using DLLIMPORT to make the C++ function available to use in VB.NET. Example is here.

    <DllImport("dmsgen.dll", CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Unicode, entrypoint:="aaApi_CountAllEnvAttrDefs")> _
    Public Function aaApi_CountAllEnvAttrDefs() As Long
    End Function

This is returning an error. I only used this as I thought I didn't have to pass any information to the function. Is this how I access the functions in general.

Ideally I would like to get a list of the attributes for current drawing and be able to pick the ones I want and retrieve their values.

Any help or code would be greatly appreciated.