Hello.
To avoid the possibility of someone running a post-processing extension in the wrong unit system, I was hoping to read the solution coordinate system and set the active system to it, irrespective of if they've changed the active system. However I'm struggling to get it to work.
I point to the solution with:
SolvLoc=ExtAPI.DataModel.Project.Model.Analyses[0].Solution
and assign the solution unit system:
SolvUnit=SolvLoc.SolutionUnitSystem
If I get type (SolvUnit.GetType() )it returns:
Ansys.ACT.Interfaces.Common.MechanicalUnitSystem
If I get the active system type (ExtAPI.Application.ActiveUnitSystem.GetType() ) it returns the same.
The tooltip suggests I should be able to use it to set the system:
ExtAPI.Application.ActiveUnitSystem=SolvUnit
but this returns the error:
Specified argument was out of the range of valid values.
Parameter name: ConsistentMKS
I'm sure there is something simple I'm missing, but can anyone help explain how to resolve this