*DefineTemplate() - general

Indicates the beginning of a template definition block.

Syntax

*DefineTemplate(temp_def_name,arg_1, arg_2,, arg_n)

Example

*DefineTemplate(def_tem_write_vehpar, TEMPLATE, 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()
*DefineProcedure(def_write, ds, tem_write_vehpar)
 *Write(ds.filename.value, CREATE, tem_write_vehpar)
*EndDefine()
*Template(tem_write_vehpar, "Write Vehicle Parameters", 
 USER, 
 def_tem_write_vehpar, 
 ds_vehpar)
*Procedure(write, "Write Parameters", 
 def_write, 
 ds_vehpar, 
 tem_write_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()

Comments

The *DefineTemplate() block defines a template that writes user-defined statements to a file. The number and type of user-defined arguments depends on the template.

Multiple templates can be created using the same template definition. Each *DefineTemplate() statement requires an ending *EndDefine() statement. All template variables must be used within braces, { }, inside the *DefineTemplate() block.