I have been asked if it is possible to filter in a module on certain absolute numbers.
For example, I have a script that generates an output file that shows certain absolute numbers of each object in a module that match criteria. Another person now would like to see if it is possible to filter on the output file, so that only the absolute numbers present in the output file are shown. I have been looking in the DOORS 9.4 manual, and see that it is possible to filter on text, and columns, but do not see anything specific to absolute numbers.
Has anyone written a script that performs this? If not, is it possible?
Thanks Gedinfo - Wed Oct 01 15:39:06 EDT 2014 |
Re: Apply a filter of specified Absolute numbers using DXL You should be able to use filters like: Filter f = (attribute "Absolute Number" > "20") && (attribute "Absolute Number" < "99") set f filtering on However for complex ranges, e.g. 1000 different absolute numbers this will get quite some large filter that will probably blow up something. Then you got the option to use "accept" and "reject" to specifically select single objects from the current module inside the filter.
Object o; for o in entire current Module do {
int nr = o."Absolute Number";
if (nr > 20 && nr < 99) accept o; else reject o;
}
filtering on
Here you can have the list of objects to filter inside a skip list in DXL for fast execution, however the problem here is, that this way you cannot store the filter inside a view, because "accept/reject" is not a real filter. The last possibility you got is to make a DXL attribute or DXL layout column that will contain a value, that can be filtered on: int nr = obj."Absolute Number"; if (nr > 20 && nr < 99) display "Filter me" Then you make a filter "Column contains 'filter me'. This way you can store the filter also in a view. Hope this gives you some ideas. Regards, Mathias |
Re: Apply a filter of specified Absolute numbers using DXL Mathias Mamsch - Wed Oct 01 18:16:35 EDT 2014 You should be able to use filters like: Filter f = (attribute "Absolute Number" > "20") && (attribute "Absolute Number" < "99") set f filtering on However for complex ranges, e.g. 1000 different absolute numbers this will get quite some large filter that will probably blow up something. Then you got the option to use "accept" and "reject" to specifically select single objects from the current module inside the filter.
Object o; for o in entire current Module do {
int nr = o."Absolute Number";
if (nr > 20 && nr < 99) accept o; else reject o;
}
filtering on
Here you can have the list of objects to filter inside a skip list in DXL for fast execution, however the problem here is, that this way you cannot store the filter inside a view, because "accept/reject" is not a real filter. The last possibility you got is to make a DXL attribute or DXL layout column that will contain a value, that can be filtered on: int nr = obj."Absolute Number"; if (nr > 20 && nr < 99) display "Filter me" Then you make a filter "Column contains 'filter me'. This way you can store the filter also in a view. Hope this gives you some ideas. Regards, Mathias Hi Mathias > Then you got the option to use "accept" and "reject" to specifically select single objects from the current module inside the filter. Both, accept and reject are blowing up the filter too. Best regards Wolfgang |
Re: Apply a filter of specified Absolute numbers using DXL To clarify: You can
If you have somelist of the exact absolute numbers you CAN define a "Filter" "or"ing whether the Absolute Number matches. I'm guessing however that your original script calculates whether an object qualifies for your original export, in which case you can use that criteria with accept/reject. So maybe you can tweak your original script to look like this:
-Louie
|
Re: Apply a filter of specified Absolute numbers using DXL I use the accept/reject method to perform the filtering.
Thanks for the suggestions! |