SubItem_PropValues

miscellaneous-functions Subitem_PropValues

syntax

  • Subitem_PropValues(item, property)
  • Subitem_PropValues(item, attribute)

definition

  • Subitem_PropValues(item, property) results in a new uint32 domain-unit with a string attribute containing the property values of the direct subitems of the item argument. The name of this attribute is the name of the property.
  • Subitem_PropValues(item, attribute) results in a new uint32 domain unit with a set of string attributes containing multiple property values of the direct subitems of the item argument. The names of the resulting attributes are the names of the properties.

applies to

  • argument item can be any tree-item.
  • argument property needs to be a valid property name, the list of all properties can be found here.
  • argument attribute needs to a string data-item.

since version

7.102

example

1.
container PropValueSource
{
   parameter<string> label:['ABC'];
   parameter<uint32> sumNrInhabitants (ADomain): [2,5,3,2,0];
   unit<uint32>      domainA: nrofrows = 9;
   unit<float64>     valuesB := baseunit('b', float64);

   container sublevel
   {
      attribute<uint32> meanNrInhabitants (PropValueSource): [1,2,1,1,0];
   }
}

unit<uint32> name := SubItem_PropValues(PropValueSource,'name');
unit<uint32> expr := SubItem_PropValues(PropValueSource,'expr');
2.
unit<uint32> property : nrofrows = 2
{
   parameter<string> name: ['name','expr'];
}

unit<uint32> name_and_expr := SubItem_PropValues(PropValueSource, property/name);
name
label
sumNrInhabitants
domainA
valuesB
sublevel

domain name, nr of rows = 5

expr
 
 
 
baseunit(‘b’,float64)
 

domain expr, nr of rows = 5

name expr
label  
sumNrInhabitants  
domainA  
valuesB baseunit(‘b’,float64)
sublevel  

domain name_and_expr, nr of rows = 5

see also