Topic
3 replies Latest Post - ‏2013-07-12T14:53:15Z by ChrisAnnal
stevenson
stevenson
19 Posts
ACCEPTED ANSWER

Pinned topic Simple For Script

‏2013-07-08T15:45:24Z |

I just want to delete all entries in a column for a given attribute.  So I wrote this:

for <attribute> in current do
{obj=void}

And tried these:

1)     string delete(Module, AttrDef <attribute>)

2)     <attribute> = modify(<attribute>, setDefault, void)

Unfortunately, I'm somewhat new to DXL and can't seem to troubleshoot the faults or use the DXL help very well.  Additionally, I'd like to be able to highlight a group within a column and delete them, but that may be overly complicated.

 

  • GregM_dxler
    GregM_dxler
    162 Posts
    ACCEPTED ANSWER

    Re: Simple For Script

    ‏2013-07-08T19:37:52Z  in response to stevenson

    Might be worthwhile to get a class in dxl.

    To delete all entries for an attribute "_CR number" you can try the following script:

    Object o

    string attr = "_CR number"

    for o in current Module do {

       o.attr = null

    }

    Hope this helps,

    Greg

  • Tony_Goodman
    Tony_Goodman
    270 Posts
    ACCEPTED ANSWER

    Re: Simple For Script

    ‏2013-07-12T10:24:54Z  in response to stevenson

    I am curious to know why you are attempting to do this using DXL.

    This sort of operation is best done using the user interface.

  • ChrisAnnal
    ChrisAnnal
    64 Posts
    ACCEPTED ANSWER

    Re: Simple For Script

    ‏2013-07-12T14:53:15Z  in response to stevenson

    As Tony suggested, the best approach may be to simply use the built-in tools of DOORS, rather than writing a script in this case.

    • Right-click on an object
    • Select "Properties"
    • In the Properties dialog, select the "Attributes" tab
    • For the selected Attribute, use the "View/Edit" button to make the necessary change. In this case, you could use to select the default, which should remove any existing choice
    • Use the additional radio buttons for applying the change to just the Current object, Selected objects, or Objects in current view

    You can use this method to make changes to a large number of objects at once. I hope this helps.