3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

Utilizing an API with ANSYS Geometry to launch SpaceClaim and manipulate files

    • Ganggui Guo
      Subscriber

      I am using ANSYS Geometry to launch SpaceClaim. However, is there an API to open existing files, such as STP or X-T files, and perform operations on them?

    • Atharv Joshi
      Forum Moderator

      Hi Ganggui, 

      Yes, you can open existing files using scripts. You need to launch Script Editor from the Design Tab and then use below script to open existing file in Ansys SpaceClaim. Please mention the file path (For e.g.: C:\Users\Downloads\Sample.x_t). 

      # Open Document 
      importOptions = ImportOptions.Create()
      DocumentOpen.Execute(r"file path", importOptions)

      Ansys SpaceClaim provides you the capability to record script for manual operation. Try opening the file with record button active.

      Thanks and Regards

      Atharv 

    • Ganggui Guo
      Subscriber
      from ansys.geometry.core import launch_modeler_with_spaceclaim
      modeler_discovery = launch_modeler_with_spaceclaim()
       
      I am using the Ansys.geometry API, not the internal Python script of SpaceClaim. I want to call SpaceClaim directly from an external VSCode or PyCharm. Do you have any methods to achieve this? Additionally, I would like to open SpaceClaim through VSCode, and then open geometric files such as STP or X_T formats.
       
    • Atharv Joshi
      Forum Moderator

      Let me check this and get back to you. 

    • Atharv Joshi
      Forum Moderator

      Hi Ganggui, 

      You can import the geometry files and make basic geometry operations on them. Please refer to the documentation on different file formats currently supported in PyAnsys Geometry DesignFileFormat — PyAnsys Geometry

      Thanks and Regards
      Atharv

    • Ganggui Guo
      Subscriber

      Thank you for your response. The DesignFIleFormat enumeration provides the supported file formats that can be downloaded for designs. This means it might be used to specify the format of files being downloaded, rather than the format of files being imported.

Viewing 5 reply threads
  • The topic ‘Utilizing an API with ANSYS Geometry to launch SpaceClaim and manipulate files’ is closed to new replies.