How do I get the geometry unit in Mechanical?

Options
Rajesh Meena
Rajesh Meena Moderator, Employee Posts: 67
First Anniversary Solution Developer Community of Practice Member Ansys Employee 5 Likes

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: 67
    First Anniversary Solution Developer Community of Practice Member Ansys Employee 5 Likes
    Answer ✓
    Options

    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