db_add_pref | () |
# Purpose : This file provides an example of a call to the
# function db_add_pref()
#
# This function adds the preferences from the
# database.This file opens a new database
# "new.db" and gets the value preferences for
# the preference ANALYSISTYPE. Later it adds
# the ANALYSISTYPE preference to the database
# with the value of integer preference = 1234.
# Finally it gets the value of preferences.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function db_add_pref() has the following arguments:
#
# db_add_pref
# ( id,
# data_type,
# int_pref,
# log_pref,
# real_pref,
# name )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_id
INTEGER i_data_type
INTEGER i_int_pref
LOGICAL l_log_pref
REAL r_real_pref
STRING s_name[32]
STRING s_error_msg[64]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
# i_id = 102 (ANALYSISTYPE from pref_names.i)
i_id = 102
# i_data_type = 1 (Integer preference)
i_data_type = 1
#---------------------------------------------------------------------
# Get the value of preference ANALYSISTYPE
i_return_value = @
db_get_pref @
( i_id, @
i_data_type, @
i_int_pref, @
l_log_pref, @
r_real_pref, @
s_name )
# The preference ANALYSISTYPE is not added in the database.
# Hence an error occurs stating that preference not found.
dump i_return_value
#---------------------------------------------------------------------
msg_get_string( i_return_value, s_error_msg )
dump s_error_msg
#---------------------------------------------------------------------
# The value of preference for ANALYSISTYPE
dump s_name
dump i_int_pref
dump l_log_pref
dump r_real_pref
#---------------------------------------------------------------------
# Add the value 1234 to the Integer preference of ANALYSISTYPE
# i_data_type = 1 (Integer preference)
i_data_type = 1
i_int_pref = 1234
i_return_value = @
db_add_pref @
( i_id, @
i_data_type, @
i_int_pref, @
l_log_pref, @
r_real_pref, @
s_name )
dump i_return_value
#---------------------------------------------------------------------
# Get the value of preference ANALYSISTYPE
i_return_value = @
db_get_pref @
( i_id, @
i_data_type, @
i_int_pref, @
l_log_pref, @
r_real_pref, @
s_name )
# Check for the return value(Should return zero as the
# Preference is added to the database )
dump i_return_value
#---------------------------------------------------------------------
# The value of preferences for ANALYSISTYPE
dump s_name
dump i_int_pref
dump l_log_pref
dump r_real_pref
#---------------------------------------------------------------------
# End of File.
db_get_pref |
# Purpose : This file provides an example of a call to the
# function db_get_pref()
#
# This function gets the preferences from the
# database.This file opens a new database
# “new.db” and creates a solid and gets the value
# of values of preferences for the preference
# RENDERSTYLE. Later it sets the value of
# character preference to SHADED and gets their
# preference.The change of this setting can be
# viewed on viewport.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function db_get_pref() has the following arguments:
#
# db_get_pref
# ( pref_id,
# data_type,
# int_pref,
# log_pref,
# real_pref,
# char_pref )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_pref_id
INTEGER i_data_type
INTEGER i_int_pref
LOGICAL l_log_pref
REAL r_real_pref
STRING s_char_pref[32]
STRING sv_asm_created_hpat_xyz[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# Create a solid
asm_const_hpat_xyz(“1”,”<1 1 1>”,”[0 0 0]”,”Coord 0”, @
sv_asm_created_hpat_xyz)
ga_view_aa_set(23.,56.,0.)
# i_pref_id = 402 (RENDERSTYLE from pref_names.i)
i_pref_id = 402
# i_data_type = 1 (Integer preference)
i_data_type = 1
i_return_value = @
db_get_pref @
( i_pref_id, @
i_data_type, @
i_int_pref, @
l_log_pref, @
r_real_pref, @
s_char_pref )
dump i_return_value
# The value of integer preference for RENDERSTYLE
dump i_int_pref
# The value of logical preference for RENDERSTYLE
dump l_log_pref
# The value of real preference for RENDERSTYLE
dump r_real_pref
# The value of character preference for RENDERSTYLE
dump s_char_pref
# Set the value of the character preference to SHADED
# Session file paused. Press “Resume” to continue..
sf_pause()
# i_data_type = 4 (Character preference)
i_data_type = 4
i_return_value = @
db_set_pref @
( i_pref_id, @
i_data_type, @
i_int_pref, @
l_log_pref, @
r_real_pref, @
“SHADED” )
dump i_return_value
i_return_value = @
db_get_pref @
( i_pref_id, @
i_data_type, @
i_int_pref, @
l_log_pref, @
r_real_pref, @
s_char_pref )
dump i_return_value
# The value of integer preference for RENDERSTYLE
dump i_int_pref
# The value of logical preference for RENDERSTYLE
dump l_log_pref
# The value of real preference for RENDERSTYLE
dump r_real_pref
# The value of character preference for RENDERSTYLE
dump s_char_pref
SYS_FREE_STRING(sv_asm_created_hpat_xyz)
#---------------------------------------------------------------------
pref_anal_get | () |
# Purpose : This file provides an example of a call to the
# function pref_anal_get()
#
# This function gets the analysis preferences
# parameters. This file open a new database
# “new.db” and gets the analysis preference
# parameters.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_anal_get() has the following arguments:
#
# pref_anal_get
# ( anal_code,
# anal_type,
# mod_suf,
# res_suf )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_anal_code[32]
STRING s_anal_type[32]
STRING s_mod_suf[32]
STRING s_res_suf[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
pref_anal_get @
( s_anal_code, @
s_anal_type, @
s_mod_suf, @
s_res_suf )
dump i_return_value
# The analysis code name is
dump s_anal_code
# The analysis type name is
dump s_anal_type
# The model file suffix name is
dump s_mod_suf
# The results file suffix name is
dump s_res_suf
#---------------------------------------------------------------------
pref_anal_set | () |
# Purpose : This file provides an example of a call to the
# function pref_anal_set()
#
# This function sets the analysis preferences
# parameters.This file open a new database
# “new.db” and gets the analysis preference
# parameters.Later it changes the preference
# parameters and gets the modified preference
# parameters.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_anal_set() has the following arguments:
#
# pref_anal_set
# ( anal_code,
# anal_type,
# mod_suf,
# res_suf )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_anal_code[32]
STRING s_anal_type[32]
STRING s_mod_suf[32]
STRING s_res_suf[32]
STRING s_anal_code_c[32]
STRING s_anal_type_c[32]
STRING s_mod_suf_c[32]
STRING s_res_suf_c[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# Get the Analysis preferences
i_return_value = @
pref_anal_get @
( s_anal_code_c, @
s_anal_type_c, @
s_mod_suf_c, @
s_res_suf_c )
dump i_return_value
# The analysis code name is
dump s_anal_code_c
# The analysis type name is
dump s_anal_type_c
# The model file suffix name is
dump s_mod_suf_c
# The results file suffix name is
dump s_res_suf_c
# Set the analysis preferences
s_anal_code = “MSC.Nastran”
s_anal_type = “Thermal”
s_mod_suf = “.in”
s_res_suf = “.out”
i_return_value = @
pref_anal_set @
( s_anal_code, @
s_anal_type, @
s_mod_suf, @
s_res_suf )
dump i_return_value
# Get the Analysis preferences
i_return_value = @
pref_anal_get @
( s_anal_code_c, @
s_anal_type_c, @
s_mod_suf_c, @
s_res_suf_c )
dump i_return_value
# The analysis code name is
dump s_anal_code_c
# The analysis type name is
dump s_anal_type_c
# The model file suffix name is
dump s_mod_suf_c
# The results file suffix name is
dump s_res_suf_c
#---------------------------------------------------------------------
pref_confirm_get | () |
# Purpose : This file provides an example of a call to the
# function pref_confirm_get()
#
# This function gets the global preference
# confirm status.This file opens a new database
# “new.db” and gets the confirm flag for global
# preferences.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_confirm_get() has the following arguments:
#
# pref_confirm_get
# ( confirm )
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL l_confirm
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
pref_confirm_get @
( l_confirm )
dump i_return_value
# The Global preference confirm flag status is
dump l_confirm
#---------------------------------------------------------------------
pref_display_method_get | () |
# Purpose : This file provides an example of a call to the
# function pref_display_method_get()
#
# This function gets the graphic display method
# preference type.This file opens a new database
# “new.db” and gets the graphic display method
# preference type.Later it changes the display
# method and gets the preference type.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_display_method_get()
# has the following arguments:
#
# pref_display_method_get
# ( disp_meth )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_disp_meth
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
pref_display_method_get @
( i_disp_meth )
dump i_return_value
# The Graphical display method type is
# (1 for entity type and 2 for group type)
dump i_disp_meth
# Change the display method
# The preference id for display method is 501.
i_return_value = @
db_set_pref @
( 501, @
1, @
2, @
FALSE, @
0.0, @
“ “ )
dump i_return_value
i_return_value = @
pref_display_method_get @
( i_disp_meth )
dump i_return_value
# The Graphical display method type is
# (1 for entity type and 2 for group type)
dump i_disp_meth
#---------------------------------------------------------------------
pref_entity_dp_get | () |
# Purpose : This file provides an example of a call to the
# function pref_entity_dp_get()
#
# This function gets the entity display property
# preference.This file opens a new database
# “new.db” and gets the display property
# preference.Later it changes the display
# property preference and gets the preference.
# There are two entity display property
# preferences namely “general” and “simple”.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_entity_dp_get()
# has the following arguments:
#
# pref_entity_dp_get
# ( ed_prop )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_ed_prop[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
pref_entity_dp_get @
( s_ed_prop )
dump i_return_value
# The entity display property preference is
dump s_ed_prop
# Session file paused. Press “Resume” to continue.
sf_pause()
# Change the entity display property preference
i_return_value = pref_entity_dp_set( “simple” )
dump i_return_value
i_return_value = @
pref_entity_dp_get @
( s_ed_prop )
dump i_return_value
# The entity display property preference is
dump s_ed_prop
#---------------------------------------------------------------------
pref_entity_dp_set | () |
# Purpose : This file provides an example of a call to the
# function pref_entity_dp_set()
#
# This function sets the entity display property
# preference.This file opens a new database
# “new.db” and gets the display property
# preference.Later it sets the display property
# preference and gets the preference.There are
# two entity display property preferences
# namely “general” and “simple”.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_entity_dp_set()
# has the following arguments:
#
# pref_entity_dp_set
# ( ed_prop )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_ed_prop[32]
STRING s_ed_prop_c[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
pref_entity_dp_get @
( s_ed_prop_c )
dump i_return_value
# The entity display property preference is
dump s_ed_prop_c
# Session file paused. Press “Resume” to continue..
sf_pause()
# Change the entity display property preference
s_ed_prop = “simple”
i_return_value = @
pref_entity_dp_set @
( s_ed_prop )
dump i_return_value
i_return_value = @
pref_entity_dp_get @
( s_ed_prop_c )
dump i_return_value
# The entity display property preference is
dump s_ed_prop_c
#---------------------------------------------------------------------
pref_entity_set | () |
# Purpose : This file provides an example of a call to the
# function pref_entity_set()
#
# This function sets the graphics entity type
# preference parameters.This file opens a new
# database “new.db” and creates a solid.It
# later sets the render style to shaded with
# shade color GREEN. All other colors are set to
# BLUE and flags are set to TRUE.The change of
# the colors and flag can be noticed in the
# Entity Color/Label/Render form.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_entity_set() has the following arguments:
#
# pref_entity_set
# ( set_flag,
# ed_prop,
# r_style,
# precision,
# fa_vectors,
# dv_results,
# d_defo,
# shcolor,
# gcolor,
# lcolor,
# hpcolor,
# tscolor,
# bdcolor,
# ncolor,
# pecolor,
# bcolor,
# trcolor,
# qcolor,
# tecolor,
# wcolor,
# hecolor,
# mcolor,
# l_label,
# p_label,
# hp_label,
# ts_label,
# bd_label,
# n_label,
# pe_label,
# b_label,
# tr_label,
# q_label,
# te_label,
# w_label,
# he_label,
# m_label )
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL la_set_flag(37)
STRING s_ed_prop[32] = “general”
STRING s_r_style[32] = “SHADED”
INTEGER i_precision = 0
LOGICAL l_fa_vectors = TRUE
LOGICAL l_dv_results = TRUE
LOGICAL l_d_defo = TRUE
INTEGER i_shcolor = 2
INTEGER i_gcolor = 4
INTEGER i_lcolor = 4
INTEGER i_pcolor = 4
INTEGER i_hpcolor = 4
INTEGER i_tscolor = 4
INTEGER i_bdcolor = 4
INTEGER i_ncolor = 4
INTEGER i_pecolor = 4
INTEGER i_bcolor = 4
INTEGER i_trcolor = 4
INTEGER i_qcolor = 4
INTEGER i_tecolor = 4
INTEGER i_wcolor = 4
INTEGER i_hecolor = 4
INTEGER i_mcolor = 4
LOGICAL l_g_label = TRUE
LOGICAL l_l_label = TRUE
LOGICAL l_p_label = TRUE
LOGICAL l_hp_label = TRUE
LOGICAL l_ts_label = TRUE
LOGICAL l_bd_label = TRUE
LOGICAL l_n_label = TRUE
LOGICAL l_pe_label = TRUE
LOGICAL l_b_label = TRUE
LOGICAL l_tr_label = TRUE
LOGICAL l_q_label = TRUE
LOGICAL l_te_label = TRUE
LOGICAL l_w_label = TRUE
LOGICAL l_he_label = TRUE
LOGICAL l_m_label = TRUE
INTEGER i_return_value
STRING sv_asm_created_hpat_xyz[VIRTUAL]
INTEGER i_count
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# Create a solid
asm_const_hpat_xyz(“1”,”<1 1 1>”,”[0 0 0]”, @
“Coord 0”, sv_asm_created_hpat_xyz)
ga_view_aa_set(23.,56.,0.)
uil_toolbar.labels_on()
# Note the colors and the flags in the pulldown menu
# “DISPLAY” “/Entity/Color/Label/Render”
# Session file paused. Press “Resume” to continue..
sf_pause()
FOR( i_count = 1 TO 37 )
la_set_flag(i_count) = TRUE
END FOR
i_return_value = @
pref_entity_set @
( la_set_flag, @
s_ed_prop, @
s_r_style, @
i_precision, @
l_fa_vectors, @
l_dv_results, @
l_d_defo, @
i_shcolor, @
i_gcolor, @
i_lcolor, @
i_pcolor, @
i_hpcolor, @
i_tscolor, @
i_bdcolor, @
i_ncolor, @
i_pecolor, @
i_bcolor, @
i_trcolor, @
i_qcolor, @
i_tecolor, @
i_wcolor, @
i_hecolor, @
i_mcolor, @
l_g_label, @
l_l_label, @
l_p_label, @
l_hp_label, @
l_ts_label, @
l_bd_label, @
l_n_label, @
l_pe_label, @
l_b_label, @
l_tr_label, @
l_q_label, @
l_te_label, @
l_w_label, @
l_he_label, @
l_m_label )
dump i_return_value
# Note the colors and the flags in the pulldown menu
# “DISPLAY” “Entity/Color/Label/Render”
# The shade color is green and render style is shaded.
# All other colors are blue and label are True.
SYS_FREE_STRING(sv_asm_created_hpat_xyz)
#---------------------------------------------------------------------
pref_env_get_integer | () |
# Purpose : This file provides an example of a call to the
# function pref_env_get_integer()
#
# This function retrieves the value of the
# integer preference.This file sets the value
# of the integer preference for the preference
# MESSAGE_WARNING and later gets it.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_env_get_integer()
# has the following arguments:
#
# pref_env_get_integer
# ( prefname,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_prefname[32]
INTEGER i_value
INTEGER i_value_c
INTEGER i_return_value
#---------------------------------------------------------------------
# Set the integer preference for MESSAGE_WARNING to 3.
s_prefname = “message_warning”
i_value_c = 3
i_return_value = @
pref_env_set_integer @
( s_prefname, @
i_value_c )
dump i_return_value
# Get the integer preference.
i_return_value = @
pref_env_get_integer @
( s_prefname, @
i_value )
dump i_return_value
# The value of integer preference is
dump i_value
#---------------------------------------------------------------------
pref_env_get_logical | () |
# Purpose : This file provides an example of a call to the
# function pref_env_get_logical()
#
# This function retrieves the value of the
# logical preference.This file sets the value
# of the logical preference for the preference
# DISPLAY_TEMPLATE_PREFERENCE and later gets it.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_env_get_logical()
# has the following arguments:
#
# pref_env_get_logical
# ( prefname,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_prefname[32]
LOGICAL l_value
LOGICAL l_value_c
INTEGER i_return_value
#---------------------------------------------------------------------
# Set the logical preference for DISPLAY_TEMPLATE_PREFERENCE to TRUE.
s_prefname = “display_template_preference”
l_value_c = TRUE
i_return_value = @
pref_env_set_logical @
( s_prefname, @
l_value_c )
dump i_return_value
# Get the logical preference.
i_return_value = @
pref_env_get_logical @
( s_prefname, @
l_value )
dump i_return_value
# The value of logical preference is
dump l_value
#---------------------------------------------------------------------
pref_env_get_real | () |
# Purpose : This file provides an example of a call to the
# function pref_env_get_real()
#
# This function retrieves the value of the
# real preference.This file sets the value
# of the real preference for the preference
# TOOLBARHEIGHT and later gets it.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_env_get_real()
# has the following arguments:
#
# pref_env_get_real
# ( prefname,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_prefname[32]
REAL r_value
REAL r_value_c
INTEGER i_return_value
#---------------------------------------------------------------------
# Set the real preference for TOOLBARHEIGHT to 0.799705.
s_prefname = “ToolbarHeight”
r_value_c = 0.799705
i_return_value = @
pref_env_set_real @
( s_prefname, @
r_value_c )
dump i_return_value
# Get the real preference.
i_return_value = @
pref_env_get_real @
( s_prefname, @
r_value )
dump i_return_value
# The value of real preference is
dump r_value
#---------------------------------------------------------------------
pref_env_get_string | () |
# Purpose : This file provides an example of a call to the
# function pref_env_get_string()
#
# This function retrieves the value of the
# string preference.This file sets the value
# of the string preference for the preference
# graphics_refresh and later gets it.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_env_get_string()
# has the following arguments:
#
# pref_env_get_string
# ( prefname,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_prefname[32]
STRING s_value[32]
STRING s_value_c[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Set the string preference for “graphics_refresh” to “NO”
s_prefname = “graphics_refresh”
s_value_c = “NO”
i_return_value = @
pref_env_set_string @
( s_prefname, @
s_value_c )
dump i_return_value
# Get the string preference.
i_return_value = @
pref_env_get_string @
( s_prefname, @
s_value )
dump i_return_value
# The value of string preference is
dump s_value
#---------------------------------------------------------------------
pref_fa_get | () |
# Purpose : This file provides an example of a call to the
# function pref_fa_get()
#
# This function returns the load-boundary colors,
# load-boundary flags, element_property colors,
# element property flags and the display fem flag.
# The function returns 0 if executed with success,
# else returns 1.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_fa_get()
# has the following arguments:
#
# pref_fa_get
# ( ia_lbc_colors,
# la_lbc_display,
# ia_ep_colors,
# la_ep_display
# l_display_fem )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER ia_lbc_color(40)
LOGICAL la_lbc_display(40)
INTEGER ia_ep_color(10)
LOGICAL la_ep_display(10)
LOGICAL l_display_fem
INTEGER i_status
#----------------------------------------------------------------------
# Open a new database
if(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
endif
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#---------------------------------------------------------------------
# Using the function pref_fa_get to get lbc colors & flags,
# ep colors & flag and fem display flag
i_status = pref_fa_get( @
ia_lbc_color, @
la_lbc_display, @
ia_ep_color, @
la_ep_display, @
l_display_fem )
dump ia_lbc_color
dump la_lbc_display
dump ia_ep_color
dump la_ep_display
dump l_display_fem
dump i_status
#---------------------------------------------------------------------
# Closing the file - new.db
uil_file_close.goquit()
#---------------------------------------------------------------------
pref_fa_set | () |
# Purpose : This file provides an example of a call to the
# function pref_fa_set()
#
# This function sets the load-boundary colors,
# load-boundary flags, element_property colors,
# element property flags and the display fem flag.
# The function returns 0 if executed with success,
# else returns 1.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
#
# The function pref_fa_set()
# has the following arguments:
#
# pref_fa_set
# ( la_set_flag,
# ia_lbc_colors,
# la_lbc_display,
# ia_ep_colors,
# la_ep_display,
# l_display_fem )
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL la_set_flag(101)
INTEGER ia_lbc_color(40)
LOGICAL la_lbc_display(40)
INTEGER ia_ep_color(10)
LOGICAL la_ep_display(10)
LOGICAL l_display_fem
INTEGER i_status
INTEGER i
#----------------------------------------------------------------------
# Open a new database
if(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
endif
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#---------------------------------------------------------------------
# Set the graphics entity type preferences
# Set all lbc color = 2 and flag = FALSE
# Set all entity property color = 5 and flag = FALSE
FOR ( i = 1 to 10)
ia_ep_color(i) = 5
la_ep_display(i) = FALSE
END FOR
FOR ( i = 1 to 40)
ia_lbc_color(i) = 2
la_lbc_display(i) = FALSE
END FOR
FOR ( i = 1 to 101)
la_set_flag(i) = FALSE
END FOR
#---------------------------------------------------------------------
# Using the function pref_fa_set to set lbc colors & flags,
# ep colors & flag and fem display flag
i_status = pref_fa_set( @
la_set_flag, @
ia_lbc_color, @
la_lbc_display, @
ia_ep_color, @
la_ep_display, @
l_display_fem )
dump la_set_flag
dump ia_lbc_color
dump la_lbc_display
dump ia_ep_color
dump la_ep_display
dump l_display_fem
dump i_status
#---------------------------------------------------------------------
# Closing the file - new.db
uil_file_close.goquit()
#---------------------------------------------------------------------
pref_geo_cid_int_string | () |
# Purpose : This file provides an example of a call to the
# function pref_geo_cid_int_string()
#
# This function constructs the select databox
# string from the coordinate frame id. This
# function assumes that the coordinate id is a
# valid id of the coordinate frame. This file
# opens a new database “new.db” and gets the
# select databox string for default coordinate
# frame which has id = 0.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_geo_cid_int_string()
# has the following arguments:
#
# pref_geo_cid_int_string
# ( cid,
# sdb_string )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_cid
STRING s_sdb_string[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# i_cid = 0 (Default coordinate frame)
i_cid = 0
i_return_value = @
pref_geo_cid_int_string @
( i_cid, @
s_sdb_string )
dump i_return_value
# The SelectdataBox string is
dump s_sdb_string
#---------------------------------------------------------------------
pref_geo_cid_string_int | () |
# Purpose : This file provides an example of two calls to
# the function pref_geo_cid_string_int()
#
# This function gets default coordinate frame id
# from the select databox input string. This
# function verifies the existence of coordinate
# frame.This file opens a new database “new.db”
# and gets the select databox string for default
# coordinate frame which has id=0. Later it gets
# the id of the coordinate frame given the select
# databox string. It also shows an example of
# getting an id for a non existent coordinate
# frame.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_geo_cid_string_int()
# has the following arguments:
#
# pref_geo_cid_string_int
# ( sdb_string,
# cid )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_cid
INTEGER i_cid_c
STRING s_sdb_string[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# Get the select databox string for the default coordinate frame.
# i_cid_c = 0 (Default coordinate frame)
i_cid_c = 0
i_return_value = @
pref_geo_cid_int_string @
( i_cid_c, @
s_sdb_string )
dump i_return_value
# Get the id for default coordinate frame
i_return_value = @
pref_geo_cid_string_int @
( s_sdb_string, @
i_cid )
dump i_return_value
# The default coordinate frame id
dump i_cid
# Session file paused. Press “Resume” to continue..
sf_pause()
# Get the id for select databox string “Coord 1” which is not
# existing.
s_sdb_string = “Coord 1”
i_return_value = @
pref_geo_cid_string_int @
( s_sdb_string, @
i_cid )
dump i_return_value
# Error message generated since “Coord 1” doesnot exist.
#---------------------------------------------------------------------
pref_geo_get | () |
# Purpose : This file provides an example of a call to the
# function pref_geo_get()
#
# This function gets the geometric modeling
# parameters. This file opens a new database
# “new.db” and gets the geometric modeling
# parameters.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_geo_get() has the following arguments:
#
# pref_geo_get
# ( defcid,
# rgtol )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_defcid
REAL r_rgtol
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
pref_geo_get @
( i_defcid, @
r_rgtol )
dump i_return_value
# The default coordinate frame id is
dump i_defcid
# The relative geometric tolerance is
dump r_rgtol
#---------------------------------------------------------------------
pref_get_anal_attributes | () |
# Purpose : This file provides an example of a call to the
# function pref_get_anal_attributes()
#
# This function gets the analysis preference
# suffixes.This file opens a new database
# “new.db” and gets the analysis preference
# suffixes for analysis code MSC.Nastran.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_get_anal_attributes()
# has the following arguments:
#
# pref_get_anal_attributes
# ( anal_code,
# anal_type,
# mod_suf,
# res_suf )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_anal_code[32]
STRING s_anal_type[32]
STRING s_mod_suf[32]
STRING s_res_suf[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# s_anal_code = “MSC.Nastran”
s_anal_code = “MSC.Nastran”
i_return_value = @
pref_get_anal_attributes @
( s_anal_code, @
s_anal_type, @
s_mod_suf, @
s_res_suf )
dump i_return_value
# The analysis type name is
dump s_anal_type
# The model file suffix name is
dump s_mod_suf
# The results file suffix name is
dump s_res_suf
#---------------------------------------------------------------------
pref_get_anal_code_count | () |
# Purpose : This file provides an example of a call to the
# function pref_get_anal_code_count()
#
# This function counts the number of analysis
# codes.This file open a new database “new.db”
# and gets the count of number of analysis codes.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_get_anal_code_count()
# has the following arguments:
#
# pref_get_anal_code_count
# ( num_codes )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_num_codes
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
pref_get_anal_code_count @
( i_num_codes )
dump i_return_value
# The number of analysis codes in the database are
dump i_num_codes
#---------------------------------------------------------------------
pref_get_anal_type_count | () |
# Purpose : This file provides an example of a call to the
# function pref_get_anal_type_count()
#
# This function counts the number of analysis
# types.This file open a new database “new.db”
# and gets the count of number of analysis types
# for analysis code MSC.Nastran.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_get_anal_type_count()
# has the following arguments:
#
# pref_get_anal_type_count
# ( anal_code,
# num_types )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_anal_code[32]
INTEGER i_num_types
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# s_anal_code = MSC.Nastran
s_anal_code = “MSC.Nastran”
i_return_value = @
pref_get_anal_type_count @
( s_anal_code, @
i_num_types )
dump i_return_value
# The number of analysis types in the database are
dump i_num_types
#---------------------------------------------------------------------
pref_get_next_anal_code | () |
# Purpose : This file provides an example of a call to the
# function pref_get_next_anal_code()
#
# This function gets the next analysis code.
# This file open a new database “new.db” and
# gets the count of number of analysis codes
# and prepares for their fetch by calling
# db_get_all_anal_codes.Later it uses the
# above function to get the next analysis code.
#
# This file can be run by starting a session of
# SC/PATRAN, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_get_next_anal_code()
# has the following arguments:
#
# pref_get_next_anal_code
# ( anal_code )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_anal_code[32]
STRING s_msg[64]
INTEGER i_num_codes
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
pref_get_anal_code_count @
( i_num_codes )
dump i_return_value
# The number of analysis codes in the database are
dump i_num_codes
WHILE( i_return_value == 0 )
i_return_value = @
pref_get_next_anal_code @
( s_anal_code )
IF( i_return_value == 0 ) THEN
dump s_anal_code
ELSE
dump i_return_value
msg_get_string(i_return_value,s_msg)
dump s_msg
END IF
END WHILE
#---------------------------------------------------------------------
pref_get_next_anal_type | () |
# Purpose : This file provides an example of a call to the
# function pref_get_next_anal_type()
#
# This function gets the next analysis type.
# This file open a new database “new.db” and
# gets the count of number of analysis types
# for analysis code MSC.Nastran and prepares for
# their fetch by calling db_get_all_anal_types.
# Later it uses the above function to get the
# next analysis type.
#
# This file can be run by starting a session of
# SC/PATRAN, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_get_next_anal_type()
# has the following arguments:
#
# pref_get_next_anal_type
# ( anal_type )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_anal_type[32]
STRING s_anal_code[32]
STRING s_msg[64]
INTEGER i_num_types
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# s_anal_code = MSC.Nastran
s_anal_code = “MSC.Nastran”
i_return_value = @
pref_get_anal_type_count @
( s_anal_code, @
i_num_types )
dump i_return_value
# The number of analysis types in the database are
dump i_num_types
WHILE( i_return_value == 0 )
i_return_value = @
pref_get_next_anal_type @
( s_anal_type )
IF( i_return_value == 0 ) THEN
dump s_anal_type
ELSE
dump i_return_value
msg_get_string(i_return_value,s_msg)
dump s_msg
END IF
END WHILE
#---------------------------------------------------------------------
pref_global_get | () |
# Purpose : This file provides an example of a call to the
# function pref_global_get()
#
# This function gets the global preference
# parameters. This file opens a new database
# “new.db” and gets the global preference
# parameters.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_global_get() has the following arguments:
#
# pref_global_get
# ( confirm,
# wm_opt,
# glo_mod_tol )
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL l_confirm
INTEGER i_wm_opt
REAL r_glo_mod_tol
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
pref_global_get @
( l_confirm, @
i_wm_opt, @
r_glo_mod_tol )
dump i_return_value
# The confirmation flag is
dump l_confirm
# The Warning message option is
dump i_wm_opt
# The global model tolerance is
dump r_glo_mod_tol
#---------------------------------------------------------------------
pref_graphics_get | () |
# Purpose : This file provides an example of a call to the
# function pref_graphics_get()
#
# This function gets the graphic preference
# parameters. This file opens a new database
# “new.db” and gets the graphic preference
# parameters.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_graphics_get() has the following arguments:
#
# pref_graphics_get
# ( disp_meth,
# p_color,
# s_color,
# e_color,
# extend,
# fit_view,
# center,
# hard_rend,
# anti_alias,
# td_vector,
# rt_display,
# s_light,
# p_marker,
# s_marker,
# m_color,
# m_size,
# gm_size,
# nm_size,
# l_format,
# nsigd )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_disp_meth
INTEGER i_p_color
INTEGER i_s_color
INTEGER i_e_color
LOGICAL l_extend
LOGICAL l_fit_view
LOGICAL l_center
LOGICAL l_hard_rend
LOGICAL l_anti_alias
LOGICAL l_td_vector
LOGICAL l_rt_display
LOGICAL l_s_light
INTEGER i_p_marker
INTEGER i_s_marker
INTEGER i_m_color
INTEGER i_m_size
INTEGER i_gm_size
INTEGER i_nm_size
INTEGER i_l_format
INTEGER i_nsigd
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
pref_graphics_get @
( i_disp_meth, @
i_p_color, @
i_s_color, @
i_e_color, @
l_extend, @
l_fit_view, @
l_center, @
l_hard_rend, @
l_anti_alias, @
l_td_vector, @
l_rt_display, @
l_s_light, @
i_p_marker, @
i_s_marker, @
i_m_color, @
i_m_size, @
i_gm_size, @
i_nm_size, @
i_l_format, @
i_nsigd )
dump i_return_value
# Display method is
dump i_disp_meth
# Primary color is
dump i_p_color
# Secondary color is
dump i_s_color
# Error color is
dump i_e_color
# Autoextend Flag is
dump l_extend
# Autofitview Flag is
dump l_fit_view
# Autocenter Flag is
dump l_center
# Hardware rendering Flag is
dump l_hard_rend
# Anti-Alias flag is
dump l_anti_alias
# 3-D vector Display Flag is
dump l_td_vector
# Result Title Display Flag is
dump l_rt_display
# Symmetric Light Flag is
dump l_s_light
# Primary marker is
dump i_p_marker
# Secondary marker is
dump i_s_marker
# Marker color is
dump i_m_color
# Marker size is
dump i_m_size
# Grid marker size is
dump i_gm_size
# Node marker size is
dump i_nm_size
# Results label format is
dump i_l_format
# Number of significant results digits are
dump i_nsigd
#---------------------------------------------------------------------
pref_graphics_marker_data_get | () |
# Purpose : This file provides an example of a call to the
# function pref_graphics_marker_data_get()
#
# This function gets the graphic preference
# parameters for markers. This file opens a
# new database “new.db” and gets the graphic
# preference parameters for the markers.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function pref_graphics_marker_data_get()
# has the following arguments:
#
# pref_graphics_marker_data_get
# ( p_marker,
# s_marker,
# m_color,
# m_size )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_p_marker
INTEGER i_s_marker
INTEGER i_m_color
INTEGER i_m_size
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
pref_graphics_marker_data_get @
( i_p_marker, @
i_s_marker, @
i_m_color, @
i_m_size )
dump i_return_value
# The primary marker is
dump i_p_marker
# The secondary marker is
dump i_s_marker
# The marker color is
dump i_m_color
# The marker size is
dump i_m_size
#---------------------------------------------------------------------