How to assign units to a custom result in the python file of an ACT extension?
In Mechanical, this can be done by modifying the value of "result.Unit", where "result" is one of the arguments of the function called. Below is an example :
def OnValidateResultType(result,property): if result.Properties["Result Type"].Value == "Length Result": result.Unit = "Length" elif result.Properties["Result Type"].Value == "Force Result": result.Unit = "Force" elif result.Properties["Result Type"].Value == "Moment Result": result.Unit = "Moment" elif result.Properties["Result Type"].Value == "Unitless Result": result.Unit = "Dimensionless"