app_count_list | () |
# Purpose : This file gives an example of three calls to
# the function app_count_list()
#
# A list containing 6 points, 4 curves and
# 25 nodes is passed to the function. In the
# first call, list processor is asked to count
# the number of points in the list. In the
# second call, it is asked to count the number
# of curves and in the final call, it is asked
# to count the number of nodes in the list.
#
# Before running this file the database should be
# created by running the session file “cube.ses”
# To run this session file, first start
# a session of MSC Patran,then run this session
# file by “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function has the following arguments:
# app_count_list
# ( type
# list
# domesg
# status )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_type,i_status
STRING s_list[128]
LOGICAL l_domesg
INTEGER i_return_value
# -------------------------------------------------------------------
# opening the existing database cube.db
uil_file_open.go(“cube.db”)
# -------------------------------------------------------------------
# Calling the function with item type LP_SUBLIST_POINT. List
# processor will count the points in the input list.
# The relevant integer value for the particular item type can be
# found in file “lpenums.i”
#
i_type = 4 /* For LP_SUBLIST_POINT from “lpenums.i” */
s_list = “Node 1:25 Point 1:6 Curve 1:4”
l_domesg = TRUE
i_return_value = @
app_count_list @
( i_type, @
s_list, @
l_domesg, @
i_status )
# Checking the status(Success) of List processor
dump i_status
# The number of points in the in put list(i.e)s_list
dump i_return_value
# Session file paused. Observe number of points dumped and press
# “Resume” to continue.
sf_pause()
# -------------------------------------------------------------------
# Calling the function with item type LP_SUBLIST_CURVE. List
# processor will count the number of curves in the list supplied.
#
i_type = 8 /* For LP_SUBLIST_CURVE from “lpenums.i” */
i_return_value = @
app_count_list @
( i_type, @
s_list, @
l_domesg, @
i_status )
# Checking the status(Success) of List processor
dump i_status
# The number of curves in the in put list(i.e)s_list
dump i_return_value
# Session file paused. Observe number of curves dumped and press
# “Resume” to continue.
sf_pause()
# -------------------------------------------------------------------
# Calling the function with item type LP_SUBLIST_NODE. List
# processor will count the number of NODES in the list supplied.
#
i_type = 512 /* For LP_SUBLIST_NODE from “lpenums.i” */
i_return_value = @
app_count_list @
( i_type, @
s_list, @
l_domesg, @
i_status )
# Checking the status(Success) of List processor
dump i_status
# The number of nodes in the in put list(i.e)s_list
dump i_return_value
# Observe number of curves dumped.
# -------------------------------------------------------------------
app_count_list | () |
# Purpose : This file gives an example of three calls to
# the function app_count_list()
#
# A list containing 6 points, 4 curves and
# 25 nodes is passed to the function. In the
# first call, list processor is asked to count
# the number of points in the list. In the
# second call, it is asked to count the number
# of curves and in the final call, it is asked
# to count the number of nodes in the list.
#
# Before running this file the database should be
# created by running the session file “cube.ses”
# To run this session file, first start
# a session of MSC Patran,then run this session
# file by “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function has the following arguments:
# app_count_string
# ( type
# list
# domesg
# status )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_type,i_status
STRING s_list[128]
LOGICAL l_domesg
INTEGER i_return_value
# -------------------------------------------------------------------
# opening the existing database cube.db
uil_file_open.go(“cube.db”)
# -------------------------------------------------------------------
# Calling the function with item type LP_SUBLIST_POINT. List
# processor will count the points in the input list.
# The relevant integer value for the particular item type can be
# found in file “lpenums.i”
#
i_type = 4 /* For LP_SUBLIST_POINT from “lpenums.i” */
s_list = “Node 1:25 Point 1:6 Curve 1:4”
l_domesg = TRUE
i_return_value = @
app_count_list @
( i_type, @
s_list, @
l_domesg, @
i_status )
# Checking the status(Success) of List processor
dump i_status
# The number of points in the in put list(i.e)s_list
dump i_return_value
# Session file paused. Observe number of points dumped and press
# “Resume” to continue.
sf_pause()
# -------------------------------------------------------------------
# Calling the function with item type LP_SUBLIST_CURVE. List
# processor will count the number of curves in the list supplied.
#
i_type = 8 /* For LP_SUBLIST_CURVE from “lpenums.i” */
i_return_value = @
app_count_list @
( i_type, @
s_list, @
l_domesg, @
i_status )
# Checking the status(Success) of List processor
dump i_status
# The number of curves in the in put list(i.e)s_list
dump i_return_value
# Session file paused. Observe number of curves dumped and press
# “Resume” to continue.
sf_pause()
# -------------------------------------------------------------------
# Calling the function with item type LP_SUBLIST_NODE. List
# processor will count the number of NODES in the list supplied.
#
i_type = 512 /* For LP_SUBLIST_NODE from “lpenums.i” */
i_return_value = @
app_count_list @
( i_type, @
s_list, @
l_domesg, @
i_status )
# Checking the status(Success) of List processor
dump i_status
# The number of nodes in the in put list(i.e)s_list
dump i_return_value
# Observe number of curves dumped.
# -------------------------------------------------------------------
app_db_err_msg | () |
# Purpose : This file gives an example of a call to the
# function app_db_err_msg()
#
# In this file, a standard error message code
# is used. The app_db_err_msg() function
# will show a error message form upon being
# called with this error code.
#
# To run this session file,start a session of
# MSC Patran, run the session file by “File”,
# “Session”,”Play” pulldown menus on the menu
# bar.
#
# The function has the following arguments:
# app_db_err_msg
# ( msgcode
# ints
# reals
# chars
# string )
#
# -------------------------------------------------------------------
# Variable Declaration
#
LOGICAL l_domesg
STRING s_db_routine[64], s_caller[64]
INTEGER i_status, i_id, DISPLAYMETHOD
# -------------------------------------------------------------------
# Call the function with db_routine=db_get_pref(), status code
# 13000088 and id=DISPLAYMETHOD. Id of the item causing error can be
# found in the file “P3_HOME/customization/pref_names.i”. In this
# file, DISPLAYMETHOD has been defined a value of 501.
# ( When db_get_pref() is called with pref_id=DISPLAYMETHOD, if
# preference is not found, then MSC Patran gives the return value of
# 13000088. Refer Chapter 16,Section 16.1 of MSC Develop Manual
# for db_get_pref() function )
#
l_domesg = TRUE
s_db_routine = “db_get_pref”
s_caller = “uil_primary.default_graphics”
i_status = 13000088 /* return value of db_get_pref() */
DISPLAYMETHOD = 501 /* from “pref_names.i” */
i_id = DISPLAYMETHOD
app_db_err_msg @
( l_domesg, @
s_db_routine, @
s_caller, @
i_status, @
i_id )
# -------------------------------------------------------------------
app_ids_to_vstring | () |
# Purpose : This file gives an example of three calls to
# the function app_ids_to_vstring()
#
# A id array containing 4 ids is passed to the
# function. In the first call to the function,
# LpCURVE is selected as the list processor
# type. In the subsequent calls, LpLINE and
# LpSURFACE is selected as List processor type.
# List processor will process the input array
# and output a string according to its type.
#
# To run this session file, Start a session of
# MSC Patran, run the session file by “File”,
# “Session”,”Play” pulldown menus on the menu
# bar.
#
# The function has the following arguments:
# app_ids_to_vstring
# ( idarray
# numval
# type
# appstr )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_idarray(4)=[1, 2, 3, 5] /* 4 id values supplied as input */
INTEGER i_numval,i_type
STRING s_appstr[VIRTUAL]
INTEGER i_return_value
# -------------------------------------------------------------------
# Calling the function with List Processor type LpCURVE. List
# processor will consider input idarray as array of Curve ids.
# The relevant integer value for the particular List Processor type
# can be found in file “lpkeywords.i”
#
i_numval=4 /* Number of id values supplied */
i_type = 3 /* For LpCURVE from “lpkeywords.i” */
i_return_value = @
app_ids_to_vstring @
( i_idarray, @
i_numval, @
i_type, @
s_appstr )
# Checking the success of the command
dump i_return_value
# Dumping the string created by the List Processor
dump s_appstr
# Session file paused. Observe the string created by List Processor
# and press “Resume” to continue.
sf_pause()
# -------------------------------------------------------------------
# Calling the function with List Processor type LpLINE. List
# processor will consider input idarray as array of Line ids.
#
i_type = 4 /* For LpLINE from “lpkeywords.i” */
i_return_value = @
app_ids_to_vstring @
( i_idarray, @
i_numval, @
i_type, @
s_appstr )
# Checking the success of the command
dump i_return_value
# Dumping the string created by the List Processor
dump s_appstr
# Session file paused. Observe the string created by List Processor
# and press “Resume” to continue.
sf_pause()
# -------------------------------------------------------------------
# Calling the function with List Processor type LpSURFACE. List
# processor will consider input idarray as array of Surface ids.
#
i_type = 5 /* For LpSURFACE from “lpkeywords.i” */
i_return_value = @
app_ids_to_vstring @
( i_idarray, @
i_numval, @
i_type, @
s_appstr )
# Checking the success of the command
dump i_return_value
# Dumping the string created by the List Processor
dump s_appstr
sys_free_string(s_appstr)
# -------------------------------------------------------------------
app_int_array_to_vstring | () |
# Purpose : This file gives an example of two calls to
# the function app_int_array_to_vstring()
#
# A id array containing 4 ids is passed to the
# function. In the first call to the function,
# “Point” is sent as prefix. In the second call
# to the function,”Line” is sent as prefix. The
# list processor will prepend this prefix to the
# id array and create the output string.
#
# To run this session file, Start a session of
# MSC Patran, run the session file by “File”,
# “Session”,”Play” pulldown menus on the menu
# bar.
#
# The function has the following arguments:
# app_int_array_to_vstring
# ( prefix
# numval
# inlist
# virtsym )
#
# -------------------------------------------------------------------
# Variable Declaration
#
STRING s_prefix[8]
INTEGER i_inlist(4)=[1, 2, 3, 4] /* 4 id values supplied as input */
INTEGER i_numval
STRING s_virtsym[VIRTUAL]
INTEGER i_return_value
# -------------------------------------------------------------------
# Calling the function with prefix = “Point”
#
s_prefix=”Point”
i_numval=4 /* Number of id values supplied */
i_return_value = @
app_int_array_to_vstring @
( s_prefix, @
i_numval, @
i_inlist, @
s_virtsym )
# Checking the success of the command
dump i_return_value
# Dumping the string created by the List Processor
dump s_virtsym
# Session file paused. Observe the string created by List Processor
# and press “Resume” to continue.
sf_pause()
# -------------------------------------------------------------------
# Calling the function with prefix = “Line”
#
s_prefix=”Line”
i_return_value = @
app_int_array_to_vstring @
( s_prefix, @
i_numval, @
i_inlist, @
s_virtsym )
# Checking the success of the command
dump i_return_value
# Dumping the string created by the List Processor
dump s_virtsym
sys_free_string(s_virtsym)
# -------------------------------------------------------------------
appcode | () |
# Purpose : This file gives an example of a call to the
# function appcode()
#
# In this example, an error code 1000001 has
# been passed as argument. The function returns
# 1000000 showing that the error occured from
# application 1000000 (i.e ASM)
#
# To run this session file,first start
# a session of MSC Patran,open a database or
# start a new database,then run this session
# file by “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function has the following arguments:
# appcode
# ( status )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_status = 1000001
INTEGER i_return_value
# -------------------------------------------------------------------
i_return_value = @
appcode @
( i_status )
dump i_return_value
# -------------------------------------------------------------------
asm_u_coord_global_to_local | () |
# Purpose : This file provides an example of a call to the
# function asm_u_coord_global_to_local()
#
# This function transforms points from global
# coordinates to a local coordinate frame.
# This file transforms a given point from
# global coordinates to local coordinates.
#
# 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 asm_u_coord_global_to_local()
# has the following arguments:
#
# asm_u_coord_global_to_local
# ( p,
# t,
# r,
# itype,
# npts )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL ra_p(3) = [2, 3, 0]
REAL ra_t(3) = [1, 1, 1]
REAL ra_r(9) = [0, 1, 0, 1, 0, 0, 0, 0, 1]
INTEGER i_itype
INTEGER i_npts
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#---------------------------------------------------------------------
# The rotation matrix interchanges the x and y axis of the
# present coordinate system to get the local coordinate system.
# i_itype = 1 (rectangular coordinate frame )
i_itype = 1
i_npts = 1
i_npts = 1
asm_u_coord_global_to_local @
( ra_p, @
ra_t, @
ra_r, @
i_itype, @
i_npts )
# The local coordinates of the points
dump ra_p
#---------------------------------------------------------------------
# Closes the Patran Environment
uil_file_close.goquit()
#---------------------------------------------------------------------
# End of File.
asm_u_lp_get_entity_label | () |
# Purpose : This file provides an example of a call to the
# function asm_u_lp_get_entity_label()
#
# 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 asm_u_lp_get_entity_label() has the following
# arguments:
# asm_u_lp_get_entity_label
# ( label_handle,
# list,
# last_supplied_label,
# domesg,
# label,
# status )
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_label_handle
STRING s_list[128]
LOGICAL l_last_supplied_label,l_domesg
INTEGER i_label, i_status
INTEGER i_method,i_count
INTEGER i_return_value
#---------------------------------------------------------------------
# Call lp_eval() to initialize the list processor with
# LP_EVAL_FOR_TOKENS as evaluation method.
s_list = “10 2.345 6 9.455”
# Use the LP_EVAL_FOR_TOKENS evaluation method.
# from lpenum.i for LP_EVAL_FOR_TOKENS
i_method = 3
i_return_value = lp_eval(s_list, i_method, i_label_handle)
dump i_return_value
l_last_supplied_label = FALSE
l_domesg = TRUE
i_count = 0
WHILE ((i_return_value == 0) && (i_count < 4))
asm_u_lp_get_entity_label @
(i_label_handle, @
s_list, @
l_last_supplied_label, @
l_domesg, @
i_label, @
i_status)
dump i_count
dump i_status
dump i_label
write (“ “)
i_count = i_count + 1
END WHILE
lp_eval_cleanup(i_label_handle)
#---------------------------------------------------------------------
asm_u_lp_get_point | () |
# Purpose : This file gives an example of two calls to
# the function asm_u_lp_get_point()
#
# This file will open a new database and creates
# a point in it. Then, it calls the function
# asm_u_lp_get_point() to get the coordinates of
# the created point.
#
# To run this session file, Start a session of
# MSC Patran, run the session file by “File”,
# “Session”,”Play” pulldown menus on the menu
# bar.
#
# The function has the following arguments:
# asm_u_lp_get_point
# ( point_list
# do_message
# point_coords
# status )
#
# -------------------------------------------------------------------
# Variable Declaration
#
STRING s_point_list[32]
LOGICAL l_do_message
REAL r_point_coords(3)
INTEGER i_status
STRING asm_create_grid_xyz_created_ids[VIRTUAL]
# -------------------------------------------------------------------
# Open a new database. Creating FOUR points by calling the function
# asm_const_grid_xyz(). Function assigns default id numbers to the
# created points.
#
uil_file_new.go(““,”new.db”)
$? YES 36000002
asm_const_grid_xyz @
( ““, @
“[5 10 0]”, @
“Coord 0”, @
asm_create_grid_xyz_created_ids )
# -------------------------------------------------------------------
# Call the function with point_list=”Point 1” to get the coordinates
# of the point 1.
#
s_point_list=”Point 1”
l_do_message=TRUE
asm_u_lp_get_point @
( s_point_list, @
l_do_message, @
r_point_coords, @
i_status )
# Checking the success of the command
dump i_status
# Dumping the string created by the List Processor
dump r_point_coords
# Observe the coordinates given by List Processor.
# Session file paused.Press “Resume” to continue.
sf_pause()
# Closing the database..
uil_file_close.go()
# -------------------------------------------------------------------
asm_u_lp_get_vector | () |
# Purpose : This file gives an example of a call to the
# function asm_u_lp_get_vector()
#
# This file will open a new database and create a
# vector in it.Then it calls asm_u_lp_get_vector
# to get the coordinates of the vector.
#
# To run this session file, Start a session of
# MSC Patran, run the session file by “File”,
# “Session”,”Play” pulldown menus on the menu
# bar.
#
# The function has the following arguments:
# asm_u_lp_get_vector
# ( vector
# do_message
# vector_coords
# status )
#
# -------------------------------------------------------------------
# Variable Declaration
#
STRING s_vector[32]
LOGICAL l_do_message
REAL r_vector_coords(3)
INTEGER i_status
STRING sgm_create_vector_m_created_ids[VIRTUAL]
# -------------------------------------------------------------------
# Open a new database. Create a VECTOR by calling the function
# sgm_const_vector_magnitude().
#
uil_file_new.go(““,”new.db”)
$? YES 36000002
sgm_const_vector_magnitude @
( “1”, @
“1.0”, @
“<4 2 4>”, @
“[0 0 0]”, @
“Coord 0”, @
sgm_create_vector_m_created_ids )
sf_pause()
# -------------------------------------------------------------------
# Call the function with vector list “Vector 1” to get the
# coordinates of the Vector 1.
#
s_vector=”Vector 1”
l_do_message=TRUE
asm_u_lp_get_vector @
( s_vector, @
l_do_message, @
r_vector_coords, @
i_status )
# Checking the success of the command
dump i_status
# Dumping the string created by the List Processor
dump r_vector_coords
# Observe the coordinates given by List Processor.
# Close the database.
uil_file_close.go()
# Free the memory of virtual array.
sys_free_string(sgm_create_vector_m_created_ids)
# -------------------------------------------------------------------
lp_eval_cleanup | () |
# Purpose : This file gives an example of a call to
# the function lp_eval_cleanup()
#
# A simple list processor operation is selected
# to see when lp_eval_cleanup() should be called.
# First, list processor is initialized by calling
# the function lp_eval(). A small list is passed
# to the list processor. Number of Points and
# number of Nodes are counted by calling the
# function lp_sublist_count(). Finally,memory
# occupied by list processor is freed by calling
# lp_eval_cleanup()
#
# To run this session file, Start a session of
# MSC Patran, run the session file by “File”,
# “Session”,”Play” pulldown menus on the menu
# bar.
#
# The function has the following arguments:
# lp_eval_cleanup
# ( handle )
# -------------------------------------------------------------------
# Variable Declaration
INTEGER i_handle, i_count
INTEGER i_method, i_filter
STRING s_list[32]
INTEGER i_return_value
# -------------------------------------------------------------------
# Initializing List Processor to process a List.
#
s_list=”Point 1 3 5 8 9 Node 1:10” /* Input list */
i_method=4 /* from lpenums.i for LP_EVAL_FOR_ID */
i_return_value = @
lp_eval @
( s_list, @
i_method, @
i_handle )
# Count the number of points in the input list by calling the
# function lp_sublist_count(). This function requires a filter to
# evaluate the list.To count the points LP_SUBLIST_POINT is selected
# as the filter.
#
i_filter=4 /* from lpenums.i for LP_SUBLIST_POINT */
i_return_value = @
lp_sublist_count @
( i_handle, @
i_filter, @
i_count )
# The number of Points in the input list is
dump i_count
# Count the number of Nodes in the input list by calling the
# function lp_sublist_count(). This function requires a filter to
# evaluate the list.To count the Nodes LP_SUBLIST_NODE is selected
# as the filter.
#
i_filter=512 /* from lpenums.i for LP_SUBLIST_NODE */
i_return_value = @
lp_sublist_count @
( i_handle, @
i_filter, @
i_count )
# The number of Nodes in the input list is
dump i_count
# After finishing the list processor operations, memory should be
# freed by calling lp_eval_cleanup().
#
i_return_value = @
lp_eval_cleanup @
( i_handle )
# Checking the success of function
dump i_return_value
# -------------------------------------------------------------------
lp_geometry_text | () |
# Purpose : This file gives an example of two calls to
# the function lp_geometry_text()
#
# In the first call to the function,POINT is
# selected as the geometry type. In the next
# call, GRID is selected as geometry type.
#
# To run this session file, Start a session of
# MSC Patran, run the session file by “File”,
# “Session”,”Play” pulldown menus on the menu
# bar.
#
# The function has the following arguments:
# lp_geometry_text
# ( geo_keyword,
# geo_id_count,
# geo_id_list,
# text_len_max,
# text )
#
# -------------------------------------------------------------------
# Variable Declaration
INTEGER i_geo_keyword
INTEGER i_geo_id_list(4)=[1, 2, 3, 4]
INTEGER i_geo_id_count
INTEGER i_text_len_max
STRING s_text[VIRTUAL]
INTEGER i_return_value
# -------------------------------------------------------------------
# Calling the function with geometry type “Point”. geo_keyword for
# point from “lpkeywords.i” is 1.
#
i_geo_keyword=1 /* from lpkeywords.i for LpPOINT */
i_geo_id_count=4 /* Number of id values supplied */
i_text_len_max=32
i_return_value = @
lp_geometry_text @
( i_geo_keyword, @
i_geo_id_count, @
i_geo_id_list, @
i_text_len_max, @
s_text )
# Checking the success of the command
dump i_return_value
# Dumping the string created by the List Processor
dump s_text
# Session file paused. Observe the string created by List Processor
# and press “Resume” to continue.
sf_pause()
# -------------------------------------------------------------------
# Calling the function with geometry type “Grid”. “geo_keyword” for
# point from “lpkeywords.i” is 2.
#
i_geo_keyword=2 /* from lpkeywords.i for LpGRID */
i_return_value = @
lp_geometry_text @
( i_geo_keyword, @
i_geo_id_count, @
i_geo_id_list, @
i_text_len_max, @
s_text )
# Checking the success of the command
dump i_return_value
# Dumping the string created by the List Processor
dump s_text
# Observe the string created by List Processor
# -------------------------------------------------------------------
lp_keyword_text | () |
# Purpose : This file gives an example of two calls to
# the function lp_keyword_text()
#
# In the first call to the function,LpPOINT
# is selected as the Keyword and LpGEOMETRY is
# selected as Family. In the second call,
# LpNODE is selected as Keyword and
# LpFINITE_ELEMENT is selected as Family.
# The function gives the keyword which MSC Patran
# uses to describe the entity.
#
# To run this session file, Start a session of
# MSC Patran, run the session file by “File”,
# “Session”,”Play” pulldown menus on the menu
# bar.
#
# The function has the following arguments:
# lp_keyword_text
# ( keyword,
# family,
# text )
#
# -------------------------------------------------------------------
# Variable Declaration
INTEGER i_keyword
INTEGER i_family
STRING s_text[32]
INTEGER i_return_value
# -------------------------------------------------------------------
# Calling the function with family “LpGEOMETRY” and keyword “LpPOINT”
# Both from “lpkeywords.i”
#
i_keyword=1 /* from lpkeywords.i for LpPOINT */
i_family =3 /* from lpkeywords.i for LpGEOMETRY */
i_return_value = @
lp_keyword_text @
( i_keyword, @
i_family, @
s_text )
# Checking the success of the command
dump i_return_value
# Dumping the string created by the List Processor
dump s_text
# Session file paused. Observe the string created by List Processor
# and press “Resume” to continue.
sf_pause()
# -------------------------------------------------------------------
# Calling the function with family “LpFINITE_ELEMENT” and keyword
# “LpNODE”. Both from “lpkeywords.i”
#
i_keyword=1 /* from lpkeywords.i for LpNODE */
i_family =4 /* from lpkeywords.i for LpFINITE_ELEMENT */
i_return_value = @
lp_keyword_text @
( i_keyword, @
i_family, @
s_text )
# Checking the success of the command
dump i_return_value
# Dumping the string created by the List Processor
dump s_text
# Observe the string created by List Processor
# -------------------------------------------------------------------
msg_format_string | () |
# Purpose : This file gives an example of two calls to the
# function msg_format_string()
#
# In the first call to the function, standard
# MSC Patran message has been called. In the second
# call to the function, an user message has been
# called from the file “user_message.database”.
#
# To run this session file, first place the file
# “user_messages.database” in the MSC Patran path,
# preferably in the current directory.
# Start a session of MSC Patran, run the session
# file by “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function has the following arguments:
# msg_format_string
# ( msgcode
# ints
# reals
# chars
# string )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_msgcode,i_ints(1)
REAL r_reals(1)
STRING s_chars[128],s_op_string[128]
INTEGER i_return_value
# -------------------------------------------------------------------
# Call the standard MSC Patran message(from messages.database)
# To know the message related to i_msgcode, call msg_get_string()
# as follows.
# i_msgcode=36000003 (From utility FILE)
#
i_msgcode=36000003
msg_get_string(i_msgcode,s_op_string)
dump s_op_string
# Session file paused. Observe the string and press “Resume” to
# continue.
sf_pause()
# Now format the message.
# i_ints(1)=0
# r_reals(1)=0.0
# s_chars=”new.db”
#
i_ints(1)=0
r_reals(1)=0.0
s_chars=”new.db”
i_return_value = @
msg_format_string @
( i_msgcode, @
i_ints, @
r_reals, @
s_chars, @
s_op_string )
dump i_return_value
dump s_op_string
# Compare this formatted output with the previous one.
# Press “Resume” to continue session file.
sf_pause()
# -------------------------------------------------------------------
# Call the user message from user_message.database
# Again to know the message related to i_msgcode, call
# msg_get_string() as follows.
# i_msgcode=1000000001
#
i_msgcode=1000000001
msg_get_string(i_msgcode,s_op_string)
dump s_op_string
# Session file paused. Observe the string and press “Resume” to
# continue.
sf_pause()
# Now format the message.
# i_ints(1)=10
# r_reals(1)=10.0
# s_chars=”new.db”
#
i_ints(1)=10
r_reals(1)=10.0
s_chars=”new.db”
i_return_value = @
msg_format_string @
( i_msgcode, @
i_ints, @
r_reals, @
s_chars, @
s_op_string )
dump i_return_value
dump s_op_string
# Compare this formatted output with the previous one.
# -------------------------------------------------------------------
msg_get_application | () |
# Purpose : This file gives an example of a call to the
# function msg_get_application()
#
# In this example, a message code 36000001 has
# been passed as argument. The function returns
# 36000000 showing that the message occured from
# application 36000000 (i.e FILE)
#
# To run this session file,select “File”,
# “Session”,”Play” pulldown menus on the menu
# bar.
#
# The function has the following arguments:
# msg_get_application
# ( msgcode )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_msgcode = 36000001
INTEGER i_return_value
# -------------------------------------------------------------------
i_return_value = @
msg_get_application @
( i_msgcode )
dump i_return_value
# -------------------------------------------------------------------
msg_string_more | () |
# Purpose : This file gives an example of a call to the
# function msg_string_more()
#
# The call to the function uses standard MSC Patran
# messages from the file “messages.database”
#
# To run this session file, Start a session of
# MSC Patran, run the session file by “File”,
# “Session”,”Play”pulldown menus on the menu bar.
#
# The function has the following arguments:
# msg_string_more
# ( string )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_msgcode,i_msgtype,i_appcode,i_ints(1)
REAL r_reals(1)
STRING s_chars[128],s_op_string[128]
INTEGER i_return_value
# -------------------------------------------------------------------
# Call the message with msg_code=36000001 from the messages.database
# Format the message using the following parameters.
# i_msgcode=36000001
# i_msgtype=4 ( value 4 stands for error message )
# i_appcode=36000000
# i_ints(1)=0
# r_reals(1)=0.0
# s_chars=”new.db”
#
i_msgcode=36000001
i_msgtype=4
i_appcode=36000000
i_ints(1)=10
r_reals(1)=10.0
s_chars=”new.db”
# To see what message is there for msg_code=36000001 call
# msg_to_form() function. It displays the message.Note the
# message and Press O.K to proceed.
msg_to_form @
( i_msgcode, @
i_msgtype, @
i_appcode, @
i_ints, @
r_reals, @
s_chars )
i_return_value = @
msg_to_string @
( i_msgcode, @
i_msgtype, @
i_appcode, @
i_ints, @
r_reals, @
s_chars, @
s_op_string )
dump i_return_value
dump s_op_string
# Compare this output with the message form displayed earlier.
# Also note that the return value shows the number of characters
# left in the string. To get it, call the function msg_string_more().
# Dump the string to see the string.
WHILE ( 0 != i_return_value )
i_return_value = @
msg_string_more @
( s_op_string )
dump i_return_value
dump s_op_string
END WHILE
# Note that function msg_string_more() gets the next piece of message
# string till the end of the message.
# -------------------------------------------------------------------
msg_to_file | () |
# Purpose : This file gives an example of a call to the
# function msg_to_file()
#
# The call to the function uses standard MSC Patran
# messages from the file “messages.database”
# It writes this message to a file “msg.file”
#
# To run this session file, Start a session of
# MSC Patran, run the session file by “File”,
# “Session”,”Play”pulldown menus on the menu bar.
#
# The function has the following arguments:
# msg_to_file
# ( msgcode
# msgtype
# appcode
# ints
# reals
# chars
# maxout
# unit )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_msgcode,i_msgtype,i_appcode,i_ints(1),i_chan
REAL r_reals(1)
STRING s_chars[128]
INTEGER i_maxout, i_return_value
# -------------------------------------------------------------------
# Call the message with msg_code=36000001 from the messages.database
# Format the message using the following parameters.
# i_msgcode=36000001
# i_msgtype=4 ( value 4 stands for error message )
# i_appcode=36000000
# i_ints(1)=0
# r_reals(1)=0.0
# s_chars=”new.db”
# i_maxout = 1
#
i_msgcode=36000001
i_msgtype=4
i_appcode=36000000
i_ints(1)=0
r_reals(1)=0.0
s_chars=”new.db”
i_maxout = 1
# To see what message is there for msg_code=36000001 call
# msg_to_form() function. It displays the message.Note the
# message and Press O.K to proceed.
msg_to_form @
( i_msgcode, @
i_msgtype, @
i_appcode, @
i_ints, @
r_reals, @
s_chars )
i_return_value=text_open(“msg.file”,”NOWA”,0,0,i_chan)
dump i_return_value
i_return_value = @
msg_to_file @
( i_msgcode, @
i_msgtype, @
i_appcode, @
i_ints, @
r_reals, @
s_chars, @
i_maxout, @
i_chan )
dump i_return_value
text_close(i_chan,””)
# -------------------------------------------------------------------
msg_to_string | () |
# Purpose : This file gives an example of a call to the
# function msg_to_string()
#
# The call to the function uses standard MSC Patran
# messages from the file “messages.database”
#
# To run this session file, Start a session of
# MSC Patran, run the session file by “File”,
# “Session”,”Play”pulldown menus on the menu bar.
#
# The function has the following arguments:
# msg_to_string
# ( msgcode
# msgtype
# appcode
# ints
# reals
# chars
# string )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_msgcode,i_msgtype,i_appcode,i_ints(1)
REAL r_reals(1)
STRING s_chars[128],s_op_string[128]
INTEGER i_return_value
# -------------------------------------------------------------------
# Call the message with msg_code=36000001 from the messages.database
# Format the message using the following parameters.
# i_msgcode=36000001
# i_msgtype=4 ( value 4 stands for error message )
# i_appcode=36000000
# i_ints(1)=0
# r_reals(1)=0.0
# s_chars=”new.db”
#
i_msgcode=36000001
i_msgtype=4
i_appcode=36000000
i_ints(1)=10
r_reals(1)=10.0
s_chars=”new.db”
# To see what message is there for msg_code=36000001 call
# msg_to_form() function. It displays the message.Note the
# message and Press O.K to proceed.
msg_to_form @
( i_msgcode, @
i_msgtype, @
i_appcode, @
i_ints, @
r_reals, @
s_chars )
i_return_value = @
msg_to_string @
( i_msgcode, @
i_msgtype, @
i_appcode, @
i_ints, @
r_reals, @
s_chars, @
s_op_string )
dump i_return_value
dump s_op_string
# Compare this output with the message form displayed earlier.
# Also note that the return value shows the number of characters
# left in the string. To get it, call the function msg_string_more().
# Dump the string to see the string.
WHILE ( 0 != i_return_value )
i_return_value = @
msg_string_more @
( s_op_string )
dump i_return_value
dump s_op_string
END WHILE
# -------------------------------------------------------------------
notemessage.text | () |
# Purpose : This file gives an example of a call to the
# function notemessage.text()
#
# In this example, a warning message form has
# been created.
#
# To run this session file, first start
# a session of MSC Patran, run this session file
# by “File”,”Session”,”Play” pulldown menus on
# the menu bar.
#
# The function has the following arguments:
# notemessage.text
# ( label
# message )
#
# -------------------------------------------------------------------
# Variable Declaration
#
STRING s_label[64], s_message[128]
# -------------------------------------------------------------------
# Assign values to the variables.
# s_label = “Warning”
# s_message = “You are closing the current database.” // @
# “Do you really want to?”
#
s_label = “Warning”
s_message = “You are closing the current database.” // @
“ Do you really want to?”
notemessage.text @
( s_label, s_message )
# -------------------------------------------------------------------
ui_add_help | () |
# Purpose : This file provides an example of a call to the
# function ui_add_help()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl. A help file is
# created and added to the help record.
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as:
#
# cpp -I$P3_HOME/customization user_form.pcl user_form.pob
#
# can be used to generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.select_list() has the following
# arguments:
# ui_add_help
# ( keyword,
# path,
# marker )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_form_id
STRING s_keyword[16], s_path[32], s_marker[16]
STRING s_info[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”,”display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the form widget is the first
# element in wa_wid_ids. Assigning this value to w_form_id
#
w_form_id = wa_wid_ids(1)
#---------------------------------------------------------------------
# Create a frame maker file by calling ui_form_to_frame().This will
# create a file “USER_FORM.mif” in the working directory. To execute
# this function, USER_FORM should be displayed.
ui_form_to_frame(“USER_FORM”)
# Register the help for “USER_FORM” widget using “user_form_help” as
# the keyword.
s_keyword = “user_form_help”
ui_register_help( w_form_id,s_keyword )
# Add a record to the help table, providing the connection between
# keyword and the help file.Here the help file “USER_FORM.mif” is
# in the working directory.
s_path = “./USER_FORM.mif”
s_marker = “framemaker_hypertext_marker”
i_return_value = @
ui_add_help @
( s_keyword, @
s_path, @
s_marker )
# Checking the success of function call
dump i_return_value
s_info = “Click on USER FORM and Press F1 to”// @
“ see the help file just created”
ui_write(s_info)
# After seeing the help file, Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
ui_clear_focus | () |
# Purpose : This file provides an example of a call to the
# function ui_clear_focus()
#
# In this file, a medium width half height sized
# form, “USER_FORM”, which contains a databox
# widget is created using user_form.pcl.
#
# The user_form.pcl contains an include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 ui_clear_focus() has the following arguments:
# ui_clear_focus
# ( wid )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET w_wid_ids(VIRTUAL),w_wid
INTEGER i_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# The form “USER_FORM” is displayed.
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Call the function get_widget_ids()to get the widget id of the
# databox widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(w_wid_ids)
# As the function call informs, the databox widget is the fifth
# element in w_wid_ids. Assigning this value to w_wid
#
w_wid = w_wid_ids(5)
# Setting the focus on databox widget:
ui_set_focus(w_wid)
# Session file paused.
# Observe the form displayed. Note that the focus is on databox
# widget and it is active.
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Clear the focus on databox widget by calling the function.
#
ui_clear_focus @
( w_wid )
#---------------------------------------------------------------------
ui_exec_command | () |
# Purpose : This file provides an example of a call to the
# function ui_exec_command()
#
# 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 ui_exec_command() has the following arguments:
# ui_exec_command
# ( cmd )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_cmd[128],s_stat[32]
#---------------------------------------------------------------------
# Run a ui_write() command using ui_exec_command().
#
s_stat=”Welcome to MSC Patran”
s_cmd = “ui_write(s_stat)”
ui_exec_command @
( s_cmd )
#---------------------------------------------------------------------
ui_form_delete | () |
# Purpose : This file provides an example of a call to the
# function ui_form_delete()
#
# First a medium width half height sized form,
# “USER_FORM”, which contains several widgets is
# created using user_form.pcl. Then the form is
# deleted using ui_form_delete().
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 ui_form_delete() has the following arguments:
# ui_form_delete
# ( class )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_class[128]
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Session file paused to observe the form.
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Delete the form by calling ui_form_delete()
#
s_class = “USER_FORM”
ui_form_delete @
( s_class )
#---------------------------------------------------------------------
ui_form_exists | () |
# Purpose : This file provides an example of a call to the
# function ui_form_exists()
#
# First a medium width half height sized form,
# “USER_FORM”, which contains several widgets is
# created using user_form.pcl.Then the function
# ui_form_exists() is called to check whether
# the form exists.
#
# The user_form.pcl contains an include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 ui_form_exists() has the following arguments:
# ui_form_exists
# ( class )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_class[128]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
s_class = “USER_FORM”
#---------------------------------------------------------------------
# Call the function ui_form_exits() with s_class=”USER_FORM” to check
# whether the USER_CLASS exists or not.
#
l_return_value = @
ui_form_exists @
( s_class )
dump l_return_value
IF (l_return_value == TRUE) THEN
ui_write(“ USER_FORM exists.”)
ELSE
ui_write(“ USER_FORM does not exist.”)
END IF
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function( s_class, “display”)
#---------------------------------------------------------------------
# Call the function ui_form_exits() with s_class=”USER_FORM” to check
# whether the USER_CLASS exists or not.
#
l_return_value = @
ui_form_exists @
( s_class )
dump l_return_value
IF (l_return_value == TRUE) THEN
ui_write(“ USER_FORM exists.”)
ELSE
ui_write(“ USER_FORM does not exist.”)
END IF
# Session file paused to see the result of the call.
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Delete the USER_FORM by calling function ui_wid_exit().
ui_wid_exit()
#---------------------------------------------------------------------
# Call the function ui_form_exists() to check whether USER_FORM
# exists now.
l_return_value = @
ui_form_exists @
( s_class )
dump l_return_value
IF (l_return_value == TRUE) THEN
ui_write(“ USER_FORM exists”)
ELSE
ui_write(“ USER_FORM does not exist.”)
END IF
#---------------------------------------------------------------------
ui_form_is_displayed | () |
# Purpose : This file provides an example of a call to the
# function ui_form_is_displayed()
#
# First a medium width half height sized form,
# “USER_FORM”, which contains a text widget is
# created using user_form.pcl. Then the function
# ui_form_is_displayed() is called to check
# whether the form is displayed or not. Finally
# form is hidden and this function is called.
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 ui_form_is_displayed() has the following arguments:
# ui_form_is_displayed
# ( class )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_class[100]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
s_class = “USER_FORM”
# Check to see whether USER_FORM is displayed.
l_return_value = @
ui_form_is_displayed @
( s_class )
dump l_return_value
IF (l_return_value == TRUE) THEN
ui_write(“ Form USER_FORM is displayed.”)
ELSE
ui_write(“ Form USER_FORM is NOT displayed.”)
END IF
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(s_class, “display”)
#---------------------------------------------------------------------
# Call the function to check whether the form is displayed or not.
#
l_return_value = @
ui_form_is_displayed @
( s_class )
dump l_return_value
IF (l_return_value == TRUE) THEN
ui_write(“ Form USER_FORM is displayed.”)
ELSE
ui_write(“ Form USER_FORM is NOT displayed.”)
END IF
# Session file paused to observe the result of the function call.
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Hide the form.
ui_form_hide(s_class)
# Check to see whether USER_FORM is displayed.
l_return_value = @
ui_form_is_displayed @
( s_class )
dump l_return_value
IF (l_return_value == TRUE) THEN
ui_write(“ Form USER_FORM is displayed.”)
ELSE
ui_write(“ Form USER_FORM is NOT displayed.”)
END IF
# Delete the form.
ui_form_delete(s_class)
# Check to see whether USER_FORM is displayed.
l_return_value = @
ui_form_is_displayed @
( s_class )
dump l_return_value
IF (l_return_value == TRUE) THEN
ui_write(“ Form USER_FORM is displayed.”)
ELSE
ui_write(“ Form USER_FORM is NOT displayed.”)
END IF
#---------------------------------------------------------------------
ui_form_is_displayed | () |
# Purpose : This file provides an example of a call to the
# function ui_form_is_displayed()
#
# First a medium width half height sized form,
# “USER_FORM”, which contains a text widget is
# created using user_form.pcl.Then the function
# ui_form_is_displayed() is called to check
# whether the form is displayed or not. Finally
# form is hided and this function is called.
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 ui_form_is_displayed() has the following arguments:
# ui_form_is_displayed
# ( class )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_class[100]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
#---------------------------------------------------------------------
# Call the function to check whether the form is displayed or not.
#
s_class = “user_form”
l_return_value = @
ui_form_is_displayed @
( s_class )
IF (l_return_value == TRUE) THEN
ui_write(“ Form USER_FORM is displayed “)
ELSE
ui_write(“ Form USER_FORM is NOT displayed “)
END IF
# Session file paused to observe the result of the function call.
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Hide the form.
ui_form_hide(s_class)
# Check to see whether USER_FORM is displayed.
l_return_value = @
ui_form_is_displayed @
( s_class )
IF (l_return_value == TRUE) THEN
ui_write(“ Form USER_FORM is displayed “)
ELSE
ui_write(“ Form USER_FORM is NOT displayed “)
END IF
# Delete the form.
ui_form_delete(s_class)
#--------------------------------------------------------------------
ui_get_client | () |
# Purpose : This file provides an example of a call to the
# function ui_get_client()
#
# 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 ui_get_client() has the following arguments:
# ui_get_client
# ( client_info )
#
#--------------------------------------------------------------------
# Variable Declarations
STRING s_client_info[100]
#--------------------------------------------------------------------
# Get the client information by calling the function ui_get_client()
#
ui_get_client @
( s_client_info )
# The X Client is
dump s_client_info
#--------------------------------------------------------------------
ui_get_help | () |
# Purpose : This file provides an example of a call to the
# function ui_get_help()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A help file is
# created and registered for the “USER_FORM”.
# ui_get_help() is called to get the keyword
# registered for the “USER_FORM”. Finally, the
# help file is added to the help record.
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.select_list()has the following
# arguments:
# ui_get_help
# ( wid,
# help )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_wid
STRING s_help[16], s_path[32], s_marker[16]
STRING s_info[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”,”display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the form widget is the first
# element in wa_wid_ids. Assigning this value to w_wid
#
w_wid = wa_wid_ids(1)
#---------------------------------------------------------------------
# Create a frame maker file by calling ui_form_to_frame().This will
# create a file “USER_FORM.mif” in the working directory. To execute
# this function, USER_FORM should be displayed.
ui_form_to_frame(“USER_FORM”)
# Register the help for “USER_FORM” widget using “user_form_help” as
# the keyword.
s_help = “user_form_help”
ui_register_help @
( w_wid, @
s_help )
# Get the help keyword registered for “USER_FORM” by calling
# ui_get_help() function.
s_help = ““
ui_get_help @
( w_wid, @
s_help )
# Dump s_help to see the key word registered.
dump s_help
#---------------------------------------------------------------------
# Add a record to the help table, providing the connection between
# keyword and the help file.Here the help file “USER_FORM.mif” is
# in the working directory.
s_path = “./USER_FORM.mif”
s_marker = “hypertext_marker”
i_return_value = @
ui_add_help @
( s_help, @
s_path, @
s_marker )
# Checking the success of function call
dump i_return_value
s_info = “Click on USER FORM and Press F1 to”// @
“see the help file just created”
ui_write(s_info)
#---------------------------------------------------------------------
ui_get_server | () |
# Purpose : This file provides an example of a call to the
# function ui_get_server()
#
# 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 ui_get_server() has the following arguments:
# ui_get_server
# ( server_info )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_server_info[100]
#---------------------------------------------------------------------
# Get the X server information by calling ui_get_server()
#
ui_get_server @
( s_server_info )
# X Server is:
dump s_server_info
#---------------------------------------------------------------------
ui_graph_create | () |
# Purpose : This file provides an example of a call to the
# function ui_graph_create()
#
# A small width half height sized form,
# “USER_GRAPH”, which contains a GRAPHICS widget
# is created using user_graph.pcl.The functon
# call to ui_graph_create() can be seen in
# user_graph.pcl
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# This file can be run by starting a session of
# MSC Patran, opening a new or existing database,
# and running this session file through the
# “File”,”Session”,”Play” pulldown menus
# on the menu bar.
#
# Note : Since the parameters to this function requires
# precompilation to expand the symbolic values,
# function has NOT been called in this session
# file. Instead, a function call can be found
# in file “user_graph.pcl”
#
# The function ui_graph_create() has the following arguments:
# ui_graph_create
# ( parent,
# name,
# x,
# y,
# width,
# height )
#
#---------------------------------------------------------------------
# Compile and make the functions in user_graph.pob available to
# MSC Patran
!!COMPILE user_graph.pob user_graph.plb
!!LIBRARY ADD user_graph.plb
# Create a form “USER_GRAPH”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_GRAPH”, “display”)
# Press “OK” to delete the USER GRAPH
#---------------------------------------------------------------------
ui_graph_create | () |
# Purpose : This file provides an example of a call to the
# function ui_graph_create()
#
# A small width half height sized form,
# “USER_GRAPH”, which contains a GRAPHICS widget
# is created using user_graph.pcl.The functon
# call to ui_graph_create() can be seen in
# user_graph.pcl
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# This file can be run by starting a session of
# MSC Patran, opening a new or existing database,
# and running this session file through the
# “File”,”Session”,”Play” pulldown menus
# on the menu bar.
#
# Note : Since the parameters to this function requires
# precompilation to expand the symbolic values,
# function has NOT been called in this session
# file. Instead, a function call can be found
# in file “user_graph.pcl”
#
# The function ui_graph_create() has the following arguments:
# ui_graph_create
# ( parent,
# name,
# x,
# y,
# width,
# height )
#
#---------------------------------------------------------------------
# Compile and make the functions in user_graph.pob available to
# MSC Patran
!!COMPILE user_graph.pob user_graph.plb
!!LIBRARY ADD user_graph.plb
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
ga_viewport_size_set( “default_viewport”, 3.5, 3.5, 1 )
ga_viewport_location_set( “default_viewport”, 0.0, 5.0, 1 )
# Create a form “USER_GRAPH”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_GRAPH”, “display”)
# Press “OK” to delete the USER GRAPH
#---------------------------------------------------------------------
ui_is_initialized | () |
# Purpose : This file provides an example of a call to the
# function ui_is_initialized()
#
# 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 ui_is_initialized() has no arguments.
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL l_is_initialised
#---------------------------------------------------------------------
# Check to see user interface has been initialised or not.
#
l_is_initialised = ui_is_initialized()
dump l_is_initialised
#---------------------------------------------------------------------
ui_register_help | () |
# Purpose : This file provides an example of a call to the
# function ui_register_help()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A help file is
# created and registered for the USER_FORM
# This help file is added to the help record.
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.select_list()has the following
# arguments:
# ui_register_help
# ( wid,
# help )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_wid
STRING s_help[16], s_path[32], s_marker[16]
STRING s_info[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”,”display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the form widget is the first
# element in wa_wid_ids. Assigning this value to w_wid
#
w_wid = wa_wid_ids(1)
#---------------------------------------------------------------------
# Create a frame maker file by calling ui_form_to_frame().This will
# create a file “USER_FORM.mif” in the working directory. To execute
# this function, USER_FORM should be displayed.
ui_form_to_frame(“USER_FORM”)
# Register the help for “USER_FORM” widget using “user_form_help” as
# the keyword.
s_help = “user_form_help”
ui_register_help @
( w_wid, @
s_help )
#---------------------------------------------------------------------
# Add a record to the help table, providing the connection between
# keyword and the help file.Here the help file “USER_FORM.mif” is
# in the working directory.
s_path = “./USER_FORM.mif”
s_marker = “hypertext_marker”
i_return_value = @
ui_add_help @
( s_help, @
s_path, @
s_marker )
# Checking the success of function call
dump i_return_value
s_info = “Click on USER FORM and Press F1 to” // @
“ see the help file just created”
ui_write(s_info)
#---------------------------------------------------------------------
ui_sys_command | () |
# Purpose : This file provides an example of a call to the
# function ui_sys_command()
#
# The file calls the function to execute the
# system command “ls”. This will list all the
# files/directories present in current directory
# on the standard output.
#
# 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 ui_sys_command() has the following arguments:
# ui_sys_command
# ( cmd )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_cmd[128]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Run the system command “ls” inside MSC Patran
#
s_cmd = “ls”
xf_write_stdout(“Executing ls command from MSC Patran “)
xf_write_stdout(“-----------------------------------------------”)
l_return_value = @
ui_sys_command @
( s_cmd )
xf_write_stdout(“-----------------------------------------------”)
# Checking the success of function:( “False” means Successful. )
dump l_return_value
# Output of the system command is seen in the Standard Output.
#--------------------------------------------------------------------
ui_sys_return | () |
# Purpose : This file provides an example of a call to the
# function ui_sys_return()
#
# 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 ui_sys_return() has no arguments.
#---------------------------------------------------------------------
# Upon calling,the function return to operating system command prompt
#
ui_sys_return()
#---------------------------------------------------------------------
ui_text_select | () |
# Purpose : This file provides an example of a call to the
# function ui_text_select()
#
# First a medium width half height sized form,
# “USER_FORM”, which contains a text widget is
# created using user_form.pob. User is requested
# to cursor select the text in the text widget.
# Then the function ui_text_select()is called to
# output the selected text and its position in
# the history window.
#
# The user_form.pob contains an include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 ui_text_select() has the following arguments:
# ui_text_select
# ( textwid,
# left,
# right,
# vstr )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET w_wid_ids(VIRTUAL), w_textwid
INTEGER i_left
INTEGER i_right
STRING s_vstr[128]
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
#---------------------------------------------------------------------
# The form “USER_FORM” is displayed.Cursor select the text in the
# text widget. Press “Resume” to continue the session file.
sf_pause()
# Call the function get_widget_ids()to get the widget id of the text
# widget. This function is in user_form.pob
#
USER_FORM.get_widget_ids(w_wid_ids)
# As the function call informs, the text widget is the second element
# in w_wid_ids. Assigning this value to w_textwid
#
w_textwid = w_wid_ids(2)
#---------------------------------------------------------------------
# Call the function to return the text selected and its left and
# right position in the string in which it resides.
#
ui_text_select @
( w_textwid, @
i_left, @
i_right, @
s_vstr )
# The selected text is:
dump s_vstr
# The position of the selected text in the string from left is:
dump i_left
# The position of the selected text in the string from right is:
dump i_right
sys_free_array(w_wid_ids)
# Press “OK” to delete the form “USER_FORM”.
#---------------------------------------------------------------------
ui_text_select | () |
# Purpose : This file provides an example of a call to the
# function ui_text_select()
#
# First a medium width half height sized form,
# “USER_FORM”, which contains a text widget is
# created using user_form.pob. User is requested
# to cursor select the text in the text widget.
# Then the function ui_text_select()is called to
# output the selected text and its position in
# the history window.
#
# The user_form.pob contains an include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I $P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 ui_text_select() has the following arguments:
# ui_text_select
# ( textwid,
# left,
# right,
# vstr )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET w_wid_ids(VIRTUAL), w_textwid
INTEGER i_left
INTEGER i_right
STRING s_vstr[VIRTUAL]
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
#---------------------------------------------------------------------
# The form “USER_FORM” is displayed.Cursor select the text in the
# text widget. Press “Resume” to continue the session file.
sf_pause()
# Call the function get_widget_ids()to get the widget id of the text
# widget. This function is in user_form.pob
#
USER_FORM.get_widget_ids(w_wid_ids)
# As the function call informs, the text widget is the second element
# in w_wid_ids. Assigning this value to w_textwid
#
w_textwid = w_wid_ids(2)
# Allocate storage for the string used as a return value for
# the ui_text_select function.
ui_wid_get_vstring(w_textwid, “VALUE”, s_vstr)
dump str_length(s_vstr)
#---------------------------------------------------------------------
# Call the function to return the text selected and its left and
# right position in the string in which it resides.
#
ui_text_select @
( w_textwid, @
i_left, @
i_right, @
s_vstr )
# The selected text is:
dump s_vstr
# The position of the selected text in the string from left is:
dump i_left
# The position of the selected text in the string from right is:
dump i_right
sys_free_array(w_wid_ids)
sys_free_string(s_vstr)
# Execute the function user_form.exit() to delete the form.
#
#--------------------------------------------------------------------
ui_wid_exit | () |
# Purpose : This file provides an example of a call to the
# function ui_wid_exit()
#
# First a medium width half height sized form,
# “USER_FORM”, which contains several widgets is
# created using user_form.pcl.Then the function
# ui_wid_exit()is called to exit the USER_FORM
#
# The user_form.pcl contains an include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate the file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 ui_wid_exit() has no arguments:
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
#---------------------------------------------------------------------
# Session file paused. Observe the form and press “Resume” to
# continue.
sf_pause()
# ui_wid_exit() function is called to execute the exit function in all
# of the displayed windows. USER_FORM displayed has an exit() function
# in its class USER_FORM. This function in turn calls a function
# ui_form_delete() to exit the USER_FORM.
ui_wid_exit()
#---------------------------------------------------------------------
ui_wid_hide_forms | () |
# Purpose : This file provides an example of a call to the
# function ui_wid_hide_forms()
#
# First a medium width half height sized form,
# “USER_FORM”, which contains sseveral widgets is
# created using user_form.pcl.Then the function
# ui_wid_hide_forms() is called to hide the non
# modal form.Finally ui_form_display() is called
# to display the form “USER_FORM”
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 ui_wid_hide_forms() has the following arguments:
# ui_wid_hide_forms
# ( parm )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_parm[128]
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Session file paused to notice the form. Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Calling the function with s_parm=”NONMODAL” to hide all non modal
# forms. Note that form “USER_FORM” is an non modal form.
#
s_parm = “NONMODAL”
ui_wid_hide_forms @
( s_parm )
# Session file paused to observe that the form “USER_FORM” is hided,
# but not deleted. Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# To display “USER_FORM” again, call the function ui_form_display().
ui_form_display(“USER_FORM”)
#---------------------------------------------------------------------
ui_wid_restore_widget | () |
# Purpose : This file provides an example of a call to the
# function ui_wid_restore_widget()
#
# First a medium width half height sized form,
# “USER_FORM”, which contains several widget is
# created using user_form.pcl.Initial value is
# set in Text widget and List box widget.The
# values are saved and changed afterwards.
# Original values are restored by calling
# ui_wid_restore_widget().
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 ui_wid_save_widget() has the following arguments:
# ui_wid_restore_widget
# ( wid )
#
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_wid,w_lbox_id,w_text_id
LOGICAL l_return_value
STRING sa_list[16](2) = [“First”,”Second”]
INTEGER i_listcnt
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# The form “USER_FORM” is displayed. Call the function
# get_widget_ids()to get the widget id of all the widgets. This
# function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the form widget is the first element
# in wa_wid_ids. Similarly, list box widget is the forth element in
# wa_wid_ids.Assigning these values
#
w_wid = wa_wid_ids(1)
w_text_id = wa_wid_ids(2)
w_lbox_id = wa_wid_ids(4)
# Create a list of items in the list box.
i_listcnt = 2
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_list, @
i_listcnt )
# Save the values of USER_FORM and its child widget by calling
# function ui_wid_save_widget() with w_wid as the argument.
l_return_value = @
ui_wid_save_widget @
( w_wid )
dump l_return_value
# Session file paused to observe the widgets and their values.
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Change the values of the widgets.
# New text is set in text widget. List box items deleted.
ui_wid_set @
( w_text_id, @
“VALUE”, @
“Changed Text” )
uil_utils_listbox.delete_item_list @
( w_lbox_id, @
i_listcnt, @
sa_list)
# Session file paused to observe the widgets and their values.
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Restore the original values of USER_FORM
l_return_value = @
ui_wid_restore_widget @
( w_wid )
dump l_return_value
# Observe the Widgets and their values.
# Press “OK” to delete the form “USER_FORM”
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
ui_wid_save_widget | () |
# Purpose : This file provides an example of a call to the
# function ui_wid_save_widget()
#
# A medium width half height sized form,
# “USER_FORM”, which contains several widgets is
# created using user_form.pcl.Initial value is
# set in Text widget and List box widget. This
# value is saved using ui_wid_save(). Values are
# changed. Finally, values are restored.
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 ui_wid_save_widget() has the following arguments:
# ui_wid_save_widget
# ( wid )
#
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_wid,w_lbox_id,w_text_id
LOGICAL l_return_value
STRING sa_list[16](2) = [“First”,”Second”]
INTEGER i_listcnt
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# The form “USER_FORM” is displayed. Call the function
# get_widget_ids()to get the widget id of all the widgets. This
# function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the form widget is the first element
# in wa_wid_ids. Similarly, list box widget is the forth element in
# wa_wid_ids.Assigning these values
#
w_wid = wa_wid_ids(1)
w_text_id = wa_wid_ids(2)
w_lbox_id = wa_wid_ids(4)
# Create a list of items in the list box.
i_listcnt = 2
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_list, @
i_listcnt )
# Save the values of USER_FORM and its child widget by calling
# function ui_wid_save_widget() with w_wid as the argument.
l_return_value = @
ui_wid_save_widget @
( w_wid )
dump l_return_value
# Session file paused to observe the widgets and their values.
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Change the values of the widgets.
# New text is set in text widget. List box items deleted.
ui_wid_set @
( w_text_id, @
“VALUE”, @
“Changed Text” )
uil_utils_listbox.delete_item_list @
( w_lbox_id, @
i_listcnt, @
sa_list)
# Session file paused to observe the widgets and their values.
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Restore the original values of USER_FORM
l_return_value = @
ui_wid_restore_widget @
( w_wid )
dump l_return_value
# Observe the Widgets and their values.
# Press “OK” to delete the form “USER_FORM”
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uid_get_border_sizes | () |
# Purpose : This file gives an example of a call to the
# function uid_get_border_sizes()
#
# This function gives the size of the borders
# in all the four directions for a specific
# type of window.
#
# To run this session file,first start a session
# of MSC Patran, then run this session file by
# “File”,”Session”,”Play” pulldown menus on the
# menu bar.
#
# The function has the following arguments:
# uid_get_border_sizes
# ( type,
# pos_is_frame,
# leftoffset,
# topoffset,
# rightoffset,
# bottomoffset )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_type
LOGICAL l_pos_is_frame
INTEGER i_leftoffset,i_topoffset
INTEGER i_rightoffset,i_bottomoffset
# -------------------------------------------------------------------
# Call the function to get the information of dialog window.
i_type = 0 /* For dialog window */
uid_get_border_sizes @
( i_type, @
l_pos_is_frame, @
i_leftoffset, @
i_topoffset, @
i_rightoffset, @
i_bottomoffset )
# Setting of PositionIsFrame
dump l_pos_is_frame
# Thickness of left border in Pixels
dump i_leftoffset
# Thickness of right border in Pixels
dump i_rightoffset
# Thickness of top border in Pixels
dump i_topoffset
# Thickness of bottom border in Pixels
dump i_bottomoffset
# ------------------------------------------------------------------
uid_get_font_heights | () |
# Purpose : This file gives an example of a call to the
# function uid_get_font_heights()
#
# This function gives the size of the fonts in
# pixels.
#
# To run this session file,first start a session
# of MSC Patran, then run this session file by
# “File”,”Session”,”Play” pulldown menus on the
# menu bar.
#
# The function has the following arguments:
# uid_get_font_heights
# ( font_h,
# textfont_ht,
# spreadfont_h )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_font_h
INTEGER i_textfont_h
INTEGER i_spreadfont_h
# -------------------------------------------------------------------
# Call the function to get the information of font heights
uid_get_font_heights @
( i_font_h, @
i_textfont_h, @
i_spreadfont_h )
# Font height in pixels
dump i_font_h
# Text font height in pixels
dump i_textfont_h
# Spread sheet font height in pixels
dump i_spreadfont_h
# -------------------------------------------------------------------
uid_get_screen_info | () |
# Purpose : This file gives an example of a call to the
# function uid_get_screen_info()
#
# This function gives the screen size in pixels
# and pixels per inch.
#
# To run this session file,first start
# a session of MSC Patran,open a database or
# start a new database,then run this session
# file by “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function has the following arguments:
# uid_get_screen_info
# ( xpix,
# ypix,
# xpixperinch,
# ypixperinch )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_xpix,i_ypix
INTEGER i_xpixperinch,i_ypixperinch
INTEGER i_value
# -------------------------------------------------------------------
# Call the function to get the screen information.
uid_get_screen_info @
( i_xpix, @
i_ypix, @
i_xpixperinch, @
i_ypixperinch, @
i_value )
# Setting of screen size is
dump i_xpix
dump i_ypix
dump i_xpixperinch
dump i_ypixperinch
dump i_value
# -------------------------------------------------------------------
uid_set_sys_pix | () |
# Purpose : This file provides an example of a call to the
# function uid_set_sys_pix()
#
# This function sets the pixel per inch and
# display factor for the monitor.
#
# 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 uid_set_sys_pix()
# has the following arguments:
#
# uid_set_sys_pix
# ( pix_per_inch,
# new_disp_factor )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL r_pix_per_inch
REAL r_new_disp_factor
#---------------------------------------------------------------------
# Set the monitor pixels per inch and display factor
#
r_pix_per_inch=81.0
r_new_disp_factor=1.0
uid_set_sys_pix @
( r_pix_per_inch, @
r_new_disp_factor )
#---------------------------------------------------------------------
INTEGER i_xpix,i_ypix
INTEGER i_xpixperinch,i_ypixperinch
INTEGER i_value
# -------------------------------------------------------------------
# Call the function to get the screen information.
uid_get_screen_info @
( i_xpix, @
i_ypix, @
i_xpixperinch, @
i_ypixperinch, @
i_value )
# Setting of screen size is
dump i_xpix
dump i_ypix
dump i_xpixperinch
dump i_ypixperinch
dump i_value
uil_app_analysis.get_real_name |
# Purpose : This file provides an example of a call to the
# function uil_app_analysis.get_real_name().
#
# This file opens a database spool.db which has
# an analysis code name of “MSC.Nastran” and an
# analysis type of “mscnastran”.
#
# This function gets the real name of analysis
# preference.
#
# This file can be run by starting a session of
# MSC Patran, opening a new or existing database,
# and running this session file through the
# “File”,”Session”,”Play” pulldown menus
# on the menu bar.
#
#
# The function uil_app_analysis.get_real_name()
# has the following arguments:
#
# uil_app_analysis.get_real_name
# ( user_name,
# real_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_user_name[100]
STRING s_real_name[100]
INTEGER i_return_value
#---------------------------------------------------------------------
#
# opening the existing database spool.db
uil_file_open.go(“spool.db”)
# Get the user name of current analysis code by calling
# db_get_default_anal_code().
#
db_get_default_anal_code( s_user_name )
# The current analysis code name is
dump s_user_name
# Call the function to get real name of the Analysis preference.
i_return_value = @
uil_app_analysis.get_real_name @
( s_user_name, @
s_real_name )
# Real name of the analysis type is
dump s_real_name
# Number of characters in s_real_name is
dump i_return_value
#---------------------------------------------------------------------
uil_pcntcomplete.close |
# Purpose : This function create the percentage complete
# ruler in the patran environment.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file with
# the "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function uil_pcntcomplete.close()
# has no arguments.
#
#---------------------------------------------------------------------
# Variable Initialization
#---------------------------------------------------------------------
STRING label[15] = "My_scale"
#---------------------------------------------------------------------
# Initializing the scale.
uil_pcntcomplete.initlz(label)
uil_pcntcomplete.update(40.0)
#---------------------------------------------------------------------
# Using the function uil_pcntcomplete.close() to close the scale.
uil_pcntcomplete.close()
#----------------------------------------------------------------------
# End of file
uil_pcntcomplete.initlz |
# Purpose : This function create the percentage complete
# ruler in the patran environment.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file with
# the "File","Session","Play" pulldown menus
# on the menu bar.
#
# The function uil_pcntcomplete.initlz()
# has the following arguments:
#
# uil_pcntcomplete.initlz
# (
# label )
#
#---------------------------------------------------------------------
# Variable Initialization
#---------------------------------------------------------------------
STRING label[15] = "My_scale"
#---------------------------------------------------------------------
# Using the function uil_pcntcomplete.initlz() to start the ruler
# scale.
uil_pcntcomplete.initlz(label)
uil_pcntcomplete.update(40.0)
#---------------------------------------------------------------------
# Closes the scale to be used for the label 'My_scale'.
# uil_pcntcomplete.close()
#----------------------------------------------------------------------
# End of file
uil_primary.get_menubar_id | () |
# Purpose : This file provides an example of a call to the
# function uil_primary.get_menubar_id()
#
# This function returns the widget id of the
# main menu bar.
#
# 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 uil_primary.get_menubar_id() has no arguments.
#
#---------------------------------------------------------------------
# Variable Declarations
WIDGET w_return_value
#---------------------------------------------------------------------
# Get the widget id of the main menu bar.
#
w_return_value = @
uil_primary.get_menubar_id()
dump w_return_value
#---------------------------------------------------------------------
uil_utils_listbox.append_list | () |
# Purpose : This file provides an example of a call to the
# function uil_utils_listbox.append_list()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A list is
# created using uil_utils_listbox.create_list()
# Then the list is appended by calling the
# function uil_utils_listbox.append_list().
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.append_list() has the following
# arguments:
# uil_utils_listbox.append_list
# ( lbox_id,
# labellist,
# listcnt )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL), w_lbox_id
STRING sa_labellist_c[8](2) = [“List 1”, “List 2”]
STRING sa_labellist[8](1) = [“List 3”]
INTEGER i_listcnt
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 2
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist_c, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Append the list by calling uil_utils_listbox.append_list().
#
i_listcnt = 1
uil_utils_listbox.append_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
sys_free_array(wa_wid_ids)
# Press “OK” to delete the USER_FORM
#---------------------------------------------------------------------
uil_utils_listbox.create_list | () |
# Purpose : This file provides an example of a call to the
# function uil_utils_listbox.create_list()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A list is
# created using uil_utils_listbox.create_list()
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.create_list()
# has the following arguments:
#
# uil_utils_listbox.create_list
# ( lbox_id,
# labellist,
# listcnt )
#
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL), w_lbox_id
STRING sa_labellist[16](2)= [“List 1”,”List 2”]
INTEGER i_listcnt
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 2
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.delete_item | () |
# Purpose : This file provides an example of a call to the
# function uil_utils_listbox.delete_item()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A list is
# created using uil_utils_listbox.create_list()
# One of the list is deleted using the function
# uil_utils_listbox.delete_item()
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.delete_item()has the following
# arguments:
# uil_utils_listbox.delete_item
# ( lbox_id,
# name )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt
STRING sa_labellist[8](3)=[“List 1”,”List 2”,”List 3”]
STRING s_name[16]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Delete the item “List 3” from the List items in list box widget.
#
s_name = “List 3”
l_return_value = @
uil_utils_listbox.delete_item @
( w_lbox_id, @
s_name )
# Checking the success of the function call
dump l_return_value
# Observe the List box Widget to note that “List 3” is deleted.
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.delete_item_list | () |
# Purpose : This file provides an example of a call to the
# function uil_utils_listbox.delete_item_list()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A list is
# created using uil_utils_listbox.create_list()
# A portion of List items are deleted by calling
# the function uil_utils_listbox.delete_item_
# list().
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.delete_item_list()has the following
# arguments:
# uil_utils_listbox.delete_item_list
# ( lbox_id,
# nitems
# itemlist )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt, i_nitems
STRING sa_labellist[8](3) = [“List 1”,”List 2”,”List 3”]
STRING sa_itemlist[8](2) = [“List 1”, “List 3”]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Delete the items “List 1” and “List 3” from the list items in
# list box widget.
i_nitems = 2
l_return_value = @
uil_utils_listbox.delete_item_list @
( w_lbox_id, @
i_nitems , @
sa_itemlist)
dump l_return_value
# Observe the item deleted and remaining in the List Box widget.
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.delete_selected | () |
# Purpose : This file provides an example of a call to the
# function uil_utils_listbox.delete_selected()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A list is
# created using uil_utils_listbox.create_list()
# A portion of List items are selected by calling
# the function uil_utils_listbox.select_list()
# Function uil_utils_listbox.delete_selected() is
# called to delete the selected items.
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.delete_selected()has the following
# arguments:
# uil_utils_listbox.delete_selected
# ( lbox_id )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt
STRING sa_labellist_c[8](3) = [“List 1”,”List 2”,”List 3”]
STRING sa_labellist[8](2) = [“List 2”, “List 3”]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist_c, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Select “List 2” and “List 3” from the List items in list box
# widget.
i_listcnt = 2
l_return_value = @
uil_utils_listbox.select_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
dump l_return_value
# Session file stopped to observe the selected items in the List Box
# Widget.Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Get the selected items in the list box.
uil_utils_listbox.delete_selected @
( w_lbox_id )
# Observe that “List 2” and “List 3” are deleted.
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.get_all | () |
# Purpose : This file provides an example of a call to the
# function uil_utils_listbox.get_all()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A list is
# created using uil_utils_listbox.create_list()
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.get_all()has the following arguments
# uil_utils_listbox.get_all
# ( lbox_id,
# items,
# num )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt, i_num
STRING sa_labellist_c[8](3) = [“List 1”,”List 2”,”List 3”]
STRING svv_items[VIRTUAL](VIRTUAL)
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist_c, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Get all the items in the listbox by calling uil_utils_listbox_get_
# all().
sys_allocate_string(svv_items, 16)
sys_allocate_array(svv_items,1,3)
uil_utils_listbox.get_all @
( w_lbox_id, @
svv_items, @
i_num )
# The number of items in the Listbox Widget
dump i_num
# The items are
dump svv_items
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
sys_free_array(svv_items)
#---------------------------------------------------------------------
uil_utils_listbox.get_selected | () |
# Purpose : This file provides an example of a call to the
# function uil_utils_listbox.get_selected()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A list is
# created using uil_utils_listbox.create_list()
# A portion of List items are selected by calling
# the function uil_utils_listbox.select_list()
# Function uil_utils_listbox.get_selected() is
# called to output the selected items.
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.get_selected()has the following
# arguments:
# uil_utils_listbox.get_selected
# ( lbox_id,
# items,
# num )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt, i_num
STRING sa_labellist_c[8](3) = [“List 1”,”List 2”,”List 3”]
STRING sa_labellist[8](2) = [“List 2”, “List 3”]
STRING sav_items[16](VIRTUAL)
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist_c, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Select “List 2” and “List 3” from the List items in list box
# widget.
i_listcnt = 2
l_return_value = @
uil_utils_listbox.select_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
dump l_return_value
# Session file stopped to observe the selected items in the List Box
# Widget.Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Get the selected items in the list box.
uil_utils_listbox.get_selected @
( w_lbox_id, @
sav_items, @
i_num )
# Number of selected items are
dump i_num
# Selected items are
dump sav_items
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.get_unselected | () |
# Purpose : This file provides an example of a call to the
# function uil_utils_listbox.get_unselected()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A list is
# created using uil_utils_listbox.create_list()
# A portion of List items are selected by calling
# the function uil_utils_listbox.select_list()
# Function uil_utils_listbox.get_unselected() is
# called to output the unselected items.
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.get_unselected()has the following
# arguments:
# uil_utils_listbox.get_unselected
# ( lbox_id,
# item,
# num )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt, i_num
STRING sa_labellist_c[8](3) = [“List 1”,”List 2”,”List 3”]
STRING sa_labellist[8](2) = [“List 2”, “List 3”]
STRING sav_items[16](VIRTUAL)
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist_c, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Select “List 2” and “List 3” from the List items in list box
# widget.
i_listcnt = 2
l_return_value = @
uil_utils_listbox.select_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
dump l_return_value
# Session file stopped to observe the selected and unselected items
# in the List Box Widget.Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Get the unselected items in the list box.
uil_utils_listbox.get_unselected @
( w_lbox_id, @
sav_items, @
i_num )
# Number of unselected items are
dump i_num
# Unselected items are
dump sav_items
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.select | () |
# Purpose : This file provides an example of a call to the
# function uil_utils_listbox.select()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A list is
# created using uil_utils_listbox.create_list()
# One of the list is selected using the function
# uil_utils_listbox.select()
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.select()has the following arguments:
# uil_utils_listbox.select
# ( lbox_id,
# label )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt
STRING sa_labellist[8](3)=[“List 1”,”List 2”,”List 3”]
STRING s_label[16]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Select (Highlight) “List 3” from the List items in list box widget.
#
s_label = “List 3”
l_return_value = @
uil_utils_listbox.select @
( w_lbox_id, @
s_label )
dump l_return_value
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.select_all | () |
# Purpose : This file provides an example of a call to the
# function uil_utils_listbox.select_all()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A list is
# created using uil_utils_listbox.create_list()
# Full List items are selected by calling the
# function uil_utils_listbox.select_all()
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.select_all()has the following
# arguments:
# uil_utils_listbox.select_all
# ( lbox_id )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt
STRING sa_labellist[8](3) = [“List 1”,”List 2”,”List 3”]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Select (Highlight) all the items in the List box in the List box
# widget.
uil_utils_listbox.select_all @
( w_lbox_id )
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.select_list | () |
# Purpose : This file provides an example of a call to the
# function uil_utils_listbox.select_list()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A list is
# created using uil_utils_listbox.create_list()
# A portion of List items are selected by calling
# the function uil_utils_listbox.select_list()
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.select_list()has the following
# arguments:
# uil_utils_listbox.select_list
# ( lbox_id,
# label
# listcnt )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt
STRING sa_labellist_c[8](3) = [“List 1”,”List 2”,”List 3”]
STRING sa_labellist[8](2) = [“List 2”, “List 3”]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist_c, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Select (Highlight) “List 2” and “List 3” from the List items in
# list box widget.
i_listcnt = 2
l_return_value = @
uil_utils_listbox.select_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
dump l_return_value
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.select_none | () |
# Purpose : This file provides an example of a call to the
# function uil_utils_listbox.select_list()
#
# A medium width half height sized form,
# “USER_FORM”, which contains a List box widget
# is created using user_form.pcl.A list is
# created using uil_utils_listbox.create_list()
# A portion of List items are selected by calling
# the function uil_utils_listbox.select_list()
# Selection is cleared by calling the function
# uil_utils_listbox.select_none()
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# 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 uil_utils_listbox.select_none()has the following
# arguments:
# uil_utils_listbox.select_none
# ( lbox_id )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt
STRING sa_labellist[8](3) = [“List 1”,”List 2”,”List 3”]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
# Create a form “USER_FORM”, by executing the “display” function
# using ui_exec_function()
ui_exec_function(“USER_FORM”, “display”)
# Call the function get_widget_ids()to get the widget id of the list
# box widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(wa_wid_ids)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Select (Highlight) all the items from the List items in list box
# widget.
l_return_value = @
uil_utils_listbox.select_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
dump l_return_value
# Session file paused to observe the selected items in list box
# widget. Press “Resume to continue”
sf_pause()
#---------------------------------------------------------------------
# Clear all selected (Highlighted) items in the list box.
l_return_value = @
uil_utils_listbox.select_none @
( w_lbox_id )
# Check the success of function call
dump l_return_value
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
user_message | () |
# Purpose : This file gives an example of a call to the
# function user_message()
#
# The call to the function uses standard MSC Patran
# messages from the file “messages.database”
#
# To run this session file, Start a session of
# MSC Patran, run the session file by “File”,
# “Session”,”Play”pulldown menus on the menu bar.
#
# The function has the following arguments:
# user_message
# ( type
# appcode
# appname
# message )
#
# -------------------------------------------------------------------
# Variable Declaration
#
STRING s_type[16], s_appname[64], s_message[128]
INTEGER i_appcode
INTEGER i_return_value
# -------------------------------------------------------------------
# Call the user_message() with following parameters :
# s_type = “C_YN_Y”
# i_appcode=1000000101
# s_appname=”FILE”
# s_message = “Database does not exist. Do you wish to “ // @
# “ create a new database? “
#
s_type = “C_YN_Y”
i_appcode = 1000000101
s_appname = “FILE”
s_message = “Database does not exist. Do you wish to “ // @
“ create a new database? “
i_return_value = @
user_message @
( s_type, @
i_appcode, @
s_appname, @
s_message )
dump i_return_value
# Note that the i_return_value depends upon your answer YES/NO to the
# question in the form displayed.This can be used further in any
# application.( A sample is given below )
IF ( 1== i_return_value ) THEN
ui_write(“ You have selected YES in the form “)
ELSE
ui_write(“ You have selected NO in the form “)
END IF
# -------------------------------------------------------------------
10000000000 Example Customization
10000000001 There are %I% elements with %F% average length in database %A%