file_is_directory | () |
# Purpose : This file provides two example calls to the
# function file_is_directory()
#
# This function is used to check whether a
# given path is valid directory.
#
# The function file_is_directory()
# has the following arguments:
#
# file_is_directory
# (dirname )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_dirname[128]
INTEGER i_return_value
#---------------------------------------------------------------------
#
# Checks if “/usr/bin” is a valid directory name
s_dirname = “/usr/bin”
i_return_value = @
file_is_directory @
( s_dirname )
dump i_return_value
# Paused. Press resume to continue...
sf_pause()
# date is an executable commonly found in /usr/bin
# Checks if “/usr/bin/date” is a valid directory name
s_dirname = “/usr/bin/date”
i_return_value = @
file_is_directory @
( s_dirname )
dump i_return_value
#---------------------------------------------------------------------
get_current_dir | () |
# Purpose : This file provides an example of a call to the
# function get_current_dir()
#
# This function is used to get the current
# directory.
#
#
# The function get_current_dir()
# has the following arguments:
#
# get_current_dir
# (dirname )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_dirname[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the current directory
i_return_value = @
get_current_dir @
( s_dirname )
dump i_return_value
dump s_dirname
#---------------------------------------------------------------------
jou_file_write | () |
# Purpose : This file provides an example of a call to the
# function jou_file_write()
#
# To write a string to ONLY to the journal file
# (not to the session file).
#
# 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 jou_file_write()
# has the following arguments:
#
# jou_file_write
# ( astring )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_astring[128]
#---------------------------------------------------------------------
# Write a string to the journal file.
s_astring = “# This line WILL be written to the journal file.”
jou_file_write @
(s_astring )
#---------------------------------------------------------------------
neutral_export2 | () |
# Purpose : This file provides an example of a call to the
# function neutral_export2()
#
# This function is used to export data to a
# MSC Patran 2.5 neutral file, applying the specified
# entity and group filters first.
#
# Before running this session file run spool.ses
# to create spool.db
#
# 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 neutral_export2()
# has the following arguments:
#
# neutral_export2
# ( fname,
# title,
# entflag,
# grpall,
# ngroups,
# grids )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_fname[128]
STRING s_title[128]
LOGICAL la_entflag(35)=[TRUE , TRUE , TRUE , @
TRUE , TRUE , TRUE , TRUE , TRUE , FALSE, @
TRUE , TRUE , FALSE, FALSE, TRUE , TRUE , @
TRUE , TRUE , FALSE, TRUE , TRUE , TRUE , @
TRUE , TRUE , TRUE , FALSE, FALSE, FALSE, @
FALSE, FALSE, FALSE, FALSE, TRUE , TRUE , @
FALSE, FALSE ]
LOGICAL l_grpall
INTEGER i_ngroups
INTEGER ia_grids(2)=[1,2]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Assign values to variables
# s_fname = “spool.neutral” : Neutral file to write
# s_title = “MSC Patran 2.5 Neutral File” : Title
# l_grpall = TRUE : Export all groups
# i_ngroups = 2 : Number of groups
s_fname = “spool.neutral”
s_title = “MSC Patran 2.5 Neutral File “
l_grpall = TRUE
i_ngroups = 2
# -------------------------------------------------------------------
# Now export MSC Patran data to a MSC Patran 2.5 neutral file.
#
i_return_value = @
neutral_export2 @
(s_fname, @
s_title, @
la_entflag, @
l_grpall, @
i_ngroups, @
ia_grids )
dump i_return_value
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
nf_write | () |
# Purpose : This file provides two examples of calls to
# the function nf_write()
#
# This function writes a MSC Patran 2.5 format
# neutral file from the open database. Uses
# PFEA translator as a base, adds new Phase I
# If PFEA is TRUE writes only a PFEA neutral
# file.
#
# Before running this session file run spool.ses
# to create spool.db
#
# 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 nf_write()
# has the following arguments:
#
# nf_write
# ( fname,
# title,
# pfea )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_fname[128]
STRING s_title[128]
LOGICAL l_pfea
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Export to a MSC Patran 2.5 neutral file
# s_fname = “spool.nopfea.neutral” : File name to export to
# s_title = “MSC Patran 2.5 Neutral file” : Title
# l_pfea = FALSE : Export all
s_fname = “spool.neutral”
s_title = “MSC Patran 2.5 Neutral file”
l_pfea = FALSE
i_return_value = @
nf_write @
(s_fname, @
s_title, @
l_pfea )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Export to a MSC Patran 2.5 neutral file (only PFEA)
# s_fname = “spool.pfea.neutral” : File name to export to
# s_title = “MSC Patran 2.5 (PFEA) Neutral file” : Title
# l_pfea = FALSE : Export only PFEA
s_fname = “spool.pfea.neutral”
s_title = “MSC Patran 2.5 (PFEA) Neutral file”
l_pfea = TRUE
i_return_value = @
nf_write @
( s_fname, @
s_title, @
l_pfea )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
nf_write2 | () |
# Purpose : This file provides an example of a call to the
# function nf_write2()
#
# This function is used to write MSC Patran 2.5
# format neutral file from the open MSC Patran database.
# Uses PFEA translator as a base, adds new
# Phase I. If pfea is TRUE exports only a
# PFEA neutral file.
#
# Before running this session file run spool.ses
# to create spool.db
#
# 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 nf_write2()
# has the following arguments:
#
# nf_write2
# (pname,
# title,
# pfea,
# entflag,
# grp_all,
# ngroups,
# grids )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_pname[128]
STRING s_title[128]
LOGICAL l_pfea
LOGICAL la_entflag(35)=[TRUE , TRUE , TRUE , @
TRUE , TRUE , TRUE , TRUE , FALSE, FALSE, @
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @
FALSE, FALSE ]
LOGICAL l_grp_all
INTEGER i_ngroups = 2
INTEGER ia_grids(2)=[1,2]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# s_pname = “spool.pfea.neutral2” : File name to export to
# s_title = “MSC Patran 2.5 Neutral File” : Title
# l_pfea = TRUE : only PFEA neutral file
# l_grp_all = TRUE : All groups
s_pname = “spool.pfea.neutral2”
s_title = “PFEA Neutral File”
l_pfea = TRUE
l_grp_all = TRUE
i_return_value = @
nf_write2 @
(s_pname, @
s_title, @
l_pfea, @
la_entflag, @
l_grp_all, @
i_ngroups, @
ia_grids )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
p3_ps_get_xmt | () |
# Purpose : This function gets the filename for importing the
# model from other applications. This functions
# imports model from a UG file.
#
# A UG file "clip.prt" is used in this session file.
#
# 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 p3_ps_get_xmt()
# has the following arguments:
#
# p3_ps_get_xmt
# (
# filename )
#
#---------------------------------------------------------------------
# Variable Decleration
INTEGER uil_file_import_paras_num_parts
INTEGER i_status
STRING filename[1024](1)
#---------------------------------------------------------------------
# Open a database
IF(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
ENDIF
#---------------------------------------------------------------------
# The following 2 functions are required to initialise the function
# p3_ps_get_xmt().
uil_db_commit( "Unigraphics Model Access Command" )
p3_ps_open_ug_v2( "clip.prt", @
[1, 1], [0], @
["Attributes", "2", "*", @
"*", "I", "0","Components", "0"], @
uil_file_import_paras_num_parts )
#---------------------------------------------------------------------
# Using the function p3_ps_get_xmt() to get the filename from
# the current directory.
i_status = p3_ps_get_xmt(filename)
dump filename
#----------------------------------------------------------------------
# End of file
set_current_dir | () |
# Purpose : This file provides two example calls to the
# function set_current_dir()
#
# This function is used to set the current
# directory.
#
# The function set_current_dir()
# has the following arguments:
#
# set_current_dir
# ( dirname )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_dirname[128],s_savedir[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Save the current working directory.
i_return_value = @
get_current_dir @
(s_savedir )
# Set the current directory to /usr/bin
s_dirname = “/usr/bin”
i_return_value = @
set_current_dir @
(s_dirname )
dump i_return_value
# Paused. Press resume to continue...
sf_pause()
s_dirname=””
i_return_value = @
get_current_dir @
(s_dirname )
dump s_dirname
# Paused. Press resume to continue...
sf_pause()
# Set the current directory to /notadir
s_dirname = “/notadir”
i_return_value = @
set_current_dir @
(s_dirname )
dump i_return_value
# Paused. Press resume to continue...
sf_pause()
s_dirname=””
i_return_value = @
get_current_dir @
(s_dirname )
dump s_dirname
# Set the current directory back to initial directory.
i_return_value = @
set_current_dir @
(s_savedir )
dump i_return_value
dump s_savedir
#---------------------------------------------------------------------
sf_write_disable | () |
# Purpose : This file provides an example of a call to the
# function sf_write_disable()
#
# This function controls whether the next PCL
# function gets written to the session file.
#
# 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.
#
# File “pclfunc.pcl” should be available.
#
#
# The function sf_write_disable()
# has the following arguments:
#
# sf_write_disable
# (alogical)
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL l_alogical
#---------------------------------------------------------------------
# Compile pclfunc.pcl to get pclfunc.plb
# This file contains two functions pcl_func1() and pcl_func2()
# pcl_func1() calls pcl_func2().
# These functions use ui_write() to write a message to session file.
!!COMPILE pclfunc.pcl
# Add pclfunc.plb to LIBRARY
!!LIBRARY ADD pclfunc.plb
# Enable recording PCL function calls.
l_alogical = FALSE
sf_write_disable(l_alogical )
# Call pcl_func1()
pcl_func1()
# Disable recording PCL function calls.
l_alogical = TRUE
sf_write_disable(l_alogical )
# Call pcl_func1()
pcl_func1()
!!LIBRARY REMOVE pclfunc.plb
#---------------------------------------------------------------------
ugi_export_iges_v1 | () |
# Purpose : This file gives an example of a call to the
# function ugi_export_iges_v1()
#
# This function exports MSC Patran geometry to IGES
# standard.
#
# Before running this session file run spool.ses
# to create spool.db
#
# 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 ugi_export_iges_v1 has the following arguments:
# ugi_export_iges_v1
# ( filename,
# start_section,
# nlpos,
# nlknt,
# product_id,
# author,
# author_org,
# model_units,
# entity_toggle_values,
# all_groups,
# ngroups,
# group_ids,
# patran_summary,
# iges_summary )
#
#---------------------------------------------------------------------
# Variable Declaration and initialisation.
#
STRING sv_created_ids[VIRTUAL]
STRING s_filename[64],s_start_section[128]
INTEGER ia_nlpos(2) = [45, 90]
INTEGER i_nlknt
STRING s_product_id[64]
STRING s_author[32]
STRING s_author_org[32]
STRING s_model_units[16]
LOGICAL la_entity_toggle_values(35) = [TRUE, TRUE, TRUE, @
TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, @
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @
FALSE, FALSE ]
LOGICAL l_all_groups
INTEGER i_ngroups
INTEGER ia_group_ids(2)=[1,2]
INTEGER ia_patran_summary(7)
INTEGER ia_iges_summary(20)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Now export MSC Patran geometry to the IGES standard.
#
# s_filename[64] = “spool_igs”
# s_start_section[128] = “MSC Patran generated IGES file”
# i_nlknt = 2
# s_product_id[64] = “MSC Patran IGES Export”
# s_author[32] = “Sudarshan N Mogasale”
# s_author_org[32] = “GSSL,Pune,India”
# s_model_units[16] = “cm”
# l_all_groups = TRUE
# i_ngroups = 2
s_filename = “spool_igs”
s_start_section = “MSC Patran generated IGES file”
i_nlknt = 2
s_product_id = “MSC Patran IGES Export”
s_author = “Sudarshan N Mogasale”
s_author_org = “GSSL,Pune,India”
s_model_units = “cm”
l_all_groups = TRUE
i_ngroups = 2
i_return_value = @
ugi_export_iges_v1 @
( s_filename, @
s_start_section, @
ia_nlpos, @
i_nlknt, @
s_product_id, @
s_author, @
s_author_org, @
s_model_units, @
la_entity_toggle_values, @
l_all_groups, @
i_ngroups, @
ia_group_ids, @
ia_patran_summary, @
ia_iges_summary )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ugi_import_iges_v3 | () |
# Purpose : This file provides an example of a call to the
# function ugi_import_iges_v3()
#
# This session file will be imported the IGES
# format file "geometry.igs.01" in a new
# database named "new.db".
#
# This file can be run by starting a session of
# MSC Patran, running this session file through
# the "File","Session","Play" pulldown menus
# on the menu bar.
#
#
# The function ugi_import_iges_v3()
# has the following arguments:
#
# [REF: ugiblt.tmpl]
#
# ugi_import_iges_v3 (filname, @
# ipref142, @
# group_name, @
# entity_toggle_values, @
# color_toggle_values, @
# color_definition_method, @
# color_definition_values, @
# all_levels, @
# level_numbers, @
# num_groups, @
# group_ids, @
# group_entity_values, @
# group_color_values, @
# level_pointers, @
# group_levels, @
# uil_file_import_ige_scale_model, @
# uil_file_import_iges_i_summary, @
# uil_file_import_iges_p_summary )
#
#---------------------------------------------------------------------
# Variable Decleration
STRING filname[32]
INTEGER ipref142
STRING group_name[32]
LOGICAL entity_toggle_values(35)
LOGICAL color_toggle_values(10)
STRING color_definition_method[8]
STRING color_definition_values[8]
LOGICAL all_levels
STRING level_numbers[8]
INTEGER num_groups
INTEGER group_ids(1)
LOGICAL group_entity_values(1,1)
LOGICAL group_color_values(1,1)
INTEGER level_pointers(1)
INTEGER group_levels(1)
REAL uil_file_import_ige_scale_model
INTEGER uil_file_import_iges_i_summary(50)
INTEGER uil_file_import_iges_p_summary(8)
integer i_return_value
string msg[512]
#---------------------------------------------------------------------
# Opening a new data base
IF( !db_is_open()) THEN
uil_file_new.go( "", "new.db" )
ENDIF
$? YES 36000002
#---------------------------------------------------------------------
# Argument Initialization
filname = "geometry.igs.01"
ipref142 = 0
group_name = "default_group"
entity_toggle_values = [TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @
TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @
TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @
FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, @
FALSE, FALSE, FALSE, FALSE, FALSE, @
FALSE, FALSE, @
FALSE, FALSE, FALSE, FALSE]
color_toggle_values = [TRUE, TRUE, TRUE, TRUE, TRUE, @
TRUE, TRUE, TRUE, TRUE, FALSE ]
color_definition_method = "all"
color_definition_values = ""
all_levels = TRUE
level_numbers = ""
num_groups = 0
group_ids = 0
group_entity_values(1,1) = FALSE
group_color_values(1,1) = FALSE
level_pointers(1) = 0
group_levels(1) = 0
#---------------------------------------------------------------------
# Importing all the entities from file "geometry.igs.01"
i_return_value = @
ugi_import_iges_v3 ( filname, @
ipref142, @
group_name, @
entity_toggle_values, @
color_toggle_values, @
color_definition_method, @
color_definition_values, @
all_levels, @
level_numbers, @
num_groups, @
group_ids, @
group_entity_values, @
group_color_values, @
level_pointers, @
group_levels, @
uil_file_import_ige_scale_model, @
uil_file_import_iges_i_summary, @
uil_file_import_iges_p_summary )
msg_get_string(i_return_value, msg)
#---------------------------------------------------------------------
# Dumped all the outputs and status of the function.
dump uil_file_import_ige_scale_model
dump uil_file_import_iges_i_summary
dump uil_file_import_iges_p_summary
dump i_return_value
dump msg
#---------------------------------------------------------------------
# Closing the patran environment.
# uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
ui_form_to_frame | () |
# Purpose : This file provides an example of a call to the
# function ui_form_to_frame()
#
# This function is used to create a FrameMaker
# (tm) file which contains the currently
# displayed form of class name to the specified
# scale.
#
# The message.pcl file contains code to create
# a medium width quarter height sized form
# which containins a text widget for the message
# and a push button to acknowledge and remove the
# form.
#
# The message.pob file used below can be created
# from messag.pcl by using the C preprocessor
# to expand the symbols defined in the included
# files. See the “Part 9: PCL and Customization”
# manual for more information.
#
# A command similar to the following can be used
# to generate the message.pob file:
#
# cpp -I$P3_HOME/customisation message.pcl message.pob
#
# The function ui_form_to_frame()
# has the following arguments:
#
# ui_form_to_frame
# (classname,
# scale )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_classname[32]
REAL r_scale
#---------------------------------------------------------------------
# Compile message.pob and add message.plb to LIBRARY
!!COMPILE message.pob
!!LIBRARY ADD message.plb
message(“ This form showing this message will be saved as MSG.mif”)
s_classname=”MSG”
r_scale = 1.0
ui_form_to_frame(s_classname, r_scale )
#---------------------------------------------------------------------
ui_framemaker | () |
# Purpose : This file provides examples of calls to the
# function ui_framemaker()
#
# This function is used to automate creation of
# FrameMaker(tm) files.
#
# The message.pcl file contains code to create
# a medium width quarter height sized form
# which containins a text widget for the message
# and a push button to acknowledge and remove the
# form.
#
# The message.pob file used below can be created
# from messag.pcl by using the C preprocessor
# to expand the symbols defined in the included
# files. See the “Part 9: PCL and Customization”
# manual for more information.
#
# A command similar to the following can be used
# to generate the message.pob file:
#
# cpp -I$P3_HOME/customisation message.pcl message.pob
#
#
# The function ui_framemaker()
# has the following arguments:
#
# ui_framemaker
# (option,
# scale )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_classname[32]
INTEGER i_option
REAL r_scale
#---------------------------------------------------------------------
# Compile message.pcl and add resulting message.plb to LIBRARY
!!COMPILE pclfunc.pob
!!LIBRARY ADD message.plb
r_scale = 1.0
i_option = 1
# With i_option =1 the displayed form name will be echoed to
# the history window, which can be used in ui_form_to_frame()
# function.
ui_framemaker @
(i_option, @
r_scale )
message( “The name of the form (MSG) showing this “ // @
“message will be echoed to the history window.”)
s_classname=”MSG”
ui_form_to_frame @
(s_classname, @
r_scale )
# Paused. Press resume to continue..
sf_pause()
i_option = 2
# With i_option =2, whenever a form is displayed using
# ui_form_display() the name will be echoed to History window,
# and a call is automatically made to ui_form_to_frame() function.
ui_framemaker @
(i_option, @
r_scale )
message( “The name of the form (MSG) showing this “ // @
“message will be echoed to the history “ // @
“window and will be automatically “ // @
“saved as MSG.mif”)
i_option = 0
# With i_option =0, ui_form_display() reverts back to normal
# operation.
ui_framemaker @
(i_option, @
r_scale )
message( “The name of the form (MSG) showing this “ // @
“message will NOT be echoed to the history “ // @
“window and will NOT be “ // @
“saved as MSG.mif”)
#---------------------------------------------------------------------
uil_file_open.open_db | () |
# Purpose : This file provides an example of a call to the
# function uil_file_open.open_db()
#
# This function is used to open a database and
# set some initial parameters.
#
# This file can be run by starting a session of
# MSC Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function uil_file_open.open_db()
# has the following arguments:
#
# uil_file_open.open_db
# (name,
# newdb )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[128],s_newdb[128],s_olddb[128]
LOGICAL l_newdb
LOGICAL l_dbexists,l_return_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Close any existing database.
l_dbexists= db_is_open()
if(l_dbexists) then
db_name_get(s_olddb)
uil_file_close.go()
end if
dump l_dbexists
# Now no database is open
l_return_value=db_is_open()
dump l_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Create and then close the “new.db” database.
s_name=”new.db”
uil_file_new.go(““, “./new.db”)
$? YES 36000002
ga_viewport_size_set( “default_viewport”, 2.5, 2.5, 1 )
ga_viewport_location_set( “default_viewport”, 0.0, 7.0, 1 )
uil_file_close.go()
# Open the existing “new.db” database.
l_newdb=FALSE
i_return_value = @
uil_file_open.open_db @
( s_name, @
l_newdb )
dump i_return_value
# Check the existing database
l_return_value=db_is_open()
dump l_return_value
db_name_get(s_newdb)
dump s_newdb
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the temporary database
uil_file_close.go()
# Open the original database(if any).
if(l_dbexists)then
s_name=s_olddb
l_newdb=FALSE
i_return_value = @
uil_file_open.open_db @
(s_name, @
l_newdb )
dump i_return_value
end if
#--------------------------------------------------------------------
utl_is_locked_file | () |
# Purpose : This file provides an example of a call to the
# function utl_is_locked_file()
#
# This function is used to determine if the
# indicated file is currently locked.
#
# 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 utl_is_locked_file()
# has the following arguments:
#
# utl_is_locked_file
# (filename )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_filename[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the database name and check whether it is locked.
db_name_get(s_filename)
i_return_value = @
utl_is_locked_file @
(s_filename )
dump i_return_value
dump s_filename
# Session file paused. Press “Resume” to continue..
sf_pause()
# Lock the database file
i_return_value = @
utl_lock_file @
(s_filename )
dump i_return_value
dump s_filename
# Get the database name and check whether it is locked.
i_return_value = @
utl_is_locked_file @
(s_filename )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Unlock the database file
i_return_value = utl_unlock_file()
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Check the locked file
i_return_value = @
utl_is_locked_file @
(s_filename )
dump i_return_value
dump s_filename
#---------------------------------------------------------------------
utl_lock_file | () |
# Purpose : This file provides an example of a call to the
# function utl_lock_file()
#
# This function is used to set an advisory
# lock on the indicated file.
#
# 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 utl_lock_file()
# has the following arguments:
#
# utl_lock_file
# (filename )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_filename[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the database name and check whether it is locked.
db_name_get(s_filename)
i_return_value = @
utl_is_locked_file @
(s_filename )
dump i_return_value
dump s_filename
# Session file paused. Press “Resume” to continue..
sf_pause()
# Temporarily Unlock the database file
i_return_value = utl_unlock_file()
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Check if the file locked
i_return_value = @
utl_is_locked_file @
(s_filename )
dump i_return_value
dump s_filename
# Session file paused. Press “Resume” to continue..
sf_pause()
# Lock the database file
i_return_value = @
utl_lock_file @
(s_filename )
dump i_return_value
dump s_filename
#---------------------------------------------------------------------
utl_unlock_file | () |
# Purpose : This file provides an example of a call to the
# function utl_unlock_file()
#
# 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 utl_unlock_file() has no arguments.
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_filename[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the database name and check whether it is locked.
db_name_get(s_filename)
i_return_value = @
utl_is_locked_file @
(s_filename )
dump i_return_value
dump s_filename
# Session file paused. Press “Resume” to continue..
sf_pause()
# Temporarily Unlock the database file
i_return_value = utl_unlock_file()
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Check if the file locked
i_return_value = @
utl_is_locked_file @
(s_filename )
dump i_return_value
dump s_filename
# Session file paused. Press “Resume” to continue..
sf_pause()
# Lock the database file again
i_return_value = @
utl_lock_file @
(s_filename )
dump i_return_value
dump s_filename
#---------------------------------------------------------------------