How do I get the geometry unit in Mechanical?

Rajesh Meena
Rajesh Meena Moderator, Employee Posts: 85
Photogenic 5 Likes Name Dropper Ansys Employee
✭✭✭✭

The geometry dimensions will not returned in active unit system. How do I check the unit system for geometry parameters?

Tagged:

Best Answer

  • Rajesh Meena
    Rajesh Meena Moderator, Employee Posts: 85
    Photogenic 5 Likes Name Dropper Ansys Employee
    ✭✭✭✭
    Answer ✓

    The geometry unit will not be in SI Unit always. You can use below script to get geometry Unit. It would be dependent on CAD unit.
    I use below script whenever I want to calculate the mesh from geometry dimensions.


    GeometryUnit=str(ExtAPI.DataModel.Project.Model.Geometry.LengthUnit) #Unit of geometry UnitDict={'StandardMKS':'m','StandardNMM':'mm','StandardUMKS':'um','StandardBIN':'in','StandardBFT':'ft','StandardCGS':'cm'} LengthUnit=UnitDict[GeometryUnit] #Unit of mesh size