General Mechanical

General Mechanical

Topics relate to Mechanical Enterprise, Motion, Additive Print and more

plain strain reverted to plain stress automatically during DOE

    • Simone LuX
      Subscriber

      In Ansys Workbench 2024R1, I am carrying a parametric analysis (DOE) where a geometry changes (trough SpaceClaim parameters).
      I need to work with planar elements (2D Analysis) and I need the behavior to be planar strain.


      But every time the geometry is reloaded it is set back to "plain stress".


      I tried to resolve by connecting a py script, as follow:
          my_body = DataModel.GetObjectById(342)
          my_body.Behavior = Model2DBehavior.PlaneStrain

      but at every sesign point the ID changes so I can't get the most updated one automatically.


      Is there a way to force "plain strain"?
      Or is there a way to scope a body trough it's name or index instead of internal ID?
      thanks!

    • mjmiddle
      Ansys Employee

      The Design of Experiments (DOE) works through parametric updates, which are just changes in dimensions. If you are making topological changes there should be many other problems that will prevent it from working. With parametric updates, IDs don't change.

      Assuming you haven't created grouping folders to screw up the order, you can get the body by its position in the Outline under geometry:

      my_body = ExtAPI.DataModel.Project.Model.Geometry.Children[0].Children[0]

      The first "Children" is for the part and the second is the body. If you don't see multibpdy parts, then each body is a singular body in a singular part.

      To get Outline objects by name seen in Outline:

      my_body = ExtAPI.DataModel.GetObjectsByName('My Body')[0]

      Since there can be multiple Oultine items with the same name, the zero index gets the first one.

       

Viewing 1 reply thread
  • You must be logged in to reply to this topic.