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
  • Dalius is correct; currently the ProjectWise API is a C API. However in ProjectWise 8i we have .NET API for Web Parts. This does not mean you cannot use C# with ProjectWise. You can use P invoke to call the ProjectWise API. I placed a simple example showing how to do this on ftp://ftp.bentley.com/pub/outgoing/PWCSharpExample.zip

    I hope that this will help.



  • 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



Reply
  • 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



Children
No Data