Argus Holdings
go to the Argus ONE home page Site Map of the Argus ONE site about Argus ONE news and announcements Prices, discounts and classrooms Short overview of Argus ONE Download Argus ONE, PIEs, documentation and tutorials All the Help you Need search the Argus ONE web site
 Home Site Map About News Purchase Products Download Support Search

New features in Version 4


New Export Script Commands


Loop for Objects in Layer

Loop for objects in layer enables you to export objects stored in Information type layers from within a grid or a mesh export template. Future version which will feature export templates for information type layers, will support this loop type as well.



Using Information Type Layer Functions

You can use all available information type layer functions from within this loop. The following example exports all contours in a layer called Domain Outline and for each object exports its name, area, length, type and value of the parameter named Density. It also exports for every contour the X and Y coordinates of its vertices.

Define Variable: i [integer]
Redirect output to: contours.exp
# The following loop will loop for every
# Object (contour) in the Domain Outline layer
# and for each object export some contour information
# and the value of the density parameter.
   Loop for: Objects in layer: Domain Outline
      Start a new line
          Export expression: ContourName(); [G0]
          Export expression: ContourArea(); [G0]
          Export expression: ContourLength(); [G0]
          Export expression: ContourType(); [G0]
          Export expression: Domain Outline.Density [G0]
      End line
# The following loop will export the X and Y coordinates
# of each vertex.
      Loop for: Variable i from: 1 to: NumVertices() step: 1
          Start a new line
                 Export expression: NthVertexX(i); [G0]
                 Export expression: NthVertexY(i) [G0]
          End line
     End loop
      Start a new line
      End line
   End loop
End file


Nesting Loop for Objects in Layer within Loops for Blocks or Elements

You may nest a loop for Object in Layer within a loop over blocks and elements. This enables you to export all objects in a layer which intersect or are contained within a block or an element. Usually you will need to export information by block, however, if your code requires that you list all the objects in all layers per block or element you can nest a loop over objects in layer, within a loop over blocks or elements within a loop over layers.

The following example exports for each blocks the length of intersection of contours in each layer named rivers1, rivers2 and rivers3, as well as the area of intersection between each block and contours in each of the layers named lakes1, lakes2 and lakes3. The functions ContourIntersectLength() and ContourIntersectArea() which are unique to Loop for Object in Layer are described below. Also the use of square brackets as loop variable is also explained below.

 

Define variable: i [integer]
Define variable: j [integer]
Define variable: NumLayers [integer]
Set variable: NumLayers:= 3
#
Redirect output to: rivers_lakes.exp
# Loop from 1 to 3
   Loop for: Variable i from: 1 to: NumLayers() step: 1
#       Loop for Blocks
         Loop for: Blocks
#       Loop for all objects in layers named rivers1,
#       rivers2, and rivers3 and export the length of
#       rivers which intersects with the current block
               Loop for: Objects in layer: Rivers[i]
                    Export expression: ContourIntersectLength() [G0]
              End loop
        End loop
        Loop for: Blocks
#      Loop for all objects in layers named lakes1,
#      lakes2, and lakes3 and export the area of
#      lakes which intersects with the current block
                  Loop for: Objects in layer: Lakes[i]
                        Export expression: ContourIntersectArea() [G0]
                  End loop
         End loop
   End loop
End file

 

Functions unique to loop for objects in layer when nested within a loop for blocks or elements

 Name & Syntax  Arguments  Description & Return Value
 ContourIntersectArea()  no arguments

 Returns the area defined by the intersection of a closed contour and a block or element.

Operates on the information type layer the Loop for Objects in Layer is set to.

Example: In the following illustration the bottom-left block is tested for ContourIntersectArea() and returns for each of the two contours intersecting it, the area of intersection (marked by a different hatch pattern). The areas returned may be exported, added or manipulated using other functions.

Each block is tested in its turn (loop for blocks) with the 3 contours in the information layer (the layer the loop over objects in layer refers to), and returns the area of intersection. The bottom left block is intersected by the contour marked "10" and returns this hatched area.

 
The bottom left block is also intersected
by the contour marked "20" and thus returns
the crossed area as well.

 Name & Syntax  Arguments  Description & Return Value
 ContourIntersectLength()  no arguments

Returns the length defined by the intersection of a closed or open contour and a block or element.

Operates on the information type layer the Loop for Objects in Layer is set to.

Example: In the following illustration the bottom-left block is tested for ContourIntersectLength() and returns for each of the two contours intersecting it the length of intersection (marked by a thick line). The lengths returned may exported, added or manipulated using other functions.

 Each block is tested in its turn (loop for blocks) with the 3 contours in the information layer (the layer the loop over objects in layer refers to), and returns the length of intersection with each of the contours which intersect it. The bottom left block is intersected by the contour marked "10" and returns the length of this thick line.  
The bottom left block is also intersected by the contour marked "20" and thus returns the length of intersection also marked by a thick line.


Looping Over Numbered Layers and Parameters

The square brackets [] notation allows one to automatically concatenate layers and parameter names with a loop variable. This allows you to repeat a sequence of an export template without prior knowledge of the numbers of layers to be exported.

In the following example NumLayers is either a global variable (see"Global Variables" on page 21s in this supplement) or a PIE variable which is set to the number of parameters sharing a name such as Grid.Perm Unit1, Grid.Perm Unit2, etc. As the loop progresses the loop variable i, the layer's and parameter's name, appearing before the square brackets, is concatenated with the value of i to produce the actual parameter name.

Loop for: Variable i from: 1 to: NumLayers step: 1

Export matrix: Grid.Perm Unit[i] [G0]

End loop


Export Arrays

Using arrays in exported templates is supported through an Array PIE. This PIE allows one to initialize, set and get values of a one dimensional array. Any number of such arrays can be used. For details regarding the use of Array PIEs refer to "Array PIEs" on page 53.


To the next page

To find out more about Argus and its products email marketing@argusone.com or call:
+972-9-957-5752
Tech. support: support@argusone.com
snail mail: Argus Holdings, POB 6254, Herzelia, 46160, Israel
Copyright © Argus Holdings, Ltd. 1992-2013