Skip to content

How to Connect Python Code to an Opened Mechanical Project or Launch a Specific One? #996

Closed Answered by dipinknair
thanborb asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @thanborb .

I am answering all your questions assuming you are using pymechanical remote session method.

For your first question,
If you want to connect to A mechanical instance that is already running, you need to start Grpc Server on that instance. These are the steps to start grpc server and connect.

  • Execute this on already running Mechanical Ansys.ACT.Mechanical.MechanicalAPI.Instance.ApplicationAPI.StartGrpcServer(10000) where 10000 is the port number
  • Connect to Mechanical using pymechanical with connect_to_mechanical using same 10000 port or alternately like this.

For the second question,
If you have a Mechanical Project file saved as .mechdb or .mechdat then you can start new …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@thanborb
Comment options

@dipinknair
Comment options

Answer selected by thanborb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants