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.
3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

Discovery Scripting: how to save Discovery Scripting functions in modules?

    • mihir.samel
      Subscriber

      I am working on a series of Discovery scripting functions. Right now we are including those in every *.dscript session in order to reuse them for each application. Hence I wish to save them as a module at a path : C:\Work\modules\myColor.py. In this class I have one method which seeks to call some Discovery API

      like part = GetRootPart().GetAllBodies()
      > global name 'GetRootPart' is not defined

      The trouble I am facing is that these APIs are not recognized as the class is saved in C:\Work\modules . I am unable to save it in C:\Program Files\ANSYS Inc\v251\Discovery\Library\IronPython\Lib due to IT admin policy . What is the workaround here? I can prove that the module is successfully imported in the *.dscript as by using a  simple print("Hello") command in the function of my module. 

      Is there anything I could do to help this? I can upload a .dscript and .the *.py module 

Viewing 0 reply threads
  • You must be logged in to reply to this topic.
[bingo_chatbox]