3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

How to retrieve data from user in spaceclaim using python?

    • dcaneiro
      Subscriber

      Hello,

      I need the user to put some geometrical data (not only points, which is well documented in the example files on spaceclaim), and for do that, i normally use tkinter libraries, but in the python version of spaceclaim, these libraries does not work correctly.


      Is possible in any way to create an input dialog to make easy direct data recollection from users?


      Thank you very much


      Regards,


      Daniel

    • Aniket
      Forum Moderator
      So do you want users to browse to and select a file?
      -Aniket
      How to access Ansys help links
      Guidelines for Posting on Ansys Learning Forum

    • dcaneiro
      Subscriber
      no, i do not.
      I need to find a way, similar to "input box" in visual basic to retrieve information (int, double, strings...) from the user in a windows style, I think that the image should clarify this.

      I could do this in python with the tkinter libraries, but they are not in the current version of python of spaceclaim (as far as I know).
      Regards Daniel
    • Aniket
      Forum Moderator
      Ok, if you desire to have user interaction with your code, wouldn't a wizard be useful?
      Ansys Store Developer Resources
      Please download the wizard example template from the link above and see if that would suit your need?
      -Aniket
      How to access Ansys help links
      Guidelines for Posting on Ansys Learning Forum
    • dcaneiro
      Subscriber
      Yhank you very much for the fast answer Aniket, but i am looking for something more simple, more intuitive, a common input window, with no need of loading xml, do we have that option in this python version?
      Regards
      Daniel
    • Aniket
      Forum Moderator
      ,have you tried using windows forms then? Try googling windows form with python and you will find a few examples like:
      import clr
      clr.AddReference('System.Windows.Forms')
      from System.Windows.Forms import Application, Form

      class HelloWorldForm(System.Windows.Forms.Form):
      def __init__(self):
      self.Text = 'Hello World'
      self.Name = 'Hello World'

      form = HelloWorldForm Application.Run(form)

      -Aniket
      How to access Ansys help links
      Guidelines for Posting on Ansys Learning Forum

      ´╗┐
Viewing 5 reply threads
  • The topic ‘How to retrieve data from user in spaceclaim using python?’ is closed to new replies.