Problem with functions in data tree

Moderator: GiD Team

dsvivass
Posts: 4
Joined: Mon Aug 12, 2019 8:10 pm

Problem with functions in data tree

Postby dsvivass » Fri Aug 23, 2019 12:21 am

Hi,
I'm trying to use functions in my problem type, but they don't work, even using the example of the customization manual, it is supposed to appear like this
Captura de Pantalla 2019-08-22 a la(s) 18.00.40.png
Captura de Pantalla 2019-08-22 a la(s) 18.00.40.png (23.47 KiB) Viewed 50 times
But data tree shows this,
Captura de Pantalla 2019-08-22 a la(s) 18.00.25.png
Captura de Pantalla 2019-08-22 a la(s) 18.00.25.png (53.79 KiB) Viewed 50 times


This is the code as it is in the text. in the .spd file

<value n="dens" pn="Density" min_two_pnts="1" help="Density of Steel" unit_magnitude="M/L^3" units="kg/m^3" function="[density_function]" function_func="" v="1.0">
<function>
<functionVariable n="interpolator_func" pn="Interpolation function" variable="x" units="°C">
<value n="point" pn="Point" v="20.0,7830.0"/>
<value n="point" pn="Point" v="600.0,7644.0"/>
</functionVariable>
</function>
</value>

<procs>
<proc n='density_function' args='args'>
<![CDATA[
MyDensityFunction $domNode $args
]]>
</proc>
</procs>

In the .tcl file

proc MyDensityFunction { domNode args } {
set result [join [list scalar [list interpolator_func x x Temp]] ,]
return $result
}

Return to “Customization”

Who is online

Users browsing this forum: No registered users and 2 guests