3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

How to extract volume properties using scripting in SpaceClaim?

    • sirusblack07

      I would like to extract the mass property values using scripting in SpaceClaim for a specfic body selection.


    • Aniket
      Ansys Employee
      Which of the mass properties are you looking for?
      How to access Ansys help links
      Guidelines for Posting on Ansys Learning Forum
    • Erik Kostson
      Ansys Employee
      To get volume of a part on the tree see this:

      volume = GetRootPart().Bodies[0].Shape.Volume

      Also the MeasureHelper functionality can help with that.
      selection = BodySelection.Create(GetRootPart().Bodies[0])
      volProps = MeasureHelper.MeasureVolume(selection)

      To get mass with MeasureHelper one needs to assign density (properties) to the part in question.
      Then one can use the MeasureHelper GetMassProperties method to get the information.

      All this can be recorded via the UI and them the above calls will be visible.

      Search the forum and the internet to see how to record SC scripts.

      All the best

    • FirasBejar
      Thank you that solved my issue
Viewing 3 reply threads
  • You must be logged in to reply to this topic.