Projectwise API and C#

A general question:

 Has anyone had luck manipulating the Projectwise API using C# and the .net framework? I've seen a few 'sample' snippets out there, but none of them compile or come close to working. I'm interested to know if anyone has used the API and been able to do interesting things like: navigate the project hierarchy, create sets of drawings, chnage the status on a drawing, etc. 

Any help or insight would be appreciated. We can even take the discussion to email if you would like. Thanks, in advance.

Mark

Parents Reply Children
  • Dear Michael,
    We are hitting on the question of whether to move from C++(MFC) to C#, we have a good code base that implements hook call backs, menu call backs, custom project property pages, Creates Save Searches at login etc as well as some standalone server based administrator tools.


    Thank you for your clear  and simple example.


    It looks like the C header files have to be translated to the "#region Projectwise DLL Imports" as do the types and structures in your example, for a simple create project example = ok but with all the structures and types we have used I fear any porting would mean some serious work just to in produce the import section. Some of the API calls in your example require wrapper functions for example Guid aaApi_GetDocumentGuidProperty(int PropertyId, int Index) may be there are more in this category ?

    * Is a complete .net import section for the whole API available from Bentley (or will it be in the near future or via special criteria) ?

    * One detailed question how would a API call back function (hook function/menu call) be implemented in C# .


    There is considerable pressure from our IT.Dept to start new work in C# or other dotnet language.
    Best Regards,

    Ian Emery

     

     

     

     

     
  • Ian Emery:

    We are hitting on the question of whether to move from C++(MFC) to C#. We have a good code base that implements hook call backs, menu call backs, custom project property pages, Creates Save Searches at login etc as well as some standalone server based administrator tools.

     You will not be able to create PWE customizations using .NET; PWE is a native code application, and cannot host the CLR.

    Ian Emery:

    * Is a complete .net import section for the whole API available from Bentley (or will it be in the near future or via special criteria) ?

     

    We currently do not have any plans to release or support any kind of .NET wrapper for our ProjectWise public API. What little wrapper code we have is quite incomplete WRT the entire published API, and exists solely to handle certain internal programming tasks. It is nowhere near being polished enough for public consumption.

     

    Ian Emery:

    * One detailed question how would a API call back function (hook function/menu call) be implemented in C# .

    You would need to create an interop delegate function.

     HTH

     Mike



  • Ian,

    At this point in time there is not a “complete .net import” available. As you can see that wrapping native code with .NET is not always a simple thing to implement. You will need to make the decision if this is cost effective to port to .NET. As we integrate more .NET technology into ProjectWise there will be a need for a .NET ProjectWise API. There are no timelines that I know of on when or if this will happen. To answer your question on call backs in C# one method comes to mind. You can write your .NET wrapper class as a COM object. You will then write what you want to do in .NET in this class. In ProjectWise you can write the C/C++ dll that will implement your com object and you can react to the Hooks and menu items as desired using the .Net of choice.  Just a thought.

    Mike



  • Hi there
    We are using Pw SDK and .NET at Swedish Rail Administration.
    We have built our own wrapper. The problem we have sometime is to convert c/c++ datatypes to c# datatypes outherwise its working nice..



    Does anyone know when v8i SDK is released and if there is and SDK for the webparts ?

    Best

    /Henrik/

     

  • The ProjectWise V8i SDK will be released by the end of the week. We did the final build last night.