CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Mesh Generation & Pre-Processing Software > ANSA

Ansa batch mode for already running ansa window

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By rmaries
  • 1 Post By rmaries

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 22, 2018, 08:26
Default Ansa batch mode for already running ansa window
  #1
New Member
 
Viswanathan
Join Date: Jul 2018
Posts: 9
Rep Power: 8
Viswa is on a distinguished road
Dear all,

I am using ansa batch comand to open and load script

Example:
Ansa.exe -i file name -loadscript scriptname

The above comand will open new ansa load file and run script.

My requirement is i already opened ansa. Files should load on that.

Example:
Already openned ansa process id -i file name -loadscript file name.

How to do this?
Viswa is offline   Reply With Quote

Old   July 23, 2018, 02:18
Default
  #2
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
Quote:
Originally Posted by Viswa View Post
Dear all,

I am using ansa batch comand to open and load script

Example:
Ansa.exe -i file name -loadscript scriptname

The above comand will open new ansa load file and run script.

My requirement is i already opened ansa. Files should load on that.

Example:
Already openned ansa process id -i file name -loadscript file name.

How to do this?
From which program do you want to call Ansa. Is it batch or something else?

This is called interprocess communication in programming. I am this using program called autoit. I assume one can do the same thing with any other programming language also. I am also very much interested in this topic.
Viswa likes this.
rmaries is offline   Reply With Quote

Old   July 25, 2018, 13:16
Default
  #3
New Member
 
Viswanathan
Join Date: Jul 2018
Posts: 9
Rep Power: 8
Viswa is on a distinguished road
hi rmaries,

i try to call ansa by batch file or by python.
if you know anyother language or process to acheive this , that is fine. i will learn that.
if i can controll arlerady opened program by another tool, it will be help me very much.
Viswa is offline   Reply With Quote

Old   July 26, 2018, 04:24
Default
  #4
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
I am doing an inefficient way as of now to achieve this. Sending keypress to ansa window. If ansa window is active and someone is typing in keyboard, all the pressed keys are appeared in search function and filter. So to open a ansa file, one can type
Code:
File : Open recent: C:\Ansa\ansa_file.ansa
After that you can you need to call the script again like this.
Code:
User: Load_script(script path)
So any program which send keypress to other process will work for this. I am using AutoIt. As I said earlier, it is an inefficient process. Limitation is when the program is sending keypress, if the user press the keyboard by mistake this won't work.

Efficient way it use other proved methods like

Pipes
Memory mapped files
RPC(remote procedure call) I prefer this. I need to learn how to do that with python. There is a separate library called xmlrpc for this. With this we can make ansa to work like server waiting for command from other process. Also need to learn multiprocessing in python for this. You can go through other methods in python docs https://docs.python.org/3/library/ipc.html

If possible share your code in git.

Thanks
Viswa likes this.
rmaries is offline   Reply With Quote

Old   July 26, 2018, 08:54
Smile
  #5
New Member
 
Viswanathan
Join Date: Jul 2018
Posts: 9
Rep Power: 8
Viswa is on a distinguished road
Thank you. i will check it and inform you.
Viswa is offline   Reply With Quote

Old   May 21, 2020, 15:08
Default
  #6
New Member
 
Ujjwal Mohanty
Join Date: Mar 2018
Posts: 18
Rep Power: 8
ujjwalmohanty is on a distinguished road
Quote:
Originally Posted by Viswa View Post
Dear all,

I am using ansa batch comand to open and load script

Example:
Ansa.exe -i file name -loadscript scriptname

The above comand will open new ansa load file and run script.

My requirement is i already opened ansa. Files should load on that.

Example:
Already openned ansa process id -i file name -loadscript file name.

How to do this?





Hi Viswa,


How did you manage to launch Ansa?

I tried using the Popen function in Python, but I get a fatal error and the window closes.
I tried Popen('location/ansa64.bat').


Could you please help?
ujjwalmohanty is offline   Reply With Quote

Reply

Tags
ansa, batch mode, scripting line se

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ICEM] icem cfd batch mode srobin11 ANSYS Meshing & Geometry 20 August 2, 2020 18:40
Having problems running transient fluent simulation in batch mode obylong FLUENT 1 August 14, 2014 23:58
[ICEM] ICEM CFD error when running in batch mode bgp723 ANSYS Meshing & Geometry 0 August 14, 2014 13:45
Running Job in Batch mode (EFD) Nick Sessions FloEFD, FloWorks & FloTHERM 0 April 16, 2008 16:44
Batch mode swapnil CFX 5 November 23, 2002 09:38


All times are GMT -4. The time now is 22:21.