CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > ANSYS Meshing & Geometry

[ICEM] Replay Scripts: create curve from points

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 16, 2015, 06:13
Default Replay Scripts: create curve from points
  #1
New Member
 
Join Date: Jan 2015
Posts: 29
Rep Power: 11
evan247 is on a distinguished road
Dear all,

I've been trying to use ICEM's scripting feature to automate mesh generation. My geometry (curve) comes from a .dat file of (x,y,z) coordinates of points, and I'd like to create my curves "from points". However, in the .rpl file I find the line to be sth like:

ic_curve point GEOM crv.00 {{0.00000000 0.30000000 0.00000000} {0.00492865 0.30000876 0.00000000} ....

, rather than saying "import from <filename.dat>".

My question is then: is it possible to use .rpl file to directly import points from another file, or I have to input the points (manually) every time?

Thanks!
evan247 is offline   Reply With Quote

Old   February 17, 2015, 13:10
Default
  #2
Senior Member
 
Sebastian Engel
Join Date: Jun 2011
Location: Germany
Posts: 566
Rep Power: 20
bluebase will become famous soon enough
Hello evan247,

the .rpl scripts use a language called tcl. That's why you can use that language's features.
To answer your question, no you don't have to input them all manually.
But.. you have to write a few extra lines in your replay script to load the data file.

I suggest you to read a short tutorial on tcl.

To give you a kick start, have a look at the following code snippet. I assume your data file uses a comma as separator.
Code:
# read file
set fp [open "filename.dat" r]      
set file_data [read $fp]      
close $fp

# define empty list
set xyzlist {}

# process data
set data [split $file_data "\n"] 
     foreach line $data {           
     lappend xyzlist [split $line ","]
}

# create line by point list
ic_curve point GEOM crv.00 $xyzlist
with regards,
Sebastian
bluebase is offline   Reply With Quote

Old   February 17, 2015, 13:50
Default
  #3
New Member
 
Join Date: Jan 2015
Posts: 29
Rep Power: 11
evan247 is on a distinguished road
Quote:
Originally Posted by bluebase View Post
Hello evan247,

the .rpl scripts use a language called tcl. That's why you can use that language's features.
To answer your question, no you don't have to input them all manually.
But.. you have to write a few extra lines in your replay script to load the data file.

I suggest you to read a short tutorial on tcl.

To give you a kick start, have a look at the following code snippet. I assume your data file uses a comma as separator.
Code:
# read file
set fp [open "filename.dat" r]      
set file_data [read $fp]      
close $fp

# define empty list
set xyzlist {}

# process data
set data [split $file_data "\n"] 
     foreach line $data {           
     lappend xyzlist [split $line ","]
}

# create line by point list
ic_curve point GEOM crv.00 $xyzlist
with regards,
Sebastian
Thanks Sebastina for the starting point - I will look into tcl language to get my script working!
evan247 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
Create geometry from mesh points in ICEM-CFD David Arthur Main CFD Forum 3 October 25, 2014 12:19
[snappyHexMesh] determining displacement for added points CFDnewbie147 OpenFOAM Meshing & Mesh Conversion 1 October 22, 2013 09:53
Create 2D hexa block from points alexey CFX 1 June 22, 2006 07:49
Normal to Line - Curve Equ. from Points A.S. Main CFD Forum 5 July 5, 2005 02:41
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19


All times are GMT -4. The time now is 06:46.