General Mechanical

General Mechanical

Can’t add symmetry region using Mechanical scripting.

    • prakhars962
      Subscriber

      I am trying to use Python to add symmetry region (along edge 21) in my Solid simulation as follows:

      SlMn = ExtAPI.SelectionManager

      SlMn.ClearSelection()

      Sel = SlMn.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)

      import context_menu

      context_menu.DoInsertSymmetryGroup(ExtAPI)

      symm=context_menu.DoAddSymmetryRegion(ExtAPI)

      Sel.Ids=[21]

      symm.Location=Sel


      After, running the code I can see the following:

    • Aniket
      Ansys Employee
      Try using following two lines instead of the context menu method that recorder records:nmySym=Model.AddSymmetry()nmySymReg=mySym.AddSymmetryRegion()nnAnd then add the location as given in the code. Note the IDs can vary depending on geometry.n-AniketnHow to access Ansys help linksnGuidelines for Posting on Ansys Learning Forumn
Viewing 1 reply thread
  • You must be logged in to reply to this topic.