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] TCL scripting error (parameter use in functions) (http://www.cfd-online.com/Forums/ansys-meshing/90919-icem-tcl-scripting-error-parameter-use-functions.html)

firesoul July 25, 2011 05:46

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

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:
Code:

# 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:

Code:

# 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

Code:

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.

Code:

{expr $param}
[$param]
"$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.


Code:

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 16:21.