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

Ansa Python Scripting

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 29, 2017, 06:54
Default Ansa Python Scripting
  #1
New Member
 
Renuka
Join Date: Aug 2017
Posts: 15
Rep Power: 9
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 07:25.
Renu123 is offline   Reply With Quote

Old   September 16, 2017, 13:45
Cool open ANSA files one by one
  #2
New Member
 
Join Date: Sep 2017
Posts: 5
Rep Power: 9
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


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


All times are GMT -4. The time now is 07:48.