2

I have read lots of posts and can't be able to do what I want.

I'm using DOORS 9.5

My goal is to execute a script at doors startup, which uses GUI functions. I have tried 2 different ways without success.

1/ To run with command line -D "#include <test.dxl>" but I have the following error:

-E- DXL: <addins/TWEXP/include/parastyl.inc:39> (AParaStyle_) already declared in this scope

Included from: <addins/TWEXP/include/batch.inc:32>

If I put the following code : #include <test.dxl> (the same given as parameter on the command line) in the DXL interaction window and click on RUN it works.

Any idea ?

2/ I was trying to execute it from C#:

using DOORSCOMLib;

DOORSCOMLib.DOORS x = new DOORSCOMLib.DOORS();

But I read here: https://jazz.net/dxl/html/522%20-%20Getting%20Requirements%20from%20Module%20with%20C.html that the DOORSCOMLib should come with the installation of DOORS.

I can't find it. And I don't know how to link it to my C# script (I have never done any C# but it seems to be a good way to execute DXL scripts on a running DOORS instance.)

Best regards, Cédric

2 Answers2

0

About 1/

Check your includes & the answer given at https://www.ibm.com/mysupport/s/question/0D50z00006HILKvCAP/running-dxl-script-in-the-background by Mathias Mamsch, that should give you a hint. Short excerpt: “DOORS is using a different set of include files, when running in batch vs. interactive mode. […] that [error message] means that you quite certainly included the same include file twice. Check your startup.dxl vs. your startupBatch.dxl in your lib/dxl folder of your client to see the differences in the include file.”

About 2/

I never used C# either, but https://www.ibm.com/mysupport/s/question/0D50z00006HIG4cCAH/dont-find-doorscomlib seems to say that it is sufficient to add a reference to the library (doors.tlb, should be included in the bin directory your installation area) to SharpDevelop

Mike
  • 2,098
  • 1
  • 11
  • 18
  • Hi, for the 2/ when I try to add the doors.tlb in visual studio via Project -> add COM reference I have the following message: The reference is invalid or unsupported – cdallagnola Sep 09 '22 at 08:12
  • sorry, that's not my expertise. Perhaps you can get an answer at https://www.ibm.com/mysupport/s/forumsproduct?id=0TO50000000IVrXGAW&language=en_US or open a case with IBM – Mike Sep 14 '22 at 13:38
0

I finally get rid of this issue, but with a first solution, I did it in python.

You need to install pywin32 lib.

import pythoncom, win32com.client
import subprocess
import time

file = 'C:\\Program Files (x86)\\IBM\\Rational\\DOORS\\9.5\\bin\\doors.exe'
p = subprocess.Popen([file, "-u", "XXX", "-P", "XXXX"])

time.sleep(30)

doors = pythoncom.LoadTypeLib('doors.tlb')

xlApp2 = win32com.client.Dispatch('Doors.Application')
xlApp2.runStr("#include <C:\\test.dxl>")

Thanks for your help !