Topic
  • 2 replies
  • Latest Post - ‏2014-03-17T20:49:56Z by PRM
AlexCraciun
AlexCraciun
5 Posts

Pinned topic Get value from DOORS module cell

‏2014-03-14T13:59:16Z |

Hello everyone,

I'm new with DXL and I am trying to simply read one at a time the cell values from a specific column, and to be onnest I have a hard time doing this.

So the column name is ID and it contains some requirements ID. I just want to be able to print the value from every cell in that column in the DXL  window.

Can you please provide some code examples.

Thanks in advance !

Have a nice day !

 

  • CWicker
    CWicker
    3 Posts

    Re: Get value from DOORS module cell

    ‏2014-03-17T19:46:14Z  

    I am no expert, but if I don't start helping others no one will help me :)

     

    If I understand your request you are looking for the identifier of the objects (if I understand your terminology the rows are the objects and the columns are the attributes) within a module.

    If the ID you are looking for is the DOORS object identifier then identifier(object) is the way to collect that information.

    If the ID is something else stored in the object attributes you will need to call that attribute directly (in this case "Object Text"). A full list of the object's attributes can be found in the objects properties (in the DOORS module right click properties, the select the Attributes tab). 

    The example below spits out both, you can remove one or the other if they are not needed.

    Object o
    for o in current Module do {
      print identifier(o) ": " o."Object Text" "\n"
    }
    
  • PRM
    PRM
    33 Posts

    Re: Get value from DOORS module cell

    ‏2014-03-17T20:49:56Z  
    • CWicker
    • ‏2014-03-17T19:46:14Z

    I am no expert, but if I don't start helping others no one will help me :)

     

    If I understand your request you are looking for the identifier of the objects (if I understand your terminology the rows are the objects and the columns are the attributes) within a module.

    If the ID you are looking for is the DOORS object identifier then identifier(object) is the way to collect that information.

    If the ID is something else stored in the object attributes you will need to call that attribute directly (in this case "Object Text"). A full list of the object's attributes can be found in the objects properties (in the DOORS module right click properties, the select the Attributes tab). 

    The example below spits out both, you can remove one or the other if they are not needed.

    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">Object o for o in current Module do { print identifier(o) ": " o."Object Text" "\n" } </pre>

    Tip -  there are a number of variants of DXL for/do loops that determine which objects are included in the loop, this can catch you out as your choice of loop may not include objects that you assumed were included, or the loop includes objects that perhaps you didn't want to include. Here is a summary of the various module wide object for\do loops

     

    for o in m do {} //only loops through objects that are visible (display set), will ignore Deleted Objects if they are not set to be visible , includes the cells of native DOORS tables
    for o in document m do {} //same as ..for o in m do.. but will include the hidden table header object for each native DOORS table 
    for o in all m do {} //same as ..for o in m do.. but will include both the hidden table & row header objects for each native DOORS table 
    for o in entire m do {} //Loops through every object regardless of the current display set, including hidden table & row header objects
    

    Paul Miller
    Melbourne, Australia