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

Ansa Script

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2013, 08:45
Thumbs up Ansa Script
  #1
New Member
 
Ganesh
Join Date: Jan 2013
Posts: 6
Rep Power: 13
ganesh0481 is on a distinguished road
HI All,
It will be great if anybody tell how to do automation using Ansa scripting.
ganesh0481 is offline   Reply With Quote

Old   January 11, 2013, 00:12
Default
  #2
New Member
 
Ganesh
Join Date: Jan 2013
Posts: 6
Rep Power: 13
ganesh0481 is on a distinguished road
HI ,
It will be great if any of our members answer to my question.
ganesh0481 is offline   Reply With Quote

Old   January 11, 2013, 04:01
Default Scripting
  #3
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
You can use scripting by their own scripting language which is like c++.

In ANSA - 14 onwards it is supporting python along with their own scripting language. You can use their scripting manual available in documentation to do the scripting.
rmaries is offline   Reply With Quote

Old   January 11, 2013, 05:25
Default
  #4
New Member
 
Ganesh
Join Date: Jan 2013
Posts: 6
Rep Power: 13
ganesh0481 is on a distinguished road
HI rmaries,
Thanks for your reply,can you tell whether we can create our own scripts like hypermesh does.As i came to know there some standard scripts that only can be used.Looking forward your support on this.

byee
Ganeshram
ganesh0481 is offline   Reply With Quote

Old   January 11, 2013, 06:41
Default
  #5
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
Yes You can create your own script. I don't know hypermesh so i can't able to tell about hypermesh scripting.
rmaries is offline   Reply With Quote

Old   January 11, 2013, 08:05
Default
  #6
New Member
 
Ganesh
Join Date: Jan 2013
Posts: 6
Rep Power: 13
ganesh0481 is on a distinguished road
Hi,
Thanks for reply,can you share some example or it is possible to have some personla discussion on this over phone.Let me know are you fine on this.
ganesh0481 is offline   Reply With Quote

Old   March 20, 2013, 06:26
Smile Ansa scripting
  #7
New Member
 
Suhas Konanur
Join Date: Mar 2013
Posts: 2
Rep Power: 0
Suhas Konanur is on a distinguished road
Hello members,

I created a curve with 2 points across a meshed plate. Then I selected the nearest nodes to the curve and aligned it with the curve.

I tried to automate the process using Ansa script. The program asks the user to select nodes on the mesh. It captures the nodes in a matrix, extract the coordinates in an array and then with CreateCurve function a curve is drawn.

For the alignment, I captured the NearestShell (function with same name) to these nodes and then the corresponding nodes in a matrix. These nodes were then aligned to the curve. However the results are satisfactory only when the nodes selected by the user are closely spaced. Is there are a function or an algorithm which searches for the nearest nodes to a curve?? Thanking you all for your suggestions.

Suhas
Suhas Konanur is offline   Reply With Quote

Old   March 23, 2013, 10:21
Default
  #8
Senior Member
 
Vangelis Skaperdas
Join Date: Mar 2009
Location: Thessaloniki, Greece
Posts: 287
Rep Power: 21
vangelis is on a distinguished road
Dear Suhas
Can you give us a broaded view of what actually want to do with ANSA?
Are you sure that it is something that cannot already be done and you
try scripting?
Is it something that you want to do automatically without user interaction?
vangelis is offline   Reply With Quote

Old   April 16, 2013, 12:57
Default
  #9
New Member
 
Pierre-Arthur Fortin
Join Date: Apr 2013
Posts: 3
Rep Power: 13
PAFortin is on a distinguished road
Dear members,

I am a fresh begginer in ANSA scripting.
I am currently trying to script the creation of a aerdoynamic part with ANSA. My script will take a set of parameters (heigh, length etc...) and output a fully created part.

I need to create curves which follow a determined angle at the start and at the end. Until now I did this "by hand" by creating 2 straight curves following the desired angles and by enforcing a tangent condition between my final curves and these 2 curves at the start and at the end.
This is easy with the GUI but I can't find a function that would do the same operation within my script.

The function CreateCurve is not satisfactory as it cannot enforce tangent conditions.

I hope I was clear enough. Does any one know of a way to solve my problem?

Thank you for all your suggestions.

Regards,

Pierre
PAFortin is offline   Reply With Quote

Old   April 17, 2013, 06:34
Default
  #10
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
Hi,

Can you give an example of what you are doing. If possible with screen shots.
Which version of ANSA you are using. Because I can able to create python scripts which can be used only ANSA14x versions.

Regards
Maries



Quote:
Originally Posted by PAFortin View Post
Dear members,

I am a fresh begginer in ANSA scripting.
I am currently trying to script the creation of a aerdoynamic part with ANSA. My script will take a set of parameters (heigh, length etc...) and output a fully created part.

I need to create curves which follow a determined angle at the start and at the end. Until now I did this "by hand" by creating 2 straight curves following the desired angles and by enforcing a tangent condition between my final curves and these 2 curves at the start and at the end.
This is easy with the GUI but I can't find a function that would do the same operation within my script.

The function CreateCurve is not satisfactory as it cannot enforce tangent conditions.

I hope I was clear enough. Does any one know of a way to solve my problem?

Thank you for all your suggestions.

Regards,

Pierre
rmaries is offline   Reply With Quote

Old   April 17, 2013, 09:25
Default
  #11
New Member
 
Pierre-Arthur Fortin
Join Date: Apr 2013
Posts: 3
Rep Power: 13
PAFortin is on a distinguished road
Hi,

I work with ANSA 13.2.3.

Unfortunately, I cannont give you screenshots as this project is still confidential.
To make it short I juste need to find a script function that would do do same as TOPO>CURVES>NEW in the GUI in order to enforce tangent conditions.

Any ideas?

Regards,

Pierre
PAFortin is offline   Reply With Quote

Old   April 18, 2013, 00:59
Default
  #12
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
Hi Pierre,

According to my knowledge there is no direct script for function you told.

You can contact ansa@beta-cae.gr for further details.

If you find the script for that, post it here

Regards
Maries



CreateCurve,
NAME:
CreateCurve - Definition of 3D-curves.
SYNOPSIS:
CreateCurve(integer total,matrix x,matrix y,matrix z)
DESCRIPTION:
Creates smooth 3D-curve that passes from a number of points.
(total) is the number and (x),(y),(z) are the coordinates of the points.

RETURN:
Returns the pointer to the created 3D-curve.

EXAMPLE:

def main()
{
x[0] = 1;
x[1] = 1.1;
x[2] = 2;
y[0] = 1.5;
y[1] = 3.2;
y[2] = 2.7;
z[0] = 1.8;
z[1] = 3;
z[2] = 2.6;
CreateCurve(3,x,y,z);
}
-----------------------------------------------------------------




Quote:
Originally Posted by PAFortin View Post
Hi,

I work with ANSA 13.2.3.

Unfortunately, I cannont give you screenshots as this project is still confidential.
To make it short I juste need to find a script function that would do do same as TOPO>CURVES>NEW in the GUI in order to enforce tangent conditions.

Any ideas?

Regards,

Pierre

Last edited by rmaries; April 18, 2013 at 01:28. Reason: Add some more information
rmaries is offline   Reply With Quote

Old   April 19, 2013, 11:06
Default
  #13
New Member
 
Pierre-Arthur Fortin
Join Date: Apr 2013
Posts: 3
Rep Power: 13
PAFortin is on a distinguished road
Hi Maries,

I ended up contacting BETA CAE. Turns out what I was looking for cannot be done with ANSA v13.x. Something close enough can be done with ANSA v14.x using MORPHING.
Unfortunately, I do not have access to v14.x so I ended up creating my parametrized geometry with CATIA V5 and then importing it to ANSA for meshing.

Thank you for your help anyway.

Regards,

Pierre
PAFortin is offline   Reply With Quote

Old   April 20, 2013, 12:45
Default
  #14
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
Thanks Pierre
rmaries is offline   Reply With Quote

Old   August 20, 2013, 03:58
Thumbs up Ansa scripts
  #15
New Member
 
Ganesh
Join Date: Jan 2013
Posts: 6
Rep Power: 13
ganesh0481 is on a distinguished road
Hi All,
can any one share how to get offset thickness value using script.
ganesh0481 is offline   Reply With Quote

Old   August 27, 2013, 03:34
Default
  #16
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
Quote:
Originally Posted by ganesh0481 View Post
Hi All,
can any one share how to get offset thickness value using script.
Hi Ganesh,

Did you get the solution. I think you are asking about offsetface option

You can use the below format to get the offset thickness by using script.

OffsetFaces, BETA SCRIPT development Manual
NAME:
OffsetFaces - Offset faces.
SYNOPSIS:
OffsetFaces(float d,string command)
DESCRIPTION:

Offset visible faces by a given distance d.
The string command can be DELETE or KEEP (deletes or keeps the original faces).

RETURN:

The function returns zero (0) upon successful execution, and 1 if an error occurs.

EXAMPLE:

OffsetFaces(2.5,"KEEP");

-----------------------------------------------------------------

If you are using ansa version >14 . You can use python also. If you need any further clarification call me.

Regards
Maries
rmaries is offline   Reply With Quote

Old   November 27, 2013, 13:15
Default loading Python scripts
  #17
New Member
 
Mihai Cris
Join Date: Nov 2013
Posts: 5
Rep Power: 12
mihaicris is on a distinguished road
Hi all

We have developed a few python scripts for ANSA 14.
Does anybody know how to load them every time ANSA starts? And have them available to users of course...
mihaicris is offline   Reply With Quote

Old   November 27, 2013, 22:30
Default Automatically loading ansa scripts
  #18
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
Hi,

Check this. Whether it will work.?

• FILE>Script>Default:

Sets a script as default. Selecting this button opens a window where all loaded and added scripts are

displayed. The index in front of each path indicates which is the default sequence. Always, the script with

zero index is the default. Select a script from the list and press the "Set as default" button to become the

default one. Press then OK to confirm.

Important Note: A loaded script takes always zero index while an added script takes the first available

index.


Regards
Maries

Quote:
Originally Posted by mihaicris View Post
Hi all

We have developed a few python scripts for ANSA 14.
Does anybody know how to load them every time ANSA starts? And have them available to users of course...
rmaries is offline   Reply With Quote

Old   November 28, 2013, 02:20
Default
  #19
New Member
 
Mihai Cris
Join Date: Nov 2013
Posts: 5
Rep Power: 12
mihaicris is on a distinguished road
Quote:
Originally Posted by rmaries View Post
Hi,

Check this. Whether it will work.?

• FILE>Script>Default:

Sets a script as default. Selecting this button opens a window where all loaded and added scripts are "...
Hello rmaries

Although I appreciate your effort...
- ANSA 14 does not have a FILE>Script menu
- it is about python scripts in ANSA
- the default setting only lists the loaded scripts, and my scripts are not listed because they where not loaded, that was the question, how can I load them automatically when ANSA starts?
mihaicris is offline   Reply With Quote

Old   November 28, 2013, 03:20
Default
  #20
Senior Member
 
Vangelis Skaperdas
Join Date: Mar 2009
Location: Thessaloniki, Greece
Posts: 287
Rep Power: 21
vangelis is on a distinguished road
Hi Mihai,

I suggest you place all your user scripts in a file named
ANSA_TRANSL
and place this in the following path
<homedir>/.BETA/ANSA/version_14.x.x/


Then when ANSA starts it will read all the scripts in the file.

If you want all users to read the same scripts, then
either
1) Do the above for each one
or
2) If you have permissions in the installation directory of ANSA
place this ANSA_TRANSL file in

ansa_v14.x.x/config/

Then all ANSA users will read these scripts upon startup

Hope this helps

Vangelis
vangelis 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
[ICEM] Script: problems with face names Maweil ANSYS Meshing & Geometry 3 April 16, 2019 10:10
CentFOAM Python Script Installation: Error socon009 OpenFOAM Installation 2 May 26, 2012 10:36
[Commercial meshers] ANSA hexblock mesh to OpenFOAM yosuu OpenFOAM Meshing & Mesh Conversion 7 October 22, 2011 07:18
[Commercial meshers] Output deck from ANSA for OpenFOAM use Kattie OpenFOAM Meshing & Mesh Conversion 10 February 2, 2011 08:46
Perl script for intialisation pratik mehta CFX 2 September 10, 2008 04:09


All times are GMT -4. The time now is 16:34.