Hi,
I am using python to iterate through phases. there are phases using the plastic calculation and fases using the safety calculation.
for the input side:
for phase in g_i.Phases[:]: if phase.DeformCalcType == phase.DeformCalcType.safety: print('FoS : ',phase.DeformCalcType.safety) if phase.DeformCalcType == phase.DeformCalcType.plastic: print('Plastic : ',phase.DeformCalcType.plastic)
The above code returns "7" for safety calculation phases and "4" for plastic.
for the output side:
for phase in g_o.Phases[:]: print(phase.InputSettings.DeformCalcType)
The above code returns always "4" for safety calculation phases and plastic calculations. Not "7" for safety
Is this a Bug?
How can I separate safety phases from plastic phases on the outputside?
Great to hear that you can use that.
Nobody likes a bug and we will try to find the best way to solve it.
thanks, yes there was an example at the end.
For the ones interested I sorted that out with that snippet to identify the phase types in the output till a bug fix comes out:
for phase in g_o.Phases[:]: inputPhase = g_i.get_equivalent(phase) if inputPhase.DeformCalcType == inputPhase.DeformCalcType.safety: print('I_FoS : ',phase.InputSettings.DeformCalcType) if inputPhase.DeformCalcType == inputPhase.DeformCalcType.plastic: print('I_Plastic : ',phase.InputSettings.DeformCalcType)
Hello again,
In the Scripting reference, there is a specific example about matching the phases from Input and Output. That is exactly what I mentioned that you can use.
What other example do you want me to provide?
Note that there are examples for both Input and Output for this function.
Practically it matches the objects on different modes of Input (Geometry vs. Staged construction) and between applications (Input vs. Output).
Thank You for the reply.
Could You please dig in, or give an example for the get_equivalent function? Cannot find something useful in the notebook.
Thanks.
Dear Falko,
Indeed, this appears to be a bug in Output's code.
Temporarily, I would suggest using the information from Input regarding the calculation type until we fix this.
Note that you can always match the Phase object that belongs to Input and Output using the get_equivalent function. For more details please check our Scripting reference for Output in the extra examples: communities.bentley.com/.../scripting-reference-and-how-to-use-it