Dear Support Team,
For example, I have five phases of embankment staged construction with Plastic calculations:
After successful calculation I would like to calculate the same phase sequence (the same five stages), but with Consolidation type of calculation (or another activated structures). An alternative solution, like this:
Maybe, it is not very difficult for five phases, but it can be an issue to set the same 15–20 phases manually.
Could you please inform me whether it is possible to copy phase sequence?It is interesting to copy activated geometry and phase settings. Maybe we have possibilities of regenerate, set, groupfiltered and apply options for optimisation.
Great thanks in advance.
Dear Rushan,
This case can be easily handled using Python scripting.An example of code can be found below (hopefully it will be uploaded with correct indentation):
# for every phase in the projectfor parent in g_i.Phases[:]: # if it's a plastic phase if parent.DeformCalcType == parent.DeformCalcType.plastic: # create new child phase newphase = g_i.phase(parent) # set it to safety newphase.DeformCalcType = newphase.DeformCalcType.consolidation
Answer Verified By: Rushan Gizzatullin
Dear Stefanos,
I've got the same question and I simply want to create a new phase sequence.
can I directly create a file as follows:
for parent in g_i.phases[:]:
newphase = g_i.phase(parent)
thanks a lot!
Dear Yusha,
Yes, you can. Be careful with using the proper object names as Python does not accept typos: g_i.Phases , is the correct object name of the phases group.
The code that I added has some if-statements to check for a calculation type, but if you remove those, you end up with the code you suggest, too.
Note that the best is to try your code directly in a simple project. If you have problems with that, please submit a service request.
Then, one of our support engineers can help you in detail: https://apps.bentley.com/srmanager/ProductSupport
Hi Stefanos,
Thanks for the help, I have successfully run the script.
However, this is not what I expected.
I wish the new generated phase could be following phase 39 and the same for the rest, not subphase individually after each phase.
how should I edit my code?
Thanks a lot!
Yusha Shi
Dear Yusha Shi,
Then, I would use a different approach as your question is indeed different from the topic here.
In your case, you need to know how many phases you want to create. Then you can use the simple range function and for creating a phase starting from the lastly created phase you can use the g_i.phase(g_i.Phases[-1]) command.
For instance, you can create ten phases using the following code:
for n in range(10): g_i.phase(g_i.Phases[-1])
Dear Stefanos:
Yes it works! However, the new generated phases are empty and I still need to input the parameters manually. the computer did not "copy" the phases I already created, instead just creating a new phase sequence.
When you create a phase starting from another phase any geometry settings are copied from the parent phase. Any phase configurations are set depending on the case, i.e. default is Plastic phase with the available options this type offers.
However, with Python you can easily, query the settings of the parent phase and set them accordingly to any child phase.
If you still have issues with this process, please submit a service request.