3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

How to get path to directory of script with SpaceClaim API script

    • emarkowski
      Subscriber

      Is there a way to get the path to a SpaceClaim API script within the script while it is executing? I need to save data to a file that will be given using a relative path from the directory of the script.

      The usual options for doing this with Python do not seem to work with the SpaceClaim API.

    • emarkowski
      Subscriber
      For example:
      import os
      script_dir = os.path.abspath(os.path.dirname(__file__))
      Only returns a portion of the path, but stops short several directory levels from where the actual script file is located.
    • barrooze
      Subscriber
      I had tried doing this as well but was unsuccessful. I think SpaceClaim internally digests the script, which removes any traceability back to the original script file. Sorry I can't be of more help.
Viewing 2 reply threads
  • You must be logged in to reply to this topic.