I am trying to get iformation on a individual step. For example I want to extract data from each step. What I did so far was to iterate through my steps, but apperently each Phase has more steps, from which not all of them are calculated. An error is raised if you try to call the getResults function on a not calculated step. Is there a possible way to determine of a step was calculated?
This is my workaround so far, but I would like to have a more clean version for my study project than this try catch line...
def get_plx_data (step_object): materialID_list = g_o.getresults(step_object, g_o.ResultTypes.Soil.MaterialID, 'Stresspoint') MeanEffStress_values_o = g_o.getresults(step_object, g_o.ResultTypes.Soil.MeanEffStress, "Stresspoint") DeviatoricStress_values_o = g_o.getresults(step_object, g_o.ResultTypes.Soil.DeviatoricStress, "Stresspoint") return materialID_list, MeanEffStress_values_o, DeviatoricStress_values_o for phaseIndex in range (1,numberOfPhases): i=1 for step_object in g_o.Phases[-phaseIndex].Steps[:]: print(i,'/',numberOfSteps) i+=1 try: materialID_list, MeanEffStress_values_o, DeviatoricStress_values_o = get_plx_data (step_object) #further code... except: pass
Thanks in advance.
Greetings
Lukas
Thanks Dennis for you answer,
I maybe can phrase my question now a bit clearer: Is there a way to output a list of steps, which have been calculated and saved to my disc?
Kind Regards
Dear Lukas,
You would have to make the list yourself by iterating over the steps, there is no pre-made list.Per step you could ask for a result at specific coordinates, for instance using getsingleresult. If the step was stored, you will get a result back and if it was not stored you will get an error code back. That is probably a bit more robust then checking on the length of the return string.Kind regards,
Dennis Waterman