Options class

The Options class enables you to access several options in PRIMER. More...

The PRIMER JavaScript API provides many class constants, properties and methods. For Arup to be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:

Options class properties

Name Type Description
auto_confirm logical If true then PRIMER will automatically confirm (i.e. press the OK button) on (most) message boxes that are mapped. If false (default) then the message boxes will be shown and wait for the user to press a button. This option may be useful to help automate an operation where PRIMER would normally show a message box and wait for the user to press a button.
browse_missing_include_file logical If true (default) then PRIMER will popup a "BROWSE MISSING INCLUDE FILE" panel while reading the model. If false then it will throw an 'missing include file error' and continue reading the model.
copy_target_include integer This option sets the target include files for copied keywords. If it is set to Include.COPY_CURRENT (default) then copied keywords will go into the current layer. If it is set to Include.COPY_SOURCE, copied keywords will go into the include of the original element. An existing include file number can also be used if the copied keywords should go into a certain include.
dyna_version string The Ansys LS-DYNA version used to write keyword files. Can be "971R5", "971R4", "971R3", "970v6763" etc (use Utils.GetLSDYNAVersions() to get a full list, or see the version popup in Model->Write '>>> Ansys LS-DYNA output options'). See also Model.Write and Include.Write
edit_keep_on_top logical If true edit panels created from the Edit() or Create() methods will be kept on top of other windows. If false (default) then they can be lowered.
exception_messages logical If true (default) error messages will be printed to the dialogue box/stdout when an exception occurs in the API. If false they will not be printed. This option may be useful if you are using try/catch to manage exceptions and you do not want any error messages to be printed.
keyout_binary logical If true then the output file will be written out in binary. If false (default) then an ascii file will be written.
keyout_compress_format constant This option can be used to specify the mode of compression. Can be Model.INDIVIDUAL_GZIP, Model.INDIVIDUAL_ZIP or Model.PACKAGED_ZIP
keyout_compress_level integer Compression level for .gz and .zip files. Must be in the range 1 to 9 with 1 being the least compression (fastest speed) to 9 being the greatest compression (slowest speed)
keyout_compress_switch constant Switch to set the compression during keyout. Can be Model.COMPRESS_KEEP (default), Model.COMPRESS_OFF or Model.COMPRESS_ON
keyout_i10 logical If true then i10 format will be used to write the file. If false (default) then the normal Ansys LS-DYNA format will be used.
keyout_large logical If true then large format will be used to write the file. If false (default) then the normal Ansys LS-DYNA format will be used. Note that large format is only available from version R7.1 and above.
keyout_method constant The method used to write include files. Can be Include.MASTER_ONLY, Include.MERGE, Include.SELECT, Include.NOT_WRITTEN, Include.SUBDIR (default) or Include.SAME_DIR
keyout_parameter_values logical This option can be used to specify how parameters are written. If true then the underlying values of any parameters will be written when they are used in data fields rather than '&name'. If false (default) then '&name' will be written.
keyout_path_type constant The method used to write include paths. Can be Include.ABSOLUTE (default) or Include.RELATIVE
keyout_separator constant The directory separator used when writing include files. Can be Include.NATIVE (default), Include.UNIX or Include.WINDOWS
merge_set_collect logical If true then when merging models PRIMER will merge *SET_COLLECT cards which have the same label. If false (default) then they will be renumbered. This is also used with Model.ImportInclude. The default for this can be set using the primer*merge_set_collect preference.
model_tabs_active logical If true (default) then PRIMER will show model tabs in the object selection menu. If false then PRIMER will hide model tabs in object selection menu.
node_replace_asrg logical If true nodes in *AIRBAG_SHELL_REFERENCE_GEOMETRY can be replaced by node merge/replace. If false they will not be considered.
pick_window_position constant or Window Position that the pick window will be shown on the screen. It can be any combination (bitwise OR) of Window.LEFT, Window.CENTRE, Window.RIGHT, Window.TOP, Window.MIDDLE and Window.BOTTOM or a Window object. If a window obect is used the pick window will be shown in the middle of that window. The default is Window.RIGHT|Window.TOP.
property_parameter_names logical If true object properties which are parameters will be returned as parameter names. If false object properties which are parameters will be returned as parameter values.
reset_cwd logical If true then the current working directory will not be changed after selecting a file. If false (default) then the current working directory will be changed after selecting a file. This option only applies to Windows machines.

Properties for connections

Name Type Description
connection_angle_tol real The angle tolerance used for spotwelds in the connections algorithm
connection_edge_dist real The edge distance used in the connections algorithm
connection_file string The connection file to read/write
connection_max_thickness real The maximum thickness used in the connections algorithm
connection_model integer The model number selected to make connections in
connection_part integer The part ID selected for connections
connection_write_flag (read only) integer Flag that will be set on selected connections when writing. This can be used in the user JavaScript to write connections to find which are selected.
solid_spotweld_diameter real The default diameter of solid spotwelds.
spotweld_element_type integer The default type of spotweld to make. can be: Conx.SPOTWELD_BEAM, Conx.SPOTWELD_HEXA1, Conx.SPOTWELD_HEXA4, Conx.SPOTWELD_HEXA8, Conx.SPOTWELD_HEXA12 or Conx.SPOTWELD_HEXA16

Properties for graphics

Name Type Description
airbag_colour integer Airbag symbol colour
background_colour integer Colour of the background
contacts_colour integer Contact surface colour
contour_text_pt_size integer Contour bar text size (in pts)
contour_text_size integer This property is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Contour bar text size  [deprecated]
date_size integer This property is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Size of date (clock) display  [deprecated]
edge_angle real Feature edge critical angle
edges_ign_pt integer Option for choosing how to draw free edges (can be set to TRUE or FALSE)
extra_nodes_colour integer Constrained extra nodes colour
feature_line integer Switch ON/OFF feature line (can be set to TRUE or FALSE)
for_mom_colour integer Nodal force/moment colour
graticule_text_size integer Graticule text size
label_colour integer Colour of the label
label_pt_size integer Label size (in pts)
label_size integer This property is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Label size  [deprecated]
node_colour integer Nodes colour
nrb_colour integer Nodal rigid body colour
overlay_colour integer Colour of the overlay
overlay_edges integer Option for setting the overlay edges value (can be set to 0,1 or 2)
rigid_bodies_colour integer Constrained rigid body colour
rot_vels_colour integer Rotational velocity colour
sketch_colour integer Colour of the sketch
spotweldbeam_colour_from_panels integer Spotweld beam/solid colour
spr_colour_from_node_sets integer Constrained SPR/SPR2/SPR3 colour
text_colour integer Colour of the text
timehist_blks_colour integer Time history block colour
title_date_pt_size integer Size of title & date (clock) display (in pts)
tracer_partl_colour integer Tracer particle colour
trans_vels_colour integer Translational velocity colour
x_sections_colour integer Cross-section colour

Properties for mass properties calculation

Name Type Description
mass_properties_centre_x real X-coordinate of user defined centre.
mass_properties_centre_y real Y-coordinate of user defined centre.
mass_properties_centre_z real Z-coordinate of user defined centre.
mass_properties_coordinate_system_type integer Coordinate system selection: Model.GLOBAL_AXES, Model.LOCAL_AXES, Model.PRINCIPAL_AXES.
mass_properties_include_attached_mass_deformable_elems logical Option to include lumped mass attached to the nodes of deformable elements. Default is FALSE.
mass_properties_include_attached_mass_rigid_elems logical Option to include lumped mass attached to the nodes of rigid elements. Default is FALSE.
mass_properties_include_timestep_mass logical Option to switch on/off inclusion of timestep addded mass. Default is FALSE.
mass_properties_inertia_center integer Option to set the centre used in inertia properties calculation. By default Centre at CofG is used. Available options are: Model.CENTRE_AT_COFG, Model.USER_DEFINED_CENTRE.
mass_properties_local_axes integer CSYS ID when using local axes.
mass_properties_rigid_part_constrained_parts logical Option to switch on/off mass of *CONSTRAINED_RIGID_BODIES associated with a rigid part. Default is FALSE.
mass_properties_rigid_part_extra_nodes logical Option to switch on/off mass of *CONSTRAINED_EXTRA_NODES associated with a rigid part. Default is FALSE.

Properties for nastran

Name Type Description
convert_rbe2_cnrb logical Convert all RBE2s to *CONSTRAINED_NODAL_RIGID_BODY
merge_rbe_nodes logical Merge duplicate RBE dependent nodes
retain_mid_nodes logical Retain mid-side nodes for higher order elements

Properties for ssh

Name Type Description
ssh_buffer_size integer The size of the buffer used (in kiloBytes) when transferring data to/from the remote machine in the Ssh class. Depending on your network and the size of the files you are transferring, changing this value may make file transfers quicker. The default value is 64(kB) but any value in the range 1(kB) to 1024(kB) is allowed.

Properties for widgets

Name Type Description
max_widgets integer The maximum number of Widgets that can be made for one Window. The default value is 1000
max_window_lines integer The maximum number of lines that can be made for a Window.Error(), Window.Information(), Window.Message(), Window.Question() or Window.Warning() window. The default value is 25

Detailed Description

The Options class is used to get/set options that PRIMER uses for certain functions. The options are available as class properties. See the documentation for more details. An example: Options.mass_properties_include_attached_mass_deformable_elems=true