3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

How to extract volume properties using scripting in SpaceClaim?

    • sirusblack07
      Subscriber

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

      Thanks,

    • Aniket
      Forum Moderator
      Which of the mass properties are you looking for?
      -Aniket
      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

      Erik
    • FirasBejar
      Subscriber
      Thank you that solved my issue
      Regards
Viewing 3 reply threads
  • The topic ‘How to extract volume properties using scripting in SpaceClaim?’ is closed to new replies.