*Template()

Creates a Templex template.

Syntax

*Template(temp_name, "temp_label", USER|PROCEDURE|SOLVER_INPUT| 
                                             SOLVER_COMMAND|SOLVER_PARAM| 
                                             GRAPHICS|ADAMS|ACF, 
                                                    temp_def, 
                                                    arg_1, 
                                                    arg_2, ..., 
                                                    arg_n)

Arguments

temp_name
The variable name of the template.
Data type: varname
temp_label
The descriptive label of the template.
Data type: label
USER PROCEDURE SOLVER_INPUT SOLVER_COMMAND SOLVER_PARAM GRAPHICS ADAMS ACF
This argument indicates the template type.
temp_def
The definition for the template.
Data type: varname
arg_1, arg_2, .., arg_n
A list of arguments for the template.
Data type: user-defined

Example

*DefineTemplate(def_tem_write_vehpar, ds)
 Vehicle model 
{ds.model.value}
 Vehicle wheelbase 
{ds.wheelbase.value}
 Sprung mass CG height 
{ds.spr_mass_cg_hgt.value}
 Front sprung mass 
{ds.frnt_spr_mass.value}
 Rear sprung mass 
{ds.rear_spr_mass.value}
*EndDefine()
*Template(tem_write_vehpar, "Write Vehicle Parameters", 
 USER, 
 def_tem_write_vehpar, 
 ds_vehpar)
*DefineTemplate(tpldef_data_array, ds)
ARRAY/ 50000010, NUMBERS =
, {ds.veh_end.ival, %d } ! 0 = Front susp., 1 = Rear susp.
, {ds.dif_mnt.ival, %d } ! 0 = Independent, 1 = Dependent
, {ds.tire_slr.value } ! Tire static loaded radius (mm)
, {ds.tire_rate.value } ! Tire vertical spring rate (N/mm)
, {ds.cg_height.value } ! Vehicle CG Height (mm)
, {ds.wheel_base.value } ! Wheel Base (mm)
, {ds.front_brake.value } ! Front Braking Ratio (-)
, {ds.front_drive.value } ! Front Drive Ratio (-)
, {ds.axle_ratio.value } ! Axle Ratio (-)
, {ds.veh_weight.value } ! Vehicle Weight (N)
*EndDefine()
*Template(tpl_data_array, "SDF array 50000010", ADAMS, 
 tpldef_data_array, 
 ds_vehpar)

Context

*BeginMdl()

*DefineAnalysis()

*DefineSystem()

Properties

Table 1.
Property Returns Data Type Description
label string The descriptive label of the template.
state boolean Control state (TRUE or FALSE).
varname string The variable name of the template.
text string Evaluated text from the template.
pre_evaluate Boolean Key to control when the template has to be evaluated during export. Valid values are true and false. The default = false. See Comments below.

Comments

The number and type of arguments passed into the template depends on the template definition.

By default the template is evaluated last during export, after all other entities are evaluated. This order of evaluation can be changed for USER and ADAMS template types by using the *Set statement as follows: *Set(varname.pre_evaluate, true).

MotionView will then evaluate the template first before other entities. This is particularly useful while using a USER type template that can modify entity properties.