At 05:53 PM 5/13/2002 +0200, WALDENMAIER,DIRK (HP-Germany,ex1) wrote: >Hi, > >does anybody know if you can directly use the "Count Entity Usage" with ACL. >I get the entity names with the file_entity_names function and just want to >count how often the entity is used. > >Thanks, >Dirk
You can search for "tags" named <_file_ent>.
These tags (which only exist in the in-memory Epic representation) wrap around the file entity contents.
The entity name is returned by calling the entity_name() function on the oid of a <_file_ent> tag.
Or, you could search for the entity name as a value of the attribute "entityname" (this is an attribute of _file_ent). This value is the name prefixed with "&".
local arr oid_find_child_attrs(oid_null(), arr, "entityname", "&myent")
fills the array arr with occurrences for the file entity named "myent" (the array values are OIDs of the <_file_ent> tags) and the return code of oid_find_child_attrs() is the number of occurrences.
Similarly, you could use oid_find_children() to get all of the <_file_ent> OIDs, and loop through them to count occurrences.
It's a bit more complicated if you're using a version earlier than Epic 4.1--back then the file entities were represented using two different "tags," depending on how they were displayed. In the current Epic, file entities look the same in the Epic tree, regardless of the view.