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] prametric geometry script (http://www.cfd-online.com/Forums/ansys-meshing/94575-prametric-geometry-script.html)

skrzatchlewny November 19, 2011 20:31

prametric geometry script
 
Hi,
I would like to have a simple parametric geometry (translated circle). To do that I generated following Tcl script:

1: ic_vdefine r variable 2
2: ic_point {} GEOM pnt.00 0,0,0
3: ic_point {} GEOM pnt.01 1,0,0
4: ic_point {} GEOM pnt.02 1,1,0
5: ic_curve arc_ctr_rad GEOM crv.01 {pnt.01 pnt.02 pnt.00 r 0 360}
6: ic_move_geometry curve names crv.01 translate {0 r 0}

the problem is with line 6, the circle stays at initial position and no error is displayed. Does anybody know the reason/solution?

brunoc November 22, 2011 13:35

Hi,

That's because {..} does not allow substitution inside the brackets. Use ".." instead and it should work:

1: set r 2
2: ic_point {} GEOM pnt.00 0,0,0
3: ic_point {} GEOM pnt.01 1,0,0
4: ic_point {} GEOM pnt.02 1,1,0
5: ic_curve arc_ctr_rad GEOM crv.01 "pnt.01 pnt.02 pnt.00 $r 0 360"
6: ic_move_geometry curve names crv.01 translate "0 $r 0"

Cheers

skrzatchlewny November 22, 2011 16:33

That solved the problem. Thank you!

Felipe Mendes March 28, 2012 03:40

Hey guys,
I'm also doing a parametric script using Tcl.
Nevertheless, neither the while nor the for looping work:

while {$i < 10} {
puts "I dans le boucle: $i"
incr i
}


for {set i 0} {$i<5} {incr i} {
puts "I dans le boucle: $i"
}

Do you know how to make it work?
Does anybody knows how to select some point or line in ICEM parametric language by specifying a location (like in ansys workbench)?
Thanks a lot!

skrzatchlewny March 28, 2012 15:35

try that code:
set i 0;
while {$i < 10} {\
ic_mess "I dans le boucle: $i";\
incr i;}

Felipe Mendes March 29, 2012 03:11

Thanks! :)
It worked pretty well!

hadikhayyamian May 14, 2012 13:55

Hi Brunoc;

Thanks for your great help. I wonder if there is any book, ..... as a source for tcl/tk and its use in ICEM.

Regards.


All times are GMT -4. The time now is 03:26.