问题
I am using Rational Doors 9.6 as client. I try to integrate a feature in my C# program such is using Doors C API, to open a view and get some data in memory for further using. This includes login to Doors server with windows credentials.
Actually, I have to start Doors Client, open that view, do a excel export, then do a C# import which is not quite the elegant way.
I am not Doors expert so all I need is a opinion, since API is in C and I'm not sure this is the way, or just using DXL server (or both?)
I have been used un-managed C dll's in C# in the past, so if proper declared, should be no problems.
Thanks in advance,
回答1:
The DOORS C API is a very old artifact and not usable for your purpose.
You have to use a DXL script to perform the actions inside DOORS that you want (export). To launch the script you have three options:
- invoke the DXL script in batch mode
The most stable approach. You should write the information to a file from your DXL and read it back from your c#. All "professional" DOORS interfaces (like MDWorkbench) use this approach.
- invoke the DXL script in "interactive batch" (see below)
See below. You need to use this if you want to automate an existing GUI DXL script. See an example here:
https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014305335&ps=25
- invoke the DXL script over COM
For this you need to start the client in interactive mode and then connect to it over COM. For a discussion on that see here:
https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014458173&ps=25
For the export itself there are many scripts on the rational forum. The fastest way to go, is to perform a CSV export yourself. See here:
https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014627043&ps=25
来源:https://stackoverflow.com/questions/42627376/rational-doors-9-6-interfacing-with-c-sharp