![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Retrieving objects by object number Topic Summary: Created On: 23-Jan-2009 15:55 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hi,
I'm trying to retrieve various object from a module by Object Number. I know we can retrieve objects either by Absolute Number ( gotoObject (int absno, Module m) ), or by position in a displayed module (first (object O), last (Object o) etc.). However I would like to get the first and last object in a module, regardless of what is displayed in the current view. The only way I know how is to use the: for o in entire (module) do {...} loop. This is rather inefficient, especially if I wanted to retrieve the very last object in a large module. Is there another, more direct way? Thanks. Agustine |
|
![]() |
|
![]() |
|
Hi Agustine,
You can use Object o = first m or o = last m where m is the module. However this works on whatever is displayed in the current view..you might have to turn off filtering/sorting to get the actual first and last objects. Rgds, Uma |
|
![]() |
|
![]() |
|
Most of those goto object commands 'respect' the current display set, so you cannot gotoObject that isn't displayed. That makes the lot of them practically worthless.
Using Object Number has a rather odd limitiation: non-displayed deleted objects often share the exact same Object Number as a sibling object. If you create three objects under section 1, their AbsNo(Numbers) are: 2(1.1), 3(1.2), 4(1.3). If you delete object 3 and don't show deletions, what you see is 2(1.1), 4(1.2). What's the number of object 3? Well, its also 1.1. And if you then show deleted objects, then the original association of Numbers to AbsNos applies, changing the Number of 3 and 4. Yuuuck. I'm guessing that the last(obj) command likewise 'respects' the display set, making navigating around non-determinant. Not sure what to tell you, but perhaps put all the Objects in a Skip List, using [for obj in entire mod do] loop, and then go from there. - Louie |
|
![]() |
|
![]() |
|
Wow, I forgot about deleted objects...that could be a problem then. I was hoping to avoid getting and parsing through all the objects, but it seems like there's no other alternative.
Thanks for the tips though. Agustine |
|
![]() |
|
![]() |
|
There is an alternative!
Looping through object's descendant ignores current filter and sort, but not the "display deleted objects" parameters. So you have to recursively loop through "top current Module", then on each descendant. test this on a sorted module: Object o for o in top current Module do print (identifier o) "\n" ------------------------- E. Piallat CeBeNetwork |
|
![]() |
|
![]() |
|
Thanks Eric!
That's definitely an alternative to retrieving every single object. |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Retrieving objects by object number
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.