![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Count objects in view Topic Summary: Without using the filter window.... Created On: 14-Aug-2007 14:04 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: The "for object in ... module" loops offer different options; the plain "for object in module" respects filters, therefore the following lines will print the number of objects visible in the current view: Object o int n = 0 for o in current Module do {n++} print n " objects in current view" As for the attribute DXL, something like Object o int n = 0 for o in current Module do { n++ if (o == obj){obj.attrDXLName = n ""} } does the trick, but I doubt it is very clever, as the loop over the module for each object for sure is quite time consuming. I guess it is better to combine the above script with an assignment to an attribute, if you really need the information in an attribute. Regards, Peter | |
![]() |
|
Is there some way to count the number of objects in a view without using the filter window? Is there a DXL that can be placed in an attribute that will sequentially assign a number to each object in a view? Thanks, Corey.
|
|
![]() |
|
![]() |
|
The "for object in ... module" loops offer different options; the plain "for object in module" respects filters, therefore the following lines will print the number of objects visible in the current view:
Object o int n = 0 for o in current Module do {n++} print n " objects in current view" As for the attribute DXL, something like Object o int n = 0 for o in current Module do { n++ if (o == obj){obj.attrDXLName = n ""} } does the trick, but I doubt it is very clever, as the loop over the module for each object for sure is quite time consuming. I guess it is better to combine the above script with an assignment to an attribute, if you really need the information in an attribute. Regards, Peter |
|
![]() |
|
![]() |
|
Thanks, Peter! The attribute DXL did the trick!
|
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Count objects in view
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.