The workbench Geometry coordinate datas unit

Options
1990chs
1990chs Member Posts: 43
First Comment Name Dropper
edited January 20 in General Language Questions

The workbench Geometry length unit is mm. But when I use ironPython API to get geometry Centroid, the result unit seems m and the mesh node.X seems also m.
So how to get the Centroid length unit and MeshData units ?

analysis = Model.Analyses[0]
face = analysis.GeoData.GeoEntityById(44)
faceCenter = face.Centroid 
# The Centroid unit seems m, but the workbench geometry model is mm
modelMesh = analysis.MeshData
node = modelMesh.NodeById(1)
node.X
# The node coordinate unit seems m

I am confused by the ironPython API results.
So is there any description about the units or how to get these units ?

Best Answers

Answers

  • 1990chs
    1990chs Member Posts: 43
    First Comment Name Dropper
    Options

    Thinks, if I want to get the rstfile mesh length unit. How to get it?
    I find a way but I am not sure it is right or not.

    analysis = Model.Analyses[0]
    reader = analysis.GetResultsData()
    rstMesh = reader.CreateMeshData()
    # the rstMesh don't have unit information, try to  use local unit.
    Loc = reader.GetResult('LOC')
    Loc.SelectComponents(['X'])
     LocUnit = Loc.GetComponentInfo('X').Unit
    # get the rstMesh node
    Node = rstMesh.NodeById(NodeId)
    Node.X    # get Node X  coordinate
    
  • 1990chs
    1990chs Member Posts: 43
    First Comment Name Dropper
    Options

    @Mike.Thompson
    What's " the results file unit system specified in either the solution or solution information object in Mechanical" ?

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 300
    First Anniversary First Comment 5 Likes Ansys Employee
    Options

    I forget which object it is, but one of them has a property listing the unit system of the results file.

  • 1990chs
    1990chs Member Posts: 43
    First Comment Name Dropper
    edited January 21
    Options

    @Mike.Thompson said:
    I forget which object it is, but one of them has a property listing the unit system of the results file.

    @Mike.Thompson
    I found two API in solution.

    solution.ResultFileUnitSystem
    #>>ConsistentNMM
    solution.SolutionUnitSystem
    #>>ConsistentNMM
    

    mm, kg, N, C, s, mV, mA
    (nmm)