Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Ansys Scripting – Add Force along Cylindrical surface

    • aldamo
      Subscriber

      Hi All,

      So i have to add a 4000N force over the selected surface. I'm currently able to identify the surface and select the magnitude, but I have problems with the force direction. The code I wrote is the following:

    • ErKo
      Ansys Employee
      Hi



      To use these directions just use the record option inside the scripting console, and see how it works.
      For instance to define it in the x direction would be:

      threadForce = ExtAPI.DataModel.Project.Model.Analyses[0].AddForce
      threadForce_scoping = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)

      threadForce_scoping.Ids = [4]

      threadForce.DefineBy = LoadDefineBy.Components

      threadForce.Location = threadForce_scoping

      threadForce.XComponent.Output.DiscreteValues=[Quantity(400,"N")]




      Erik
    • aldamo
      Subscriber
      Thanks EriK!
Viewing 2 reply threads
  • The topic ‘Ansys Scripting – Add Force along Cylindrical surface’ is closed to new replies.
[bingo_chatbox]