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.

Edit SpaceClaim script code from external python editor such as Spyder

    • Franc Shaw
      Subscriber

      Hi everyone,
      I was wondering if I can design a 3D model in Spyder using python, then load the code into ANSYS SpaceClaim Editor and run to build a 3D model?
      All above operations are performed in Spyder, not in SpaceCalim.
      Thanks a lot!

    • Aniket Chavan
      Forum Moderator

      Do you mean that copy-paste a code from spyder to the SpaceClaim scripting window? or do you want to drive geometry creation from spyder?

      -Aniket

      How to access Ansys help links

      Guidelines for Posting on Ansys Learning Forum

    • Franc Shaw
      Subscriber
      copy-paste a code from spyder to the SpaceClaim scripting window
    • Franc Shaw
      Subscriber

      Can I drive geometry creation from spyder?
      Such I design a GUI in python, when I click the "ANSYS SCDM" button, I can paste a block of scipts from a .py file to SCDM script Editor

      • Aniket Chavan
        Forum Moderator

        Hi I think you should be able to use command line prompt to create geometry:

        Please check if this page helps:

        https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/spaceclaim/Discovery/user_manual/spaceclaim_command_line_options.html

        -Aniket

        How to access Ansys help links

        Guidelines for Posting on Ansys Learning Forum

        • NickFL
          Subscriber

          Aniket,

          Thank you for the link. I have a couple of questions in regards to running from the command line.

          1. My model is a terrible STL and I do not want to visualize it until it is cut up. That is why I want to use SpaceClaim without the GUI. It seems like the \Headless option is what I want. However when I set \Headless = True it seems to still open the interface.
          2. I have a script the opens a file (STL saved in SpaceClaim so no import needed), slices, deletes and saves. It was built off recorded options and works quite well when I do it manually. It is saved as a .scscript.

          SpaceClaim opens but seems to ignore the headless and the script (& also the exit). Here is what I am using on the Command Line (starting from the working directory where the script is located):

          > spaceclaim \Headless=True /RunScript=”PositiveXY_Script_forCmd.scscript” /ExitAfterScript=True

          Thanks in advance.

           

        • NickFL
          Subscriber

           

          Ok, I guess I was a little impatient. It does run the script, it just takes a long time to open the files and do the slicing. And my / was in the wrong direction :facepalm:

           

    • Franc Shaw
      Subscriber

      Hi,
      Does SpaceClaim provide any API to let me create geometry using command prompt?
      Thanks!

Viewing 4 reply threads
  • The topic ‘Edit SpaceClaim script code from external python editor such as Spyder’ is closed to new replies.
[bingo_chatbox]