Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show the GUI after load #69

Open
koubaa opened this issue Dec 19, 2022 · 7 comments
Open

Show the GUI after load #69

koubaa opened this issue Dec 19, 2022 · 7 comments
Assignees

Comments

@koubaa
Copy link
Collaborator

koubaa commented Dec 19, 2022

See https://github.com/pyansys/mechanical-embedding/issues/2 for the original discussion

@xiepei1
Copy link
Collaborator

xiepei1 commented Feb 28, 2023

  • the link above does not work for me, seemingly it is another internal repository
  • is the issue discussing about whether we can show Mechanical instances in e.g., Spyder IDE, after using launch_mechanical()
  • The interactive Python script sending from Spyder is nice, but I do not know whether some one will only work on pure IDE without explicitly opening the Mechanical and see what's happening there during the workflow development. So I assume it is beneficial for some one to actually SEE what happended and current status in Mechanical instead of just response messages

@koubaa
Copy link
Collaborator Author

koubaa commented Feb 28, 2023

@xiepei1 yes you are right is in an internal repository. You are correct about the description of the issue.

Are you using embedding or remote?

I think it could be easy to add an API to open a copy of the model in the GUI that is disconnected from the current python session. To add an API to open the GUI but allow running more python commands will be a bit more effort. I plan to keep this issue open until both options are available.

@xiepei1
Copy link
Collaborator

xiepei1 commented Mar 3, 2023

Thank you for your feedback!

Not sure embedding or remote I am using... I assume the concept of remote refers to the connection to the Mechanical in a server (or something like it), and embedding would be running an instance from local computer.

I would assume that most developers would prefer to directly program ACT scripts directly with Mechanical itself, if later on, a further integration is needed, they may come to pymechanical. In this sense, I would assume that adding an API to open a copy of the model in GUI that is disconnected from current python session is not strongly needed in this aspect.
But it could be that in the future or in other use cases, this would be a need.

I agree on the idea that keeping it open til both are ready.

@pmaroneh
Copy link
Collaborator

pmaroneh commented Mar 3, 2023

Hi @xiepei1 There are two ways of using PyMechanical:

  • Remote instance where you start a remote session and send commands as strings
  • Embedded instance where Mechanical is embedded inside of Python (in the task manager the Mechanical application is in the python.exe) and where you pass commands as if you were in the Mechanical scripting console.

The remote instanced is launched through:

from ansys.mechanical.core import launch_mechanical
mechanical = launch_mechanical(batch=True, loglevel="DEBUG")

And the embedded one by:

app = mech.App(version=232) 
globals().update(mech.global_variables(app)) 

I hope that helps!

@xiepei1
Copy link
Collaborator

xiepei1 commented Mar 3, 2023

Hi @xiepei1 There are two ways of using PyMechanical:

  • Remote instance where you start a remote session and send commands as strings
  • Embedded instance where Mechanical is embedded inside of Python (in the task manager the Mechanical application is in the python.exe) and where you pass commands as if you were in the Mechanical scripting console.

The remote instanced is launched through:

from ansys.mechanical.core import launch_mechanical
mechanical = launch_mechanical(batch=True, loglevel="DEBUG")

And the embedded one by:

app = mech.App(version=232) 
globals().update(mech.global_variables(app)) 

I hope that helps!

Thank you for the hints! I missed it...

Previously should be remote, now I tried with embedding...

The embedding concept is nice,

@koubaa
Copy link
Collaborator Author

koubaa commented Jun 20, 2023

@klmcadams the low-hanging fruit is to save the mechanical db, and then open another instance of mechanical from the command line (using the same version as the one running) to open a graphical session of mechanical

@klmcadams
Copy link
Collaborator

Closed by #882

@klmcadams klmcadams reopened this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants