CFD Online Discussion Forums

CFD Online Discussion Forums (
-   ANSYS Meshing & Geometry (
-   -   [ICEM] TCL scripting error (parameter use in functions) (

firesoul July 25, 2011 05:46

[ICEM] TCL scripting error (parameter use in functions)
1 Attachment(s)

I'm having a problem using parameters in Icem's geometry functions. I'm trying to create points on a curve having a distance of 0.05 of the curves length.

No problem by using the command with an actual number:

# Create Point+Curve
ic_point {} SPLINE pnt.01 0,0,0
ic_point {} SPLINE pnt.02 1,0,0
ic_curve point SPLINE crv.01 {pnt.01 pnt.02}
# Create point on curve at position 0.05
ic_point crv_par SPLINE pnt.03 {crv.01 0.05}

I'd like now to replace the number by a parameter, which may be used in a loop:


# set point number and start param
set pnt_nr 3
set param 0.0
#---Loop Start
# Set the parameter to create the point; output of correct value
set param [expr {$param+0.05}]
mess "set param  to: $param \n"
# Create point on curve
ic_point crv_par GEOM pnt.$pnt_nr {crv.01  $param}
incr pnt_nr
#---Loop End

I get the following error


Error in replay of ic_point crv_par GEOM pnt.$pnt_nr {crv.01  $param}:
{Error in scanning curve parameter: $param}

I figured I had the wrong format so I tried several approaches to get it to work, without success.


{expr $param}

Thanks for any Ideas on how to get it working!

fox000002 July 25, 2011 11:55

{crv.01 0.05} is a list.

No substitutions are performed on the characters between the braces here.

Use list operations to construct the list variable.


set crvl {crv.01}
lappend crvl $param

ic_point crv_par GEOM pnt.$pnt_nr $crvl

firesoul July 25, 2011 12:36

Good to know that these functions work with lists. Thanks fox!

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