Solids Builder - Get Property
Get Property - gets the value of the properties of devices connected upstream or downstream of the
current device.
It also allows you to get information that doesn't appear in the when of constructor properties, such as the top dimension of structures:
The Get Property activity has the following properties:
-
Name - variable name
The variable name must follow the naming rules
-
Index - applies only to the case of Search Device for Entries, in this case it informs the number of the entry to be searched
Note, the index is based on ZERO.
- Parameter Name - name of the property to look up on the device (see the topic Devices / Property Categorization to find the properties names)
-
Variable Type - informs the type of variable being created.
Note, the created type may not be compatible with the type of the obtained value and in this case, it causes an error
-
Search Device - tells which device should be searched:
-
Device - the device itself being modeled
In this case, this activity is used to obtain information that did not come in the property creation framework, such as the top elevation in manholes
-
Inputs - searches for devices connected upstream
it is used to obtain the arrival quota of pipes in the manhole, for example
-
Output - searches the device connected to the output of the device being modeled
it is used to obtain the thickness of the pipe and apply the same value to the wing, if the device being modeled is a wing
This activity should be used in conjunction with the TryCatch activity as it may cause the runtime errors:
-
In edit mode - Occurs while editing the model.
While editing, there isn't a device being modeled, so there's no way to get anything
-
No output device - occurs when the search Device option is equal to Output but there is no device connected to the output
For example: it is necessary to check if the dimension of the pipe connected to the outlet is compatible with the dimension of the bottom of the manhole and adjust the dimension of the bottom if
necessary
-
Index is out of range - occurs when the search Device option is equal to Entries but the Index b> informed
is less than ZERO, or greater than the number of devices connected to the input minus 1 (the first index is zero)
-
There is no input device at this index - should not occur, as the error above predicts this situation.
However, something unexpected may happen anyway
-
This property does not exist - The property informed in the Parameter Name field does not exist in the device
Example: searching for "CD" (dimension of the lower downstream internal generatrix) on a ladder does not make sense on ladders, only on Pipes
-
The property is of a different type - if the property exists, it could be that it is of a different type and this error occurs
Example: searching for "PipeLines" on pipes returns an integer, but setting the Variable Type field to Point will cause this error
because it is not possible to convert an integer to a point
Consider the example from the beginning.
This example shows the typical flowchart to obtain the lowest elevation of the lower downstream generator of connected pipes in a manhole:
The algorithm is quite simple:
- Create a variable to receive the minimum value to be calculated (DCminimum), define it as positive infinity
- Create an incrementing variable (nEntry), to get the nth device from the upstream, set it to ZERO
- Get the value or from CDin of nth tube
- Compare CDin with MinimumCD and if smaller,
- Save the CDin value in MinimumCD
- Increment the index and
- Back to step 3
Note that this looping does not check the device number in the input and it is not even necessary, because in the case of trying to obtain the CDin value with a
index greater than the number of entries, an error will be thrown, which is trapped by the TryCatch activity
In case you want to get a property of the current device, or of the output, looping doesn't make sense.
But you still have to use the
TryCatch as other errors may occur.
Also note that depending on the property you want to obtain, it may be out of date when calling this activity.
The above example is the case as the "CD" Elevation is only updated at the time the pipe is rebuilt.
In this case, it will be better to get the "EndPoint" of the pipe and the "Diameter", as these usually do not change during the pipe reconstruction, and then calculate an
variable:
CD = EndPoint.
Z - Diameter / 2
Where:
CD = Elevation of the lower internal generatrix at the end of the tube
EndPoint = coordinate of the end point of the tube
Diameter = nominal or internal diameter of the pipe
Also note that for the purpose of reconstructing the pipe, its three-dimensional axis is located in the center of the cross section, so Diameter/2 in the equation above