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

ANSA version convert

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 22, 2020, 08:38
Default ANSA version convert
  #1
New Member
 
Sumit Patel
Join Date: Mar 2020
Posts: 8
Rep Power: 6
sumpate is on a distinguished road
Hello all,
Using script how to convert ansa version ..e.g. from ansa 18 to ansa 17 ?
I don't want to open ansa gui
sumpate is offline   Reply With Quote

Old   March 23, 2020, 01:27
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 sumpate View Post
Hello all,
Using script how to convert ansa version ..e.g. from ansa 18 to ansa 17 ?
I don't want to open ansa gui
Use the below command, write an ansa script and run it in batch mode

SaveAs, BETA PYTHON development Manual
NAME:
SaveAs - Saves the current file with a new filename.

SYNOPSIS:
ansa.base.SaveAs(filename, version, silent) Named Arguments

DESCRIPTION:
This function saves the current file in ANSA with a new filename.
Arguments

filename string The name of the new file with which the current
file is going to be saved must contain the full
pathname.
version string (optional) Valid values are 'v17' and 'previous'.
silent boolean (optional) If set to True the active database path will not
be updated to the pathname given. False by default.
The version argument takes precedence and overrides the silent argument.
rmaries is offline   Reply With Quote

Old   February 3, 2022, 07:50
Post
  #3
New Member
 
Tibor Stefanovics
Join Date: Aug 2018
Posts: 6
Rep Power: 7
stefat is on a distinguished road
Hello everyone!

I was trying myself to make a script based on the Manual but unfortunatly i dont have enough knowledge in Python to solve this problem.

My script looks like this now:

Quote:
# PYTHON script
import os
import ansa
from ansa import base

def inp_filename(): #

inpf = open(sys.argv[1],'r')

def out_filename(): #
#
inpf = open(sys.argv[1],'r') # The script use the first command line argument as input file name
outf = open(sys.argv[1][0:-5] + '_21.ansa', 'w') # Open a file with same name and postfix

# inpf.close()

def main():
base.Open(inpf)
base.SaveAs(outf, previous)
Ofc it's not working.

Is there someone who can fix it for me? Or make a brand new one witch works in batch mode to convert a existing ansa file to convert it to previous version?

Thanks in advance!
stefat 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
[OpenFOAM] Multiple version of ParaView Pavel Rodin ParaView 1 October 13, 2017 11:21
openFoam_solver issue for different version maasyraf3 OpenFOAM Running, Solving & CFD 2 April 6, 2017 10:38
Convert res file to older version Duall ANSYS 0 August 2, 2016 08:01
How can i uninstall new version of OF shipman OpenFOAM Installation 5 August 12, 2013 05:01
compressible low speed channel flow -Ali OpenFOAM Running, Solving & CFD 11 May 9, 2013 08:40


All times are GMT -4. The time now is 05:41.