![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: How do you count the number of links in a linkset? Topic Summary: Created On: 6-Mar-2003 18:51 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: As it turns out, I was counting linksets in the link module when I thought I was counting links. You have to open the source formal module once you know the source and target ends of the linkset and then look for links in the formal module matching the linkset pair. I could probably do this more efficiently using skiplists, but here is one method that works for counting all links in a project by linkset. Regards, T.J. | |
![]() |
|
I have a script that all are welcome to use which writes all of the link modules and linkset pairs to a csv file for the currently selected project. It should work for DOORS 5.x and higher. The problem I am trying to solve is in lines 42-44 of the file where I try to count all of the links in the linkset. Any help is much appreciated.
|
|
![]() |
|
![]() |
|
T.J.,
In your listLinksets() function, you are looping through objects in a link module. Each one of these objects represents a link. They themselves are not linked to, so the construct: for lnk in o <- "*" do will not work, and is not supposed to work, for link objects. That construct is for objects in a formal module. If you just want to count the links, just count the number of link objects in the link module. The link object can reveal attributes of the link, such as: o."Source" o."Target" which are the source and target modules for the link. Put together, that essentially gives you the "linkset" ( source -> target ) pairing. Also, you are setting "numLinks = 0" INSIDE the loop. That is a bad thing. ------------------------- Michael Sutherland michael@galactic-solutions.com http://galactic-solutions.com Edited: 6-Mar-2003 at 19:29 by Michael Sutherland |
|
![]() |
|
![]() |
|
T.J.
Michael was quicker on the draw than me, but you might also consider changing line 55 from: for itm in all f do { to: for itm in current Project do { This will recursively list all items in the project (or so it seems in the code I am currently working on). Mark ------------------------- Mark Phillips mark.phillips@swri.org |
|
![]() |
|
![]() |
|
As it turns out, I was counting linksets in the link module when I thought I was counting links. You have to open the source formal module once you know the source and target ends of the linkset and then look for links in the formal module matching the linkset pair. I could probably do this more efficiently using skiplists, but here is one method that works for counting all links in a project by linkset.
Regards, T.J. Edited: 7-Mar-2003 at 21:15 by T.J. Theodore |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.