We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.

Ansys Learning Forum Forums Discuss Simulation General Mechanical Python Code Object not working when updating Design Points Reply To: Python Code Object not working when updating Design Points

Akshay Panchwagh
Subscriber

Hello mjmiddle,

 

you're right about the first part. After going through my code, I realised that the code is reading the history direcly from Mechanical, and for that it will always need Mechanical to be open and running. 

 

Coming to the suggestions you provided, I did try applying it. But I am unable to produce useful results from it.

If I use it with rset, i.e. the ResultSetCount, it gives an error: 'PythonCodeEventBased' object has no attribute 'By'. I believe this error arises when I use the line 'item.By'. 

And when I use it with rtime, i.e. the ListTimeFreq, it gives an error saying: 'Expected Quantity, received float'. The line item.DisplayTime = rtime throws this error. 

 

I tried finding some documentation about it but had no success.

 

I have been able to extract the time step counts, or the actual time steps. But I am unable to connect them somehow with the intermediary result values. Even if I put it in a loop, and try to append the values to a list just to see what is happening, only the temperature values for the last time step are getting saved into the list. 

 

I am unable to follow where exactly it is going wrong with these suggesstions you provided. Can you please elaborate a bit more, if you don't mind? 

 

 

Regards,

Akshay