gfk-plate.py 831 B

1234567891011121314151617181920212223242526272829303132
  1. # https://akaszynski.github.io/pyansys/ansys_control.html#initial-setup-and-example
  2. import pyansys
  3. mapdl = pyansys.launch_mapdl(interactive_plotting=True)
  4. #, interactive_plotting=True
  5. #os.system('cmd /k "D:\\ANSYS Inc\\v191\\ansys\\bin\\winx64\\ANSYS191.exe" ')
  6. #mapdl = pyansys.launch_mapdl(interactive_plotting=True)
  7. # create a square area using keypoints
  8. mapdl.prep7()
  9. mapdl.k(1, 0, 0, 0)
  10. mapdl.k(2, 1, 0, 0)
  11. mapdl.k(3, 1, 1, 0)
  12. mapdl.k(4, 0, 1, 0)
  13. mapdl.l(1, 2)
  14. mapdl.l(2, 3)
  15. mapdl.l(3, 4)
  16. mapdl.l(4, 1)
  17. mapdl.al(1, 2, 3, 4)
  18. # sets the view to "isometric"
  19. mapdl.view(1, 1, 1, 1)
  20. mapdl.pnum('kp', 1) # enable keypoint numbering
  21. mapdl.pnum('line', 1) # enable line numbering
  22. # each of these will create a matplotlib figure and pause execution
  23. #mapdl.run('/SHOW,PNG')
  24. mapdl.aplot()
  25. mapdl.lplot()
  26. mapdl.kplot()
  27. mapdl.wait(1)