Hi there,
I would like to ask you a question. Let say I created 10 polygons through a python environment, e.g.: "g_i.polygon(--insert coordinates here--)". These polygons will be automatically named "Polygon_1", "Polygon_2", etc until "Polygon_10" in the exact order of their creation (e.g.: "Polygon_1" is created before "Polygon_2" and so on).
However, if I wanted to activate "Polygon_1" through a command "g_i.activate(g_i.polygons[0], g_i.InitialPhase)", it was "Polygon_10" that was activated. I am a bit confused here, why doesn't the activation correspond to the first polygon ("g_i.polygons[0]" or "Polygon_1")?
However, if I set a material to a polygon, e.g.: "g_i.setmaterial((g_i.polygons[0].Soil), clay)", it works as expected (the "clay" material is assigned to the first polygon, which is "g_i.polygons[0]" of "Polygon_1").
Is there a certain rule on why "g_i.polygon[0]" in some cases refers to "Polygon_1", but refers to "Polygon_10" in other cases?
Thank you very much for your time and assistance.
Best regards,
M. Rayyan
Dear Muhammad,
That is rather odd. I will test this and come back to you.
Can you please specify which version of PLAXIS you are using?
Hi Stefanos,
I am using Plaxis version 21.01.00.479.
Thank you for your time and attention.
Hello Muhammad,
We have identified a bug in the PLAXIS 2D code which creates this issue. Unfortunately after the intersection, the code does not "remember" the creation order and naturally, it recreated the objects in a new order.
That, of course, affects the predictability of your code, so for now you will need to either generalize or add extra checks to ensure that you are handling the polygon you want (e.g. bounding box?).
Our developers are working on a fix for this.
Answer Verified By: Muhammad Rayyan
Dear Stefanos
Thank you very much for your time and response.
Regards,