Module m = current
Object o = current m
or simply the short form
Object o = current
who both should deliver the current object of the current module
work fine when invoked from within a module (Tools->Edit DXL).
The same thing done from within the Doors Database window
(also: Tools->Edit DXL) or via a COM client object
(JScript on Windows scripting host):
var oDoors = new ActiveXObject('DOORS.Application');
oDoors.runStr("Module m = current\nObject o = current m");
leads to
-R-E- DXL: <Line:2> null Module parameter was passed into argument
position 1
-I- DXL: execution halted
Any ideas??
TIA,
Robert
I think the problem you are running into, if I understand you
correctly, is because
the "Current" operation determines what the currently selected object
(or module) is
and assigns your variable to it. If you run DXL from the main window,
there is not a selected
module (nor object for that matter), so current returns null.
To run a script from the main window, you need to select the module and
object within that
module via other means. There are a variety of ways to get a handle on
a module you are interested
in (loop through the project to find the module of interest, etc). It
depends on what you are trying to do
as to which method is the best.
Hopefully I am correctly addressing your concern.
Doug
as there can be a selected module - e.g. the module last focussed -
there should be a current module available, at least if there exists a
last opened module window.
When I tried the code there allways was a last opened module as I
wanted to see the results from my code exactly there.
It is possible to find the current module for a Doors client, as there
is an application that does exactly this (Matlab/Simulink, Toolbox
'Verification and validation' since the current updated version). But
as the code is not delivered with that product I can't look it up
there. It may also be done via the Doors C-API and is possibly not
feasible via dxl.
Anyway, thanks for your efforts,
Robert
The undocumented 'getSelectedItem()' function returns the Item that is
currently selected in the main 'DOORS Explorer' window. Is that any
help?
Robert