Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > SDL script for generating code > Keywords > %getlist keyword (SDL script)
  
%getlist keyword (SDL script)
This keyword gets the Modeler items from a global list.
* 
You set the content of a global list through the %setlist. Before setting a global list, you must declare it using the %list keyword.
Syntax
%getlist "<name of global list>"
This example works in the context of a Class. The For loop processes each Attribute of the Class in turn. For each loop, the CurrentObject local list is set to the current Attribute and then the ChildAttributes global list is appended with the CurrentObject local list.
%setlist "ChildAttributes" = ""
%for "Attribute"
%setlocallist "CurrentObject" = "This"
%setlist "ChildAttributes" = %getlist "ChildAttributes" + %getlocallist "CurrentAttribute"
%endfor