CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   ANSYS Meshing & Geometry (http://www.cfd-online.com/Forums/ansys-meshing/)
-   -   [ICEM] [problem] ICEM Scripting Loop to create points and Curves (http://www.cfd-online.com/Forums/ansys-meshing/115154-problem-icem-scripting-loop-create-points-curves.html)

bwiblue March 25, 2013 07:02

[problem] ICEM Scripting Loop to create points and Curves
 
Hi,

I have a problem while creating points and curves within these points.
So far my script looks like that:

1 ic_undo_group_begin
2 ic_geo_new_family GEOM
3 ic_boco_set_part_color GEOM
4 ic_empty_tetin
5 for {set i 0} {$i<4} {set i [expr $i+1]} {
6 set x1_value [expr $i*2*0.04]
7 set x2_value [expr ($i*2+1)*0.04]
8 set point1_nr [expr $i*2]
9 set point2_nr [expr ($i*2)+1]
10 ic_point {} GEOM pkt$point1_nr $x1_value,0,0
11 ic_point {} GEOM pkt$point2_nr $x2_value,0,0
12 ic_delete_geometry curve names crv.$i 0
13 ic_curve point GEOM crv.$i {pkt$point1_nr pkt$point2_nr}
14 }

Now to my problem:
The script does not create the curve between the points (line 13). I have tried it without the variables for one curve. That worked perfectly. The source code looked like that:
ic_curve point GEOM crv.01 {pkt1 pk2}.

That is why i assume that the create curve command cannot handle the variables inside. Do you have any experience with that or do you know a workaround?

Thank you in advance for your help.

FlorisvdBeek September 8, 2015 03:06

Hi !

Okay so this answer may come a little over 2.5 years too late, but as your question still came on top of my google results:

I found that for scripting in ICEM, the quotes {$MYVAR} do not allow for variable substitution. You should use "$MYVAR" instead, i.e.:

ic_curve point GEOM crv.01 "pkt1 pk2"

Thanks for the 'for loop' though, that was what I was looking for in the first place ;)

joxen September 29, 2015 09:27

Quote:

Originally Posted by FlorisvdBeek (Post 562879)
Hi !

Okay so this answer may come a little over 2.5 years too late, but as your question still came on top of my google results:

I found that for scripting in ICEM, the quotes {$MYVAR} do not allow for variable substitution. You should use "$MYVAR" instead, i.e.:

ic_curve point GEOM crv.01 "pkt1 pk2"

Thanks for the 'for loop' though, that was what I was looking for in the first place ;)


Hi,
Have some problem with scripting in ICEM aswell.
I want to control the vertex numbers and change them, or find the vertex number in a specific coordinate.
I have a vertex in point e.g (1,2,3) and want to extract the node number in this point. Do you know any code for that?


There is a function called : ic_hex_select_nodes
When using:
[CODE]
ic_hex_select_nodes 1 all m FLUID node_numbers
[\CODE]
All the node number associated to the FLUID part is returned, which is quite good. By changing "all" to inpoly and give the coordinates of a point it should be easy to select a node in a gives coordinate.


I've tried:

[CODE]
ic_hex_select_nodes 1 inpoly {369.13875 211.52306 -1.1669954e-10} m FLUID node_numbers
[\CODE]

And there is node in this coordinate so it should work but the error message "Error: Error reading polygon coords" is given.

Do you have any idea how to solve this or how to use
ic_hex_select_nodes with inpoly command instead of all.

Thank's for your help

Antanas September 30, 2015 03:05

Quote:

Originally Posted by joxen (Post 565851)
Do you have any idea how to solve this or how to use
ic_hex_select_nodes with inpoly command instead of all.

Thank's for your help

Try this

Code:

ic_hex_select_nodes 1 inpoly 1 369.13875 211.52306 -1.1669954e-10 m FLUID node_numbers


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