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

Ansa Python Scripting

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 29, 2017, 05:54
Default Ansa Python Scripting
  #1
New Member
 
Renuka
Join Date: Aug 2017
Posts: 15
Rep Power: 5
Renu123 is on a distinguished road
I want to read all my ansa file and want to load it one by one in ansa window. How I do that using python script?My code
import ansa
from ansa import *
def main():
m = utils.SelectOpenFileIn('/home/user/', 1) #for selecting multiple files
for i in range(len(m)):
print(m[i])


Using above code I am able to select all my file but I want to load it to ansa window one by one. I am looking for specific function of loading which able to do that.
Thank you.

Last edited by Renu123; August 30, 2017 at 06:25.
Renu123 is offline   Reply With Quote

Old   September 16, 2017, 12:45
Cool open ANSA files one by one
  #2
New Member
 
Join Date: Sep 2017
Posts: 5
Rep Power: 5
maddoxx is on a distinguished road
Hi,
Please use code wrap(# Button) from now on otherwise it will be difficult to understand the code. HTML does not provide TABS option

Code:
def main():
	selected_files = utils.SelectOpenFileIn('/home/user/', 1) #for selecting multiple files
	for each_file in selected_files:
		print("Each File :",each_file)
		ansa.base.Open(each_file) # for opening the file
maddoxx is offline   Reply With Quote

Reply

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
Ansa Python Scripting Renu123 ANSA 2 August 29, 2017 03:46
[General] Filters using Python Scripting Birro ParaView 0 January 11, 2017 10:26
[ICEM] ICEM python geometry scripting eromon84 ANSYS Meshing & Geometry 0 December 12, 2015 11:39
python scripting in WB Windows.Forms OpenFileDialog() crashing mvoss CFX 0 November 4, 2011 03:46
python scripting in paraFoam chegdan OpenFOAM Post-Processing 0 March 31, 2010 19:06


All times are GMT -4. The time now is 17:45.