In the API I can set a water level to a section as part of g_i.soils, however due to the presence of reinforcement I can't always know what the index is for soil on the left and soil on the right. Knowing the y position of each object in g_i.soils would help massively, but was also wondering if there's a better way to set the water levels for each side of the wall.
Dear Iman,
Usually, I handle Polygons instead of the user feature Soil, but it works the same way. Indeed, after the Mesh mode, all geometric information of polygons are not present as they are not relevant anymore.
However, you can use the BoundingBox property of a polygon to get the coordinates that refer to that object.
E.g. echo Polygon_2_1.BoundingBox
For Python, you will need to do some parsing of the string/text but it is possible.
Another way of ensuring you assign properties to a specific object is to work in advance and create it specifically and possible even rename it. For instance, in Structures you can define a polygon on the left side and a separate on the right side, call them, e.g., Clay_Left and Clay_Excavation, Clay_Right (please choose more descriptive names) and then in Flow Conditions / Staged Construction you can run:
for polygon in g_i.Clay_Left: polygon.Soil.WaterConditions.Conditions[g_i.Phase_9] = "Custom Level" polygon.Soil.WaterConditions.Level[g_i.Phase_9] = g_i.UserWaterLevel_1
Note that the for-loop is needed as we cannot know beforehand in how many polygons the original Clay_Left polygon got split due to intersection, which you would not worry.
For this matching of an object in Structures and Staged construction, the get_equivalent function can also be used. This is explained in our Scripting manual: communities.bentley.com/.../scripting-reference-and-how-to-use-it
Answer Verified By: Iman Warsame
That's great. Thank you very much!