General Mechanical

General Mechanical

Can anyone help me why in mechanical my script is not working?

    • Baloch
      Subscriber

      I am doing a transient analysis for which I need to trace displacement response of the structure and change certain properties of the spring connections I am using withing the simulation. Meaning that if at a certain time if the displacement reach a certain value the stiffness and the damping of the spring should change to a different value. For this I have developed a Python script. When I run the script, there is no issue and the script executes successful. After executing the script when I run the simulation it seems the script is not interacting with the simulation and I am getting the same results which I have with out the script. The snap of the script is attached can anyone help me out this .

    • Erik Kostson
      Ansys Employee
      Hi

      This will not work .

      Python act objects are not monitored during solution and each step and iteration (if nonlinear).

      You would need to use a restart option in an apdl command snippet (see below), or something similar to do what you need.

      All the best

      Erik
    • Baloch
      Subscriber
      Thanks Erik The post was really explaining what I am looking for but I have couple of question if you can give an idea. 1) since by python its easier to get a certain object and formulate arguments.. By APDL can we put if like loop for multiple conditions and how to access a certain value? for example deformation?
      2) what is explain in the post I can insert a APDL command for all steps which means that after ever load step the APDL command will run in the solution. So if use such a command to only run my python script after each point but issue is can we execute a python script using APDL command?
      And also there is no way to program the script which can run also during the solution?
Viewing 2 reply threads
  • You must be logged in to reply to this topic.