clip_plane_ar_calc | () |
# Purpose : This file provides an example of a call to the
# function clip_plane_ar_calc()
#
# This function updates the specified clipping
# plane’s data to reflect the axes relative
# rotations about the x,y and z axes.
#
# In this example, a clipping plane is created
# and posted for viewing. Then relative
# rotations about the x,y and z axes for
# clipping plane are specified. The new
# direction and up-vector values, obtained are
# then set to the clipping plane and viewed
# again.
#
# 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 clip_plane_ar_calc()
# has the following arguments:
#
# clip_plane_ar_calc
# ( name,
# rotx,
# roty,
# rotz,
# new_dir,
# new_up )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
REAL r_rotx
REAL r_roty
REAL r_rotz
REAL ra_new_dir(3)
REAL ra_new_up(3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create(s_name)
# Post the clipping plane
ga_clip_plane_post(s_name)
# Set the axes relative rotations about the x,y and z axes.
r_rotx = 45.0
r_roty = 45.0
r_rotz = 0.0
i_return_value = @
clip_plane_ar_calc @
( s_name, @
r_rotx, @
r_roty, @
r_rotz, @
ra_new_dir, @
ra_new_up )
dump i_return_value
# New direction of clipping plane
dump ra_new_dir
# New up-vector of clipping plane
dump ra_new_up
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the new direction and up-vector values
ga_clip_plane_direction_set(s_name, ra_new_dir,TRUE)
ga_clip_plane_up_set(s_name, ra_new_up )
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
clip_plane_zoom_calc | () |
# Purpose : This file provides an example of a call to the
# function clip_plane_zoom_calc()
#
# This function updates the specified clipping
# plane’s location point, to reflect zooming.
#
# In this example, a clipping plane is created
# and posted for viewing. The zoom factor is
# then specified. The new location value,
# obtained are then set to the clipping plane
# and viewed again.
#
# 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 clip_plane_zoom_calc()
# has the following arguments:
#
# clip_plane_zoom_calc
# ( name,
# factor,
# new_loc )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL r_factor
REAL ra_new_loc(3)
REAL ra_value(3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create(s_name)
# Post the clipping plane
ga_clip_plane_post(s_name)
# Set the zoom-factor
r_factor = 1.5
i_return_value = @
clip_plane_zoom_calc @
( s_name, @
r_factor, @
ra_new_loc )
dump i_return_value
# New location of clipping plane
dump ra_new_loc
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the location of the clipping plane
ga_clip_plane_location_set(s_name, ra_new_loc)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
db_get_current_viewport_id | () |
# Purpose : This file provides an example of a call to the
# function db_get_current_viewport_id()
#
# 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 db_get_current_viewport_id()
# has the following arguments:
#
# db_get_current_viewport_id
# ( vp_id )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_vp_id
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the ID of the current viewport
i_return_value = @
db_get_current_viewport_id @
( i_vp_id )
dump i_return_value, i_vp_id
#---------------------------------------------------------------------
end_vrml_animation | () |
# Purpose : This function closes the file opened by
# start_vrml_animation function. It has no
# returns conditions
#
# 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 end_vrml_animation()
# has no arguments:
#---------------------------------------------------------------------
# Variable Declarations
INTEGER fem_create_mesh_surfa_num_nodes
INTEGER fem_create_mesh_surfa_num_elems
INTEGER int_status
STRING fem_create_mesh_s_nodes_created[VIRTUAL]
STRING fem_create_mesh_s_elems_created[VIRTUAL]
STRING asm_create_patch_xy_created_ids[VIRTUAL]
INTEGER res_create_demo_mcid
INTEGER res_create_demo_scid
INTEGER res_create_demo_rcid
INTEGER res_create_demo_layerposid
INTEGER res_create_demo_rtid
STRING filename[256] = "animate.wrl"
#----------------------------------------------------------------------
# Open a new database
if(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
endif
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#----------------------------------------------------------------------
# Create the surface 1
int_status = asm_const_patch_xyz( @
"1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
dump int_status
#----------------------------------------------------------------------
# Create the finite elements
# Create 121 nodes and 100 elements for Surface 1.
ui_exec_function( "mesh_seed_display_mgr", "init" )
int_status = fem_create_mesh_surf_3( @
"IsoMesh", @
16384, @
"Surface 1", @
1, @
["0.1"], @
"Quad4", @
"#", @
"#", @
"Coord 0", @
"Coord 0", @
fem_create_mesh_surfa_num_nodes, @
fem_create_mesh_surfa_num_elems, @
fem_create_mesh_s_nodes_created, @
fem_create_mesh_s_elems_created )
mesh_seed_display_mgr.erase( )
dump int_status
#----------------------------------------------------------------------
# Creating a dummy Result case for demonstration of
# animation.
db_drop_res_index( )
res_db_create_loadcase_c( "Default case", @
1, @
"Created by MSC Patran for demo results",@
res_create_demo_mcid )
res_db_create_subcase_c( 2, @
"demo", @
res_create_demo_scid, @
res_create_demo_rcid )
res_db_createlayerpos_c( 0, @
0, @
res_create_demo_layerposid )
res_db_create_restype_c( "Nodal Vector", @
"Demo Result1", @
2, 1, @
"By MSC Patran For Demo Results", @
0, @
res_create_demo_rtid )
res_create_demoresult2( 3, 1, 1., 1, 1, 1, @
[0, 0, 0, 0], @
2, 0, 0, 0 )
$# Demo result done
#----------------------------------------------------------------------
# Starting the animation recording.
start_vrml_animation(filename,"Increment")
#----------------------------------------------------------------------
# The animation parameters are defined here
db_post_results_load( )
res_display_tool_unpost( "Deformation", @
"default_Deformation" )
res_data_load_dbresult( 0, @
"Nodal", @
"Scalar", @
"Default case", @
"demo", @
"Nodal Vector", @
"Demo Result1", @
"(NON-LAYERED)", @
"XX", @
"Default", @
"DeriveAverage", @
"All", @
"ShapeFunc" )
res_data_title( 0, "Nodal", "Scalar",1, @
["Default case, demo: Nodal Vector,Demo Result1-(NON-LAYERED) (XX)"] )
res_display_fringe_create( "", "FreeFaces", 0, [""], 12, @
["Range:Fri_default_Fringe", "RangeOverwrite:ON", @
"FringeStyle:Discrete/Smooth", "Shade:None", @
"ElemEdge:FreeEdge,Blue,Solid,1", "Shrink:0", @
"TitleDisplay:OFF", "MinMaxDisplay:OFF", "ValueDisplay:OFF", @
"Filter:None","ScaleFactor:1.", @
"LabelStyle:Exponential, 12, White, 3"], @
TRUE )
res_display_fringe_post( "", 0, "Nodal", TRUE, FALSE )
res_display_tool_animate_scale( "Modal", "Fringe", "", 0. )
res_display_anim_setup_2d( 30, "Linear", "" )
res_display_anim_run( 10 )
res_display_anim_clear( )
#----------------------------------------------------------------------
# Using the function end_vrml_animation to stop the animation.
end_vrml_animation()
#----------------------------------------------------------------------
# Closing the file new.db
uil_file_close.goquit()
# End of file
#----------------------------------------------------------------------
ga_clip_plane_clip_planes_get | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_clip_planes_get()
#
# This function gets the list of arbitrary
# clipping planes available in the database.
#
# In this example, three clipping planes are
# created and then posted to default viewport.
# Then the list of clipping planes is obtained.
#
# 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 ga_clip_plane_clip_planes_get()
# has the following arguments:
#
# ga_clip_plane_clip_planes_get
# ( clip_plane_list ),
#
#---------------------------------------------------------------------
# Variable Declarations
STRING saa_clip_plane_list[16](3) = [““,””,””]
INTEGER i_return_value
INTEGER i_count
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Create new clipping planes
ga_clip_plane_create(“Clipping_Plane_1”)
ga_clip_plane_create(“Clipping_Plane_2”)
ga_clip_plane_create(“Clipping_Plane_3”)
# Post the clipping plane
ga_clip_plane_post(“Clipping_Plane_1”)
ga_clip_plane_post(“Clipping_Plane_2”)
ga_clip_plane_post(“Clipping_Plane_3”)
# Get the list of clipping planes
i_return_value = @
ga_clip_plane_clip_planes_get @
( saa_clip_plane_list )
dump i_return_value
dump saa_clip_plane_list
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
FOR ( i_count = 1 TO 3 )
ga_clip_plane_delete(saa_clip_plane_list(i_count))
END FOR
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_create |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_create()
#
# This function creates an arbitrary clipping
# plane.
#
# In this example, a clipping plane is created
# and then posted for viewing.
#
# 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 ga_clip_plane_create()
# has the following arguments:
#
# ga_clip_plane_create
# ( name ),
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
i_return_value = @
ga_clip_plane_create @
( s_name )
dump i_return_value
# Post the clipping plane
ga_clip_plane_post(s_name)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_delete | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_delete()
#
# This function deletes the specified clipping
# plane.
#
# In this example, a clipping plane is created
# and then posted for viewing. The clipping plane
# is then deleted in the end.
#
# 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 ga_clip_plane_delete()
# has the following arguments:
#
# ga_clip_plane_delete
# ( name ),
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create(s_name)
# Post the clipping plane
ga_clip_plane_post(s_name)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
i_return_value = @
ga_clip_plane_delete @
( s_name )
dump i_return_value
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_direction_get | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_direction_get()
#
# This function gets the specified arbitrary
# clipping plane direction.
#
# In this example, a clipping plane is created
# and then posted for viewing. The clipping
# plane’s direction is then obtained.
#
# 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 ga_clip_plane_direction_get()
# has the following arguments:
#
# ga_clip_plane_direction_get
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
REAL ra_value(3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create(s_name)
# Post the clipping plane
ga_clip_plane_post(s_name)
# Get the direction of clipping plane
i_return_value = @
ga_clip_plane_direction_get @
( s_name, @
ra_value )
dump i_return_value
dump ra_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_direction_set | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_direction_set()
#
# This function sets the arbitrary clipping
# plane direction.
#
# In this example, a clipping plane is created
# and posted for viewing. The direction of the
# clipping is then changed using this function
# and viewed again.
#
# 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 ga_clip_plane_direction_set()
# has the following arguments:
#
# ga_clip_plane_direction_set
# ( name,
# value,
# up_flag )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
REAL ra_value(3)
LOGICAL l_up_flag
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create(s_name)
# Post the clipping plane
ga_clip_plane_post(s_name)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the direction of the clipping plane
ra_value = [0.0 , -1.0, -1.0]
l_up_flag = TRUE
i_return_value = @
ga_clip_plane_direction_set @
( s_name, @
ra_value, @
l_up_flag )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_icon_get | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_icon_get()
#
# This function gets the status whether the
# clipping plane icon is displayed or not.
#
# In this example, a clipping plane is created
# and then posted for viewing. Then the check for
# the existence of icon is carried out.
#
# 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 ga_clip_plane_icon_get()
# has the following arguments:
#
# ga_clip_plane_icon_get
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
INTEGER i_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create(s_name)
# Post the clipping plane
ga_clip_plane_post(s_name)
# Get the status for icon display
i_return_value = @
ga_clip_plane_icon_get @
( s_name, @
i_value )
dump i_return_value
dump i_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_icon_set | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_icon_set()
#
# This function sets the status for display of
# clipping plane.
#
# In this example, a clipping plane is created
# and then posted for viewing. Then the icon is
# hidden by setting i_value = 0 and viewed again.
#
# 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 ga_clip_plane_icon_set()
# has the following arguments:
#
# ga_clip_plane_icon_set
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
INTEGER i_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create(s_name)
# Post the clipping plane
ga_clip_plane_post(s_name)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the status for icon display
# Hide the icon
i_value = 0
i_return_value = @
ga_clip_plane_icon_set @
( s_name, @
i_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_location_get | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_location_get()
#
# This function gets the specified arbitrary
# clipping plane location.
#
# In this example, a clipping plane is created
# and then posted for viewing. The clipping
# plane’s location is then obtained.
#
# 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 ga_clip_plane_location_get()
# has the following arguments:
#
# ga_clip_plane_location_get
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
REAL ra_value(3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create(s_name)
# Post the clipping plane
ga_clip_plane_post(s_name)
# Get the location of clipping plane
i_return_value = @
ga_clip_plane_location_get @
( s_name, @
ra_value )
dump i_return_value
dump ra_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_location_set | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_location_set()
#
# This function sets the arbitrary clipping
# plane location.
#
# In this example, a clipping plane is created
# and posted for viewing. The location of the
# clipping plane is then changed using this
# function and viewed again.
#
# 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 ga_clip_plane_location_set()
# has the following arguments:
#
# ga_clip_plane_location_set
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
REAL ra_value(3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create(s_name)
# Post the clipping plane
ga_clip_plane_post(s_name)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the location of the clipping plane
ra_value = [0.0 , 0.0, 0.0]
i_return_value = @
ga_clip_plane_location_set @
( s_name, @
ra_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_movement_get | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_movement_get()
#
# This function gets the status whether the
# clipping plane moves along with the model or
# not. If the flag value is zero then clipping
# plane doesn’t move with the model and moves
# if flag value is non-zero.
#
# In this example, a clipping plane is created
# and then posted for viewing. Movement of
# clipping plane, if any, on rotation of the
# model is then observed by rotating the model
# along X-Y axis.
#
# 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 ga_clip_plane_movement_get()
# has the following arguments:
#
# ga_clip_plane_movement_get
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
INTEGER i_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create(s_name)
# Post the clipping plane
ga_clip_plane_post(s_name)
# Get flag value for clipping plane movement along with the model
i_return_value = @
ga_clip_plane_movement_get @
( s_name, @
i_value )
dump i_return_value
dump i_value
# Rotate the model.(Use Mouse Rotate XY)
# It can be observed that clipping plane remaining stationery
# while the model is rotated, as i_value = 0.
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_movement_set | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_movement_set()
#
# This function sets the status whether the
# clipping plane is to be rotated along with the
# model or not.
#
# In this example, a clipping plane is created
# and then posted for viewing. The flag value
# is set as 1, for the movement of clipping plane
# along with the rotation of model. The effects
# on clipping plane movement is then observed,
# by rotating the model along X-Y axis.
#
# 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 ga_clip_plane_movement_set()
# has the following arguments:
#
# ga_clip_plane_movement_set
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
INTEGER i_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create(s_name)
# Post the clipping plane
ga_clip_plane_post(s_name)
# Get the status of the movement of clipping plane with model
ga_clip_plane_movement_get(s_name, i_value )
# Flag value
dump i_value
# Rotate the model.(Use Mouse Rotate XY)
# It can be observed that clipping plane remaining stationery
# while the model is rotated, as i_value = 0.
# Session file paused. Press “Resume” to continue..
sf_pause()
# Change the status for the clipping plane allowing it to move along
# with the model.
i_value = 1
i_return_value = @
ga_clip_plane_movement_set @
( s_name, @
i_value )
dump i_return_value
# Rotate the model.(Use Mouse Rotate XY)
# It can be observed that the clipping plane getting rotated along
# with the model, as i_value is non-zero.
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_nclip_planes_get | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_nclip_planes_get()
#
# This function gets the number of arbitrary
# clipping planes available in the database.
#
# In this example, three clipping planes are
# created and then posted to default viewport.
# Then the number of clipping planes is obtained.
#
# 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 ga_clip_plane_nclip_planes_get()
# has the following arguments:
#
# ga_clip_plane_nclip_planes_get
# ( naclips ),
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_naclips
STRING saa_clip_plane_list[16](3)
INTEGER i_count
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Initialize saa_clip_plane_list
saa_clip_plane_list = [“Clipping_Plane_1” , @
“Clipping_Plane_2” , @
“Clipping_Plane_3” ]
# Create new clipping planes
FOR ( i_count = 1 TO 3 )
ga_clip_plane_create(saa_clip_plane_list(i_count))
END FOR
# Post the clipping plane
FOR ( i_count = 1 TO 3 )
ga_clip_plane_post(saa_clip_plane_list(i_count))
END FOR
# Get the number of clipping planes
i_return_value = @
ga_clip_plane_nclip_planes_get @
( i_naclips )
dump i_return_value
dump i_naclips
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
FOR ( i_count = 1 TO 3 )
ga_clip_plane_delete(saa_clip_plane_list(i_count))
END FOR
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_nposted_get | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_nposted_get()
#
# This function gets the number of arbitrary
# clipping planes posted to default view port.
#
# In this example, 3 clipping planes are created
# and only 2 are posted to default viewport.
# Then the number of clipping planes posted is
# obtained.
#
# 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 ga_clip_plane_nposted_get()
# has the following arguments:
#
# ga_clip_plane_nposted_get
# ( naclips ),
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_naclips
STRING saa_clip_plane_list[16](3)
INTEGER i_count
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Initialize saa_clip_plane_list
saa_clip_plane_list = [“Clipping_Plane_1” , @
“Clipping_Plane_2” , @
“Clipping_Plane_3” ]
# Create new clipping planes
FOR ( i_count = 1 TO 3 )
ga_clip_plane_create(saa_clip_plane_list(i_count))
END FOR
# Post only the first 2 clipping plane
FOR ( i_count = 1 TO 2 )
ga_clip_plane_post(saa_clip_plane_list(i_count))
END FOR
# Get the number of posted clipping planes
i_return_value = @
ga_clip_plane_nposted_get @
( i_naclips )
dump i_return_value
dump i_naclips
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
FOR ( i_count = 1 TO 3 )
ga_clip_plane_delete(saa_clip_plane_list(i_count))
END FOR
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_post | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_post()
#
# This function posts an arb., clipping plane.
#
# In this example, a clipping plane is created
# and then posted for viewing.
#
# 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 ga_clip_plane_post()
# has the following arguments:
#
# ga_clip_plane_post
# ( name ),
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create (s_name)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Post the clipping plane
i_return_value = @
ga_clip_plane_post @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_posted_get | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_posted_get()
#
# This function gets the list of arbitrary
# clipping planes posted to default view port.
#
# In this example, 3 clipping planes are created
# and only 2 are posted to default viewport.
# Then the list of clipping planes posted is
# obtained.
#
# 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 ga_clip_plane_posted_get()
# has the following arguments:
#
# ga_clip_plane_posted_get
# ( clip_plane_list ),
#
#---------------------------------------------------------------------
# Variable Declarations
STRING saa_clip_plane_list[16](3)
STRING saa_cp_post_list[16](3)
INTEGER i_count
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Initialize saa_clip_plane_list
saa_clip_plane_list = [“Clipping_Plane_1” , @
“Clipping_Plane_2” , @
“Clipping_Plane_3” ]
# Create new clipping planes
FOR ( i_count = 1 TO 3 )
ga_clip_plane_create(saa_clip_plane_list(i_count))
END FOR
# Post only the first 2 clipping plane
FOR ( i_count = 1 TO 2 )
ga_clip_plane_post(saa_clip_plane_list(i_count))
END FOR
# Get the list of posted clipping planes
i_return_value = @
ga_clip_plane_posted_get @
( saa_cp_post_list )
dump i_return_value
dump saa_cp_post_list
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
FOR ( i_count = 1 TO 3 )
ga_clip_plane_delete(saa_clip_plane_list(i_count))
END FOR
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_unpost | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_unpost()
#
# This function unposts the specified arbitrary
# clipping plane from current viewport.
#
# In this example, a clipping plane is created
# and then posted for viewing. After a pause the
# the the clipping plane is unposted.
#
# 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 ga_clip_plane_unpost()
# has the following arguments:
#
# ga_clip_plane_unpost
# ( name ),
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create ( s_name )
dump i_return_value
# Post the clipping plane
ga_clip_plane_post(s_name)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Unpost the clipping plane
i_return_value = @
ga_clip_plane_unpost @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_clip_plane_up_set | () |
# Purpose : This file provides an example of a call to the
# function ga_clip_plane_up_set()
#
# This function sets the up-vector values for
# specified clipping plane.
#
# In this example, a clipping plane is created
# and posted for viewing. The up-vector values
# of the clipping plane are then changed using
# this function and viewed again.
#
# 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 ga_clip_plane_up_set()
# has the following arguments:
#
# ga_clip_plane_up_set
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
REAL ra_value(3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Post the “default_group”
uil_viewport_post_groups.posted_groups( @
“default_viewport”, 1, [“default_group”] )
# Make shaded display of model
uil_toolbar.shaded_smooth( )
# Name of the arbitrary clipping plane
s_name = “Clipping_Plane_1”
# Create an arbitrary clipping plane
ga_clip_plane_create(s_name)
# Post the clipping plane
ga_clip_plane_post(s_name)
# Get the up-vector values of the clipping plane
ga_clip_plane_up_get ( s_name, ra_value )
dump ra_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the up-vector values of the clipping plane
ra_value = [1.0 , 1.0, 0.0]
i_return_value = @
ga_clip_plane_up_set @
( s_name, @
ra_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the clipping plane
ga_clip_plane_delete(s_name)
# Make wireframe display of model
uil_toolbar.wireframe( )
#---------------------------------------------------------------------
ga_elem_scalar_create | () |
# Purpose : This file provides an example of a call to the
# function ga_elem_scalar_create()
#
# This function is used to create a scalar
# element table.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
#
# 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 ga_elem_scalar_create()
# has the following arguments:
#
# ga_elem_scalar_create
# ( title,
# nbr_elems,
# elem_ids,
# nbr_values,
# max_vals,
# scalars,
# id )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_title[32],s_group_name[32]
INTEGER i_ncases, iv_lcids(VIRTUAL),iv_nsub(VIRTUAL),ia_resids(5)
INTEGER i_dtype,i_resloc,i_nbr_elems,iv_elem_ids(VIRTUAL)
INTEGER iv_nbr_values(VIRTUAL),ia_minloc(6),ia_maxloc(6)
INTEGER i_max_vals
INTEGER i_id
INTEGER i_index,i_return_value
REAL rv_scalars(VIRTUAL)
#---------------------------------------------------------------------
# Open the database “spool.db” and read the deformation results
sf_play(“spool_res.ses”)
# Get the number of Load cases and their IDs
i_return_value = @
res_utl_get_loadcases(i_ncases,iv_lcids,iv_nsub)
dump i_return_value
dump i_ncases,iv_lcids,iv_nsub
# Extract the deformation results from the database
# Load case ID = iv_lcids(1)
# Sub case ID = 1
# Primary Result ID = 2 (Corresponds to deformation )
# Secondary Result ID = 1
# Layer ID = 1
# elem_list = “Element 1:#” (All elements )
# location = “C” (Centroid )
# derivation = “MAG” (Magnitude: Vector to Scalar)
# c_id = ““
ia_resids(1) = iv_lcids(1)
ia_resids(2) = 1
ia_resids(3) = 2
ia_resids(4) = 1
ia_resids(5) = 1
i_return_value = @
res_utl_extract_elem_results(ia_resids,”Element 1:#”,”MAG”,”C”, @
““,i_dtype,i_resloc,i_nbr_elems,iv_elem_ids,iv_nbr_values, @
rv_scalars, ia_minloc,ia_maxloc)
dump i_return_value
# Create a scalar table
s_title = “A Scalar Table”
i_max_vals = 1 /* Only at the Centroid */
i_return_value = @
ga_elem_scalar_create @
( s_title, @
i_nbr_elems, @
iv_elem_ids, @
iv_nbr_values, @
i_max_vals, @
rv_scalars, @
i_id )
dump i_return_value, i_id
# Set the current scalar element table associated with the
# group “fem_model”
s_group_name = “fem_model”
i_return_value = @
ga_group_elem_scalar_set @
( s_group_name, @
i_id )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_elem_ids)
sys_free_array(iv_nbr_values)
sys_free_array(rv_scalars)
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_elem_scalar_single_create | () |
# Purpose : This file provides an example of a call to the
# function ga_elem_scalar_single_create()
#
# This function is used to create a scalar
# element table with a single value per element.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
#
# 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 ga_elem_scalar_single_create()
# has the following arguments:
#
# ga_elem_scalar_single_create
# ( title,
# nbr_elems,
# elem_ids,
# nbr_nodes,
# scalars,
# id )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_title[32],s_group_name[32]
INTEGER i_ncases, iv_lcids(VIRTUAL),iv_nsub(VIRTUAL),ia_resids(5)
INTEGER i_dtype,i_resloc,i_nbr_elems,iv_elem_ids(VIRTUAL)
INTEGER iv_nbr_values(VIRTUAL),ia_minloc(6),ia_maxloc(6)
INTEGER iv_nbr_nodes(VIRTUAL)
INTEGER i_id
INTEGER i_index,i_return_value
REAL rv_scalars(VIRTUAL)
#---------------------------------------------------------------------
# Open the database “spool.db” and read the deformation results
sf_play(“spool_res.ses”)
# Get the number of Load cases and their IDs
i_return_value = @
res_utl_get_loadcases(i_ncases,iv_lcids,iv_nsub)
dump i_return_value
dump i_ncases,iv_lcids,iv_nsub
# Extract the deformation results from the database
# Load case ID = iv_lcids(1)
# Sub case ID = 1
# Primary Result ID = 2 (Corresponds to deformation )
# Secondary Result ID = 1
# Layer ID = 1
# elem_list = “Element 1:#” (All elements )
# location = “C” (Centroid )
# derivation = “MAG” (Magnitude: Vector to Scalar)
# c_id = ““
ia_resids(1) = iv_lcids(1)
ia_resids(2) = 1
ia_resids(3) = 2
ia_resids(4) = 1
ia_resids(5) = 1
i_return_value = @
res_utl_extract_elem_results(ia_resids,”Element 1:#”,”MAG”,”C”, @
““,i_dtype,i_resloc,i_nbr_elems,iv_elem_ids,iv_nbr_values, @
rv_scalars, ia_minloc,ia_maxloc)
dump i_return_value
sys_allocate_array(iv_nbr_nodes,1,i_nbr_elems)
FOR(i_index = 1 TO i_nbr_elems)
iv_nbr_nodes(i_index) = 4 /* QUAD4 elements */
END FOR
# Create a scalar table with a single value per element
s_title = “Scalar Table (Single)”
i_return_value = @
ga_elem_scalar_single_create @
( s_title, @
i_nbr_elems, @
iv_elem_ids, @
iv_nbr_nodes, @
rv_scalars, @
i_id )
dump i_return_value, i_id
# Set the current scalar element table associated with the
# group “fem_model”
s_group_name = “fem_model”
i_return_value = @
ga_group_elem_scalar_set @
( s_group_name, @
i_id )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_elem_ids)
sys_free_array(iv_nbr_values)
sys_free_array(iv_nbr_nodes)
sys_free_array(rv_scalars)
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_error | () |
# Purpose : This file provides two example calls to the
# function ga_error()
#
# This function indicates whether the last call
# to the Graphics application raised an error
# condition or not.
#
# 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 ga_error() has no arguments.
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL l_return_value
#---------------------------------------------------------------------
#
# Post the default_group.
uil_viewport_post_groups.posted_groups(“default_viewport”, @
1,[“default_group”])
l_return_value = ga_error()
dump l_return_value
# Post a non existing group to simulate an error.
uil_viewport_post_groups.posted_groups(“default_viewport”, @
1,[“non_existing_group”])
l_return_value = ga_error()
dump l_return_value
#---------------------------------------------------------------------
ga_light_attenuation_get | () |
# Purpose : This file provides an example of a call to the
# function ga_light_attenuation_get()
#
# This function is used to get the attenuation
# of light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_attenuation_get()
# has the following arguments:
#
# ga_light_attenuation_get
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
REAL r_value
INTEGER i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of lights posted to the graphics window
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the attenuation of the first posted light
s_name = sav_light_list(1)
i_return_value = @
ga_light_attenuation_get @
( s_name, @
r_value )
dump i_return_value
dump r_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_attenuation_set | () |
# Purpose : This file provides an example of two calls
# to the function ga_range_rename()
#
# This function is used to set the attenuation
# of light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_attenuation_set()
# has the following arguments:
#
# ga_light_attenuation_set
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
REAL r_value,r_old_value
INTEGER i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
# Get the list of lights posted to the graphics window
sys_allocate_array(sav_light_list,1,i_nlights)
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the attenuation of the first light posted
s_name = sav_light_list(1)
i_return_value = @
ga_light_attenuation_get @
( s_name, @
r_old_value )
dump i_return_value
dump r_old_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the attenuation of the first light posted
r_value = 0.5
i_return_value = @
ga_light_attenuation_set @
( s_name, @
r_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the attenuation to original value
r_value =r_old_value
i_return_value = @
ga_light_attenuation_set @
( s_name, @
r_value )
dump i_return_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_color_get | () |
# Purpose : This file provides an example of a call to the
# function ga_light_color_get()
#
# This function is used to get the color
# of light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_color_get()
# has the following arguments:
#
# ga_light_color_get
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
INTEGER i_value,i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of lights posted to the graphics window
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the color of the first light posted
s_name = sav_light_list(1)
i_return_value = @
ga_light_color_get @
( s_name, @
i_value )
dump i_return_value
dump i_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_color_set | () |
# Purpose : This file provides an example of two calls
# to the function ga_range_rename()
#
# This function is used to set the color
# of a light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_color_set()
# has the following arguments:
#
# ga_light_color_set
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
INTEGER i_value,i_old_value,i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the color of the first light posted
s_name = sav_light_list(1)
i_return_value = @
ga_light_color_get @
( s_name, @
i_old_value )
dump i_return_value
dump i_old_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the color of the first light posted
i_value = 1
i_return_value = @
ga_light_color_set @
( s_name, @
i_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the color of the light to original value
i_value = i_old_value
i_return_value = @
ga_light_color_set @
( s_name, @
i_value )
dump i_return_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_create | () |
# Purpose : This file provides an example of a call to the
# function ga_light_create()
#
# This function is used to create a light source.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_create()
# has the following arguments:
#
# ga_light_create
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_nlights,i_return_value
STRING s_name[32],sav_light_list[32](VIRTUAL)
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Create a new light source
s_name=”directional_new”
i_return_value = @
ga_light_create @
( s_name )
dump i_return_value
# Get the number of lights present in the databases
i_return_value = @
ga_light_nlights_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of lights
i_return_value = @
ga_light_lights_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the new light source
s_name=”directional_new”
i_return_value = @
ga_light_delete @
( s_name )
dump i_return_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_delete | () |
# Purpose : This file provides an example of a call to the
# function ga_light_delete()
#
# This function is used to delete a light source.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_delete()
# has the following arguments:
#
# ga_light_delete
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_nlights,i_return_value
STRING s_name[32],sav_light_list[32](VIRTUAL)
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Create a new light source
s_name=”directional_new”
i_return_value = @
ga_light_create @
( s_name )
dump i_return_value
# Get the number of lights present in the databases
i_return_value = @
ga_light_nlights_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of lights
i_return_value = @
ga_light_lights_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Delete the light source
s_name=”directional_new”
i_return_value = @
ga_light_delete @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Get the list of lights
i_return_value = @
ga_light_lights_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_direction_get | () |
# Purpose : This file provides an example of two calls to
# the function ga_light_direction_get()
#
# This function is used to get the direction
# of light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_direction_get()
# has the following arguments:
#
# ga_light_direction_get
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
REAL ra_value(3)
INTEGER i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the direction of the first light posted
s_name = sav_light_list(1)
i_return_value = @
ga_light_direction_get @
( s_name, @
ra_value )
dump i_return_value
dump ra_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Get the direction of the second light posted
s_name = sav_light_list(2)
i_return_value = @
ga_light_direction_get @
( s_name, @
ra_value )
dump i_return_value
dump ra_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_direction_set | () |
# Purpose : This file provides an example of two calls
# to the function ga_range_rename()
#
# This function is used to set the direction
# of light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_direction_set()
# has the following arguments:
#
# ga_light_direction_set
# ( name,
# value )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
REAL ra_value(3),ra_old_value(3)
INTEGER i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the direction of the first light posted
s_name = sav_light_list(1)
i_return_value = @
ga_light_direction_get @
( s_name, @
ra_old_value )
dump i_return_value
dump ra_old_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the direction of the first light posted
ra_value = [1.,-1.,1.]
i_return_value = @
ga_light_direction_set @
( s_name, @
ra_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the direction to original value
i_return_value = @
ga_light_direction_set @
( s_name, @
ra_old_value)
dump i_return_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_icon_get | () |
# Purpose : This file provides an example of a call to the
# function ga_light_icon_get()
#
# This function is used to get the light icon
# display status.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_icon_get()
# has the following arguments:
#
# ga_light_icon_get
# ( name,
# value )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
INTEGER i_value,i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of posted lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get icon display status of the first light posted
s_name = sav_light_list(1)
i_return_value = @
ga_light_icon_get @
( s_name, @
i_value )
dump i_return_value
dump i_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_icon_set | () |
# Purpose : This file provides an example of two calls
# to the function ga_range_rename()
#
# This function is used to set the light icon
# display status.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_icon_set()
# has the following arguments:
#
# ga_light_icon_set
# ( name,
# value )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
INTEGER i_value,i_old_value,i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of the posted lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the icon display status of the first light posted
s_name = sav_light_list(1)
i_return_value = @
ga_light_icon_get @
( s_name, @
i_old_value )
dump i_return_value
dump i_old_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the icon display status ON
i_value = 1
i_return_value = @
ga_light_icon_set @
( s_name, @
i_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the icon display status to original value
i_value = i_old_value
i_return_value = @
ga_light_icon_set @
( s_name, @
i_value )
dump i_return_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_intensity_get | () |
# Purpose : This file provides an example of a call to the
# function ga_light_intensity_get()
#
# This function is used to get the intensity
# of light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_intensity_get()
# has the following arguments:
#
# ga_light_intensity_get
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
REAL r_value
INTEGER i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the intensity of the first light posted
s_name = sav_light_list(1)
i_return_value = @
ga_light_intensity_get @
( s_name, @
r_value )
dump i_return_value
dump r_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_intensity_set | () |
# Purpose : This file provides an example of two calls
# to the function ga_range_rename()
#
# This function is used to set the intensity
# of light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_intensity_set()
# has the following arguments:
#
# ga_light_intensity_set
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
REAL r_value,r_old_value
INTEGER i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of posted lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the intensity of the first light posted
s_name = sav_light_list(1)
i_return_value = @
ga_light_intensity_get @
( s_name, @
r_old_value )
dump i_return_value
dump r_old_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the intensity of the first light posted
r_value = 0.5
i_return_value = @
ga_light_intensity_set @
( s_name, @
r_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the intensity back to original value
r_value =r_old_value
i_return_value = @
ga_light_intensity_set @
( s_name, @
r_value )
dump i_return_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_lights_get | () |
# Purpose : This file provides an example of a call to the
# function ga_light_lights_get()
#
# This example is used to get the list of names
# od lights present in the database.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_lights_get()
# has the following arguments:
#
# ga_light_lights_get
# ( light_list )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING sav_light_list[32](VIRTUAL)
INTEGER i_nlights
INTEGER i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights present in the databases
i_return_value = @
ga_light_nlights_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of lights
i_return_value = @
ga_light_lights_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_location_get | () |
# Purpose : This file provides an example of a call to the
# function ga_light_location_get()
#
# This function is used to get the location
# of a light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_location_get()
# has the following arguments:
#
# ga_light_location_get
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
REAL ra_value(3)
INTEGER i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of posted lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the location of the first light posted
s_name = sav_light_list(1)
i_return_value = @
ga_light_location_get @
( s_name, @
ra_value )
dump i_return_value
dump ra_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_location_set | () |
# Purpose : This file provides an example of two calls
# to the function ga_range_rename()
#
# This function is used to set the location
# of a light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_location_set()
# has the following arguments:
#
# ga_light_location_set
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
REAL ra_value(3),ra_old_value(3)
INTEGER i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of posted lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the location of the first light posted
s_name = sav_light_list(1)
i_return_value = @
ga_light_location_get @
( s_name, @
ra_old_value )
dump i_return_value
dump ra_old_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the location of the first light posted
ra_value = [1.,-1.,1.]
i_return_value = @
ga_light_location_set @
( s_name, @
ra_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the location to original value
ra_value =ra_old_value
i_return_value = @
ga_light_location_set @
( s_name, @
ra_value )
dump i_return_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_movement_get | () |
# Purpose : This file provides an example of a call to the
# function ga_light_movement_get()
#
# This function is used to get the movement
# status of light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_movement_get()
# has the following arguments:
#
# ga_light_movement_get
# ( name,
# value )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
INTEGER i_value,i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get movement status of the first posted light
s_name = sav_light_list(1)
i_return_value = @
ga_light_movement_get @
( s_name, @
i_value )
dump i_return_value
dump i_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_movement_set | () |
# Purpose : This file provides an example of three calls
# to the function ga_range_rename()
#
# This function is used to set the movement
# status of light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_movement_set()
# has the following arguments:
#
# ga_light_movement_set
# ( name,
# value )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
INTEGER i_value,i_old_value,i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the movement status for the first light posted
s_name = sav_light_list(1)
i_return_value = @
ga_light_movement_get @
( s_name, @
i_old_value )
dump i_return_value
dump i_old_value
# Set the movement status to OFF
i_value = 0
i_return_value = @
ga_light_movement_set @
( s_name, @
i_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
ga_view_aa_set(-157.,34.,0.)
# Session file paused. Press “Resume” to continue..
sf_pause()
ga_view_aa_set(23.,-34.,0.)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the movement status to ON
i_value = 1
i_return_value = @
ga_light_movement_set @
( s_name, @
i_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
ga_view_aa_set(-157.,34.,0.)
# Session file paused. Press “Resume” to continue..
sf_pause()
ga_view_aa_set(23.,-34.,0.)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the movement status back to old value
i_value = i_old_value
i_return_value = @
ga_light_movement_set @
( s_name, @
i_value )
dump i_return_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_nlights_get | () |
# Purpose : This file provides an example of a call to the
# function ga_light_nlights_get()
#
# This function is used to get the number of
# lights present in the database.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_nlights_get()
# has the following arguments:
#
# ga_light_nlights_get
# ( nlights )
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_nlights
INTEGER i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights present in the database
i_return_value = @
ga_light_nlights_get @
( i_nlights )
dump i_return_value
dump i_nlights
#---------------------------------------------------------------------
ga_light_nposted_get | () |
# Purpose : This file provides an example of a call to the
# function ga_light_nposted_get()
#
# This function is used to get the number of
# lights posted to the graphics window.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_nposted_get()
# has the following arguments:
#
# ga_light_nposted_get
# ( nlights )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_nlights
INTEGER i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
#---------------------------------------------------------------------
ga_light_post | () |
# Purpose : This file provides an example of a call to the
# function ga_light_post()
#
# This function is used to post a light source
# to the graphics window.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_post()
# has the following arguments:
#
# ga_light_post
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_return_value
REAL r_loc(3),r_dir(3),r_int,r_att
INTEGER i_clr,i_move
STRING s_name[32],s_type[32]
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Create a new light source
s_name=”directional_new”
i_return_value = @
ga_light_create @
( s_name )
dump i_return_value
# Initialise attributes of the new light
# r_loc=[1.,-1.,1.] : location [x,y,z]
# r_dir=[1.,-1.,-1.] : direction
# r_int= 0.8 : Intensity (0.0-1.0)
# r_att= 0.0 : No Attenuation
# s_type = “directional” : Directional
# i_clr = 5 : color
# i_move = 0 : Don’t move with
# : model
r_loc=[1.,-1.,1.]
r_dir=[1.,-1.,-1.]
r_int= 0.8
r_att= 0.0
s_type = “directional”
i_clr = 5
i_move = 0
s_name=”directional_new”
ga_light_location_set(s_name,r_loc)
ga_light_direction_set(s_name,r_dir)
ga_light_attenuation_set(s_name,r_att)
ga_light_intensity_set(s_name,r_int)
ga_light_color_set(s_name,i_clr)
ga_light_movement_set(s_name,i_move)
ga_light_type_set(s_name,s_type)
i_return_value = @
ga_light_post @
( s_name )
dump i_return_value
# Paused. Press resume to continue.
sf_pause()
# Unpost the light
i_return_value = @
ga_light_unpost @
( s_name )
dump i_return_value
# Delete the new light source
s_name=”directional_new”
i_return_value = @
ga_light_delete @
( s_name )
dump i_return_value
#---------------------------------------------------------------------
ga_light_posted_get | () |
# Purpose : This file provides an example of a call to the
# function ga_light_posted_get()
#
# This example is used to get the list of names
# of lights posted to the graphics window.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_posted_get()
# has the following arguments:
#
# ga_light_posted_get
# ( light_list )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING sav_light_list[32](VIRTUAL)
INTEGER i_nlights
INTEGER i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of posted lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_type_get | () |
# Purpose : This file provides an example of two calls to
# the function ga_light_type_get()
#
# This function is used to get the type
# of light source.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_type_get()
# has the following arguments:
#
# ga_light_type_get
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
STRING s_value[32]
INTEGER i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of posted lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the type of first posted light source
s_name = sav_light_list(1)
i_return_value = @
ga_light_type_get @
( s_name, @
s_value )
dump i_return_value
dump s_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Get the type of second posted light source
s_name = sav_light_list(2)
i_return_value = @
ga_light_type_get @
( s_name, @
s_value )
dump i_return_value
dump s_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_type_set | () |
# Purpose : This file provides an example of two calls
# to the function ga_range_rename()
#
# This function is used to set the type
# of light.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_type_set()
# has the following arguments:
#
# ga_light_type_set
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],sav_light_list[32](VIRTUAL)
STRING s_value[32],s_old_value[32]
INTEGER i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Get the number of lights posted to the graphics window
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of posted lights
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
# Get the type of the first posted light source
s_name = sav_light_list(1)
i_return_value = @
ga_light_type_get @
( s_name, @
s_old_value )
dump i_return_value
dump s_old_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the type of the first light source to “AMBIENT”
s_value = “AMBIENT”
i_return_value = @
ga_light_type_set @
( s_name, @
s_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the type back to original value
s_value = s_old_value
i_return_value = @
ga_light_type_set @
( s_name, @
s_value )
dump i_return_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_unpost | () |
# Purpose : This file provides an example of a call to the
# function ga_light_unpost()
#
# This function is used to unpost a posted
# light source.
#
# Make “sphere.ses” available in the current
# directory.
#
# 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 ga_light_unpost()
# has the following arguments:
#
# ga_light_unpost
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_return_value
REAL r_loc(3),r_dir(3),r_int,r_att
INTEGER i_clr,i_move
STRING s_name[32],s_type[32]
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Create a new light source
s_name=”directional_new”
i_return_value = @
ga_light_create @
( s_name )
dump i_return_value
# Initialise attributes
# r_loc=[1.,-1.,1.] : location [x,y,z]
# r_dir=[1.,-1.,-1.] : direction
# r_int= 0.8 : Intensity (0.0-1.0)
# r_att= 0.0 : No Attenuation
# s_type = “DIRECTIONAL” : Directional
# i_clr = 5 : color
# i_move = 0 : Don’t move with
# : model
r_loc=[1.,-1.,1.]
r_dir=[1.,-1.,-1.]
r_int= 0.8
r_att= 0.0
s_type = “DIRECTIONAL”
i_clr = 5
i_move = 0
s_name=”directional_new”
ga_light_location_set(s_name,r_loc)
ga_light_direction_set(s_name,r_dir)
ga_light_attenuation_set(s_name,r_att)
ga_light_intensity_set(s_name,r_int)
ga_light_color_set(s_name,i_clr)
ga_light_movement_set(s_name,i_move)
ga_light_type_set(s_name,s_type)
i_return_value = @
ga_light_post @
( s_name )
dump i_return_value
# Paused. Press resume to continue.
sf_pause()
# Unpost the new light source
i_return_value = @
ga_light_unpost @
( s_name )
dump i_return_value
# Delete the new light source
s_name=”directional_new”
i_return_value = @
ga_light_delete @
( s_name )
dump i_return_value
#---------------------------------------------------------------------
ga_lookup_colors_get | () |
# Purpose : This file provides an example of a call to the
# function ga_lookup_colors_get()
#
# This function is used to get the RGB components
# of the colors in a lookup table(LUT).
#
# 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 ga_lookup_colors_get() has the following arguments:
# ga_lookup_colors_get
# ( name,
# rgb )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL ra_rgb(VIRTUAL)
INTEGER i_number,i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the current color lookup table
i_return_value = @
ga_lookup_current_get @
( s_name )
dump s_name
# Get the number of colors defined in the current lookup table
i_return_value = @
ga_lookup_ncolors_get @
( s_name, @
i_number )
dump i_number
SYS_ALLOCATE_ARRAY(ra_rgb,1,i_number,1,3)
# Get the RGB components of the colors in the current lookup table
i_return_value = @
ga_lookup_colors_get @
( s_name, @
ra_rgb )
dump i_return_value
dump ra_rgb
SYS_FREE_ARRAY(ra_rgb)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_lookup_colors_set | () |
# Purpose : This file provides two examples to the
# function ga_lookup_colors_set()
#
# This function is used to set the RGB components
# of the colors in a lookup table.
#
# 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 ga_lookup_colors_set()
# has the following arguments:
#
# ga_lookup_colors_set
# ( name,
# offset,
# number,
# rgb )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL ra_rgb(VIRTUAL)
INTEGER i_offset,i_number
INTEGER i_index,i_comp
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the current color lookup table
i_return_value = @
ga_lookup_current_get @
( s_name )
# Get the number of colors defined in the current lookup table
i_return_value = @
ga_lookup_ncolors_get @
( s_name, @
i_number )
dump i_number
SYS_ALLOCATE_ARRAY(ra_rgb,1,i_number,1,3)
# Get the RGB components of the colors in the current lookup table
i_return_value = @
ga_lookup_colors_get @
( s_name, @
ra_rgb )
dump i_return_value
dump ra_rgb
# Reverse the colors in the lookup table
FOR(i_comp = 1 to 3)
FOR(i_index=1 to i_number)
ra_rgb(i_index,i_comp)= 1 - ra_rgb(i_index,i_comp)
END FOR
END FOR
dump ra_rgb
# Set the RGB components of the colors in the current lookup table
i_offset = 0
i_return_value = @
ga_lookup_colors_set @
( s_name, @
i_offset, @
i_number, @
ra_rgb )
dump i_return_value
# Get the RGB components of the colors in the current lookup table
i_return_value = @
ga_lookup_colors_get @
( s_name, @
ra_rgb )
dump i_return_value
dump ra_rgb
# Session file paused. Press “Resume” to continue..
sf_pause()
# Reverse the colors in the lookup table
FOR(i_comp = 1 to 3)
FOR(i_index=1 to i_number)
ra_rgb(i_index,i_comp)= 1 - ra_rgb(i_index,i_comp)
END FOR
END FOR
dump ra_rgb
# Reset the RGB components of the colors in the current lookup table
i_offset =0
i_return_value = @
ga_lookup_colors_set @
( s_name, @
i_offset, @
i_number, @
ra_rgb )
dump i_return_value
SYS_FREE_ARRAY(ra_rgb)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_lookup_create | () |
# Purpose : This file provides an example of a call to the
# function ga_lookup_create()
#
# This function is used to create a new color
# lookup table
#
# 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 ga_lookup_create()
# has the following arguments:
#
# ga_lookup_create
# ( name,
# number,
# rgb )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],s_old_name[32]
INTEGER i_number
REAL ra_rgb(8,3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the current color lookup table
i_return_value = @
ga_lookup_current_get @
( s_old_name )
# Create a new color lookup table
s_name = “new_8colors”
i_number = 8
ra_rgb = [ @
[0.0, 0.0, 0.0] [1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] @
[1.0, 1.0, 0.0] [0.0, 1.0, 1.0] [1.0, 0.0, 1.0] [1.0, 1.0, 1.0] ]
i_return_value = @
ga_lookup_create @
( s_name, @
i_number, @
ra_rgb )
dump i_return_value
# Set the new color lookup table
i_return_value = @
ga_lookup_current_set @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the old color lookup table
i_return_value = @
ga_lookup_current_set @
( s_old_name )
dump i_return_value
# Delete the created color table
i_return_value = @
ga_lookup_delete @
( s_name )
dump i_return_value
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_lookup_current_get | () |
# Purpose : This file provides an example of a call to the
# function ga_lookup_current_get()
#
# This function is used to get the current color
# lookup table.
#
# 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 ga_lookup_current_get()
# has the following arguments:
#
# ga_lookup_current_get
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the current color lookup table
i_return_value = @
ga_lookup_current_get @
( s_name )
dump i_return_value
dump s_name
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_lookup_current_set | () |
# Purpose : This file provides an example of a call to the
# function ga_lookup_current_set()
#
# This function is used to set the current
# color lookup table
#
# 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 ga_lookup_current_set()
# has the following arguments:
#
# ga_lookup_current_set
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],s_old_name[32]
INTEGER i_number
REAL ra_rgb(8,3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the current color lookup table
i_return_value = @
ga_lookup_current_get @
( s_old_name )
# Create a new color lookup table
s_name = “new_8colors”
i_number = 8
ra_rgb = [ @
[0.0, 0.0, 0.0] [1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] @
[1.0, 1.0, 0.0] [0.0, 1.0, 1.0] [1.0, 0.0, 1.0] [1.0, 1.0, 1.0] ]
i_return_value = @
ga_lookup_create @
( s_name, @
i_number, @
ra_rgb )
dump i_return_value
# Set the new color lookup table
i_return_value = @
ga_lookup_current_set @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the old color lookup table
i_return_value = @
ga_lookup_current_set @
( s_old_name )
dump i_return_value
# Delete the created color table
i_return_value = @
ga_lookup_delete @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_lookup_delete | () |
# Purpose : This file provides an example of a call to the
# function ga_lookup_delete()
#
# This function is used to delete a color
# lookup table
#
# 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 ga_lookup_delete()
# has the following arguments:
#
# ga_lookup_delete
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],s_old_name[32]
INTEGER i_number
REAL ra_rgb(8,3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the current color lookup table
i_return_value = @
ga_lookup_current_get @
( s_old_name )
# Create a new color lookup table
s_name = “new_8colors”
i_number = 8
ra_rgb = [ @
[0.0, 0.0, 0.0] [1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] @
[1.0, 1.0, 0.0] [0.0, 1.0, 1.0] [1.0, 0.0, 1.0] [1.0, 1.0, 1.0] ]
i_return_value = @
ga_lookup_create @
( s_name, @
i_number, @
ra_rgb )
dump i_return_value
# Set the new color lookup table
i_return_value = @
ga_lookup_current_set @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the old color lookup table
i_return_value = @
ga_lookup_current_set @
( s_old_name )
dump i_return_value
# Delete the created color table
i_return_value = @
ga_lookup_delete @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_lookup_ncolors_get | () |
# Purpose : This file provides an example of a call to the
# function ga_lookup_ncolors_get()
#
# This function is used to get the number of
# colors defined in a color lookup table (LUT).
#
# 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 ga_lookup_ncolors_get()
# has the following arguments:
#
# ga_lookup_ncolors_get
# ( name,
# number )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
INTEGER i_number
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the current color lookup table
i_return_value = @
ga_lookup_current_get @
( s_name )
dump i_return_value
dump s_name
# Get the number of colors defined in the current lookup table
i_return_value = @
ga_lookup_ncolors_get @
( s_name, @
i_number )
dump i_return_value
dump i_number
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_lookup_ntables_get | () |
# Purpose : This file provides an example of a call to the
# function ga_lookup_ntables_get()
#
# This function is used to get the number of
# color lookup tables (LUTs) in the database.
#
# 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 ga_lookup_ntables_get()
# has the following arguments:
#
# ga_lookup_ntables_get
# ( ntables )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_ntables
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the number of lookup tables in the database
i_return_value = @
ga_lookup_ntables_get @
( i_ntables )
dump i_return_value
dump i_ntables
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_lookup_rename | () |
# Purpose : This file provides two examples to the
# function ga_lookup_rename()
#
# This function is used to rename an existing
# color lookup table (LUT)
#
# 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 ga_lookup_rename()
# has the following arguments:
#
# ga_lookup_rename
# ( old_name,
# new_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_old_name[32], s_new_name[32],s_name[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the current color lookup table
i_return_value = @
ga_lookup_current_get @
( s_name )
dump s_name
s_old_name = s_name
s_new_name = “New_LUT”
# Rename the current color lookup table
i_return_value = @
ga_lookup_rename @
( s_old_name, @
s_new_name )
dump i_return_value
# Get the current color lookup table
s_name = ““
i_return_value = @
ga_lookup_current_get @
( s_name )
dump s_name
# Restore the name of the current color lookup table
s_new_name = s_old_name
s_old_name = s_name
i_return_value = @
ga_lookup_rename @
( s_old_name, @
s_new_name )
dump i_return_value
# Get the current color lookup table
s_name = ““
i_return_value = @
ga_lookup_current_get @
( s_name )
dump s_name
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_lookup_tables_get | () |
# Purpose : This file provides an example of a call to the
# function ga_lookup_tables_get()
#
# This function is used to get the list of
# color lookup tables (LUTs) in the database.
#
# 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 ga_lookup_tables_get()
# has the following arguments:
#
# ga_lookup_tables_get
# ( tables )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING sa_tables[32](VIRTUAL)
INTEGER i_ntables
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the number of LUTs present in the database
i_return_value = @
ga_lookup_ntables_get @
( i_ntables )
SYS_ALLOCATE_ARRAY(sa_tables,1,i_ntables)
# Get the list of LUTs present in the database
i_return_value = @
ga_lookup_tables_get @
( sa_tables )
dump i_return_value
dump sa_tables
SYS_FREE_ARRAY(sa_tables)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_node_deform_create | () |
# Purpose : This file provides an example of a call to the
# function ga_node_deform_create()
#
# This function creates a node deformation table.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
#
# 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 ga_node_deform_create()
# has the following arguments:
#
# ga_node_deform_create
# ( title,
# nbr_nodes,
# node_ids,
# deform,
# id )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_title[80]
INTEGER i_nbr_nodes
INTEGER i_ncases, iv_lcids(VIRTUAL),iv_nsub(VIRTUAL)
INTEGER iv_node_ids(VIRTUAL)
REAL rv_deform(VIRTUAL)
INTEGER i_dtype,ia_minloc(6),ia_maxloc(6), ia_resids(5)
INTEGER i_id
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the deformation results
sf_play(“spool_res_deform.ses”)
# Get the number of Load cases and their IDs
i_return_value = @
res_utl_get_loadcases(i_ncases,iv_lcids,iv_nsub)
dump i_return_value
dump i_ncases,iv_lcids,iv_nsub
# Extract the deformation results from the database
# Load case ID = iv_lcids(1)
# Sub case ID = 1
# Primary Result ID = 2 ( Corresponds to deformation )
# Secondary Result ID = 1
# Layer ID = 1
# node_list = “Node 1:#” (All nodes )
# derivation = ““
# coord_id = ““
ia_resids(1) = iv_lcids(1)
ia_resids(2) = 1
ia_resids(3) = 2
ia_resids(4) = 1
ia_resids(5) = 1
i_return_value = @
res_utl_extract_nodal_results(ia_resids,” Node 1:#”,””,””, @
i_dtype,i_nbr_nodes,iv_node_ids,rv_deform,ia_minloc,ia_maxloc)
dump i_return_value
# Create a node deformation table
s_title =” Deformation Result”
i_return_value = @
ga_node_deform_create @
( s_title, @
i_nbr_nodes, @
iv_node_ids, @
rv_deform, @
i_id )
dump i_return_value, i_id
i_return_value = @
ga_group_node_deform_set @
( “fem_model”, @
i_id )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_range_contour_get | () |
# Purpose : This file provides an example of a call to the
# function ga_range_contour_get()
#
# In this file first the number of ranges and
# the list of ranges in the database are found.
# Then it is found whether the first range is
# will be displayed using contour values or
# fringe values (display type flag).
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_contour_get() has the following arguments:
#
# ga_range_contour_get
# ( name,
# flag )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sav_ranges[32](VIRTUAL)
INTEGER i_flag, i_nranges
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value
# Number of ranges
dump i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value
# List of ranges
dump sav_ranges
# Get the display type flag of the first range
s_name = sav_ranges(1)
i_return_value = @
ga_range_contour_get @
( s_name, @
i_flag )
dump i_return_value
# Display type flag
# Flag = 1 if contour values are displayed
# Flag = 0 if fringe values are displayed
dump i_flag
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_contour_set | () |
# Purpose : This file provides an example of two calls
# to the function ga_range_contour_set()
#
# In this file first the number of ranges and
# the list of ranges in the database are found.
# The display type flag( whether the range
# will be displayed using contour values or
# fringe values) of the first range is saved.
# It is set to display using contour values.
# It is inspected and the saved value is reset.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_contour_set() has the following arguments:
#
# ga_range_contour_set
# ( name,
# flag )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sav_ranges[32](VIRTUAL)
INTEGER i_flag, i_old_flag, i_nranges
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value
# Number of ranges
dump i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value
# List of ranges
dump sav_ranges
s_name = sav_ranges(1)
# Get the display type flag for the first range.
i_flag = 0
i_return_value = @
ga_range_contour_get @
( s_name, @
i_old_flag )
dump i_return_value, i_old_flag
# Toggle the display type flag for the first range.
i_flag = 1 - i_old_flag
i_return_value = @
ga_range_contour_set @
( s_name, @
i_flag )
dump i_return_value
# Get the display type flag for the first range.
i_flag = 0
i_return_value = @
ga_range_contour_get @
( s_name, @
i_flag )
dump i_return_value, i_flag
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the old display type flag for the first range.
i_flag = i_old_flag
i_return_value = @
ga_range_contour_set @
( s_name, @
i_flag )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_create |
# Purpose : This file provides an example of a call to the
# function ga_range_create()
#
# In this file a range is created and it’s
# sub-ranges are set using start and end values.
# The sub-range values are displayed and finally
# the range is deleted.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_create() has the following arguments:
#
# ga_range_create
# ( name,
# number )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],s_old_name[32]
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges
INTEGER i_number
REAL r_start,r_end
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
s_old_name = sav_ranges(1)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Create a new range
s_name = “New Range”
i_number = 15
i_return_value = @
ga_range_create @
( s_name, @
i_number )
dump i_return_value
# Set the subranges using start and end values
r_start = 100000
r_end = 0
i_return_value = @
ga_range_startend_set @
( s_name, @
r_start, @
r_end )
# Post the range
ga_viewport_range_set(““,s_name)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_free_array(sav_ranges)
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Session file paused. Press “Resume” to continue..
sf_pause()
# Post the old range
ga_viewport_range_set(““,s_old_name)
# Delete the range
i_return_value = @
ga_range_delete @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_delete | () |
# Purpose : This file provides an example of a call to the
# function ga_range_delete()
#
# In this file a range is created and it’s
# sub-ranges are set using start and end values
# the sub-range values are displayed and finally
# the range is deleted.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_delete() has the following arguments:
# ga_range_delete
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],s_old_name[32]
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges
INTEGER i_number
REAL r_start,r_end
REAL ra_from(15),ra_to(15),ra_mid(15)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
s_old_name = sav_ranges(1)
# Create a new range
s_name = “New Range”
i_number = 15
i_return_value = @
ga_range_create @
( s_name, @
i_number )
dump i_return_value
# Set the subranges using start and end values
r_start = 100000
r_end = 0
i_return_value = @
ga_range_startend_set @
( s_name, @
r_start, @
r_end )
# Post the range
ga_viewport_range_set(““,s_name)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_free_array(sav_ranges)
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Session file paused. Press “Resume” to continue..
sf_pause()
# Post the old range
ga_viewport_range_set(““,s_old_name)
# Delete the new range
i_return_value = @
ga_range_delete @
( s_name )
dump i_return_value
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_exist_get | () |
# Purpose : This file provides an example of two calls
# to the function ga_range_exist_get()
#
# In this file first the number of ranges and
# the list of ranges in the database are found.
# Then it is tested whether the first range is
# existing. Then a non existing name is passed
# and the return flag is checked.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_exist_get()
# has the following arguments:
#
# ga_range_exist_get
# ( name,
# flag )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
INTEGER i_flag
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Check for the existence of the first range
s_name = sav_ranges(1)
i_return_value = @
ga_range_exist_get @
( s_name, @
i_flag )
dump i_return_value, i_flag
# Check for the existence of a non existing range
s_name = “Non existing range”
i_return_value = @
ga_range_exist_get @
( s_name, @
i_flag )
dump i_return_value, i_flag
#---------------------------------------------------------------------
ga_range_nranges_get | () |
# Purpose : This file provides an example of a call to the
# function ga_range_nranges_get()
#
# In this file the number of ranges in the
# database are found.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_nranges_get()
# has the following arguments:
#
# ga_range_nranges_get
# ( nranges )
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_nranges
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_range_nvalues_get | () |
# Purpose : This file provides an example of a call to the
# function ga_range_nvalues_get()
#
# In this file first the number of ranges and
# the list of ranges in the database are found.
# Then the number of sub-ranges defined in the
# first range is found.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_nvalues_get() has the following arguments:
#
# ga_range_nvalues_get
# ( name,
# number )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
INTEGER i_number
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Get the number of sub-ranges in the first range
s_name = sav_ranges(1)
i_return_value = @
ga_range_nvalues_get @
( s_name, @
i_number )
dump i_return_value, i_number
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_ranges_get | () |
# Purpose : This file provides an example of a call to the
# function ga_range_ranges_get()
#
# In this file the number of ranges and then
# the list of ranges in the database are found.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_ranges_get()
# has the following arguments:
#
# ga_range_ranges_get
# ( ranges )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_rename | () |
# Purpose : This file provides an example of two calls
# to the function ga_range_rename()
#
# In this file first the number of ranges and
# the list of ranges in the database are found.
# Then the name of the the first range is
# saved and it is renamed, finally restoring
# it’s name.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_rename() has the following arguments:
#
# ga_range_rename
# ( old_name,
# new_name )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],s_old_name[32], s_new_name[32]
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Session file paused. Press “Resume” to continue..
sf_pause()
# Save the first range name
s_name = sav_ranges(1)
# Rename the first range
s_old_name = sav_ranges(1)
s_new_name = “New Name”
i_return_value = @
ga_range_rename @
( s_old_name, @
s_new_name )
dump i_return_value
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Paused. Press resume to continue..
sf_pause()
# Restore the name of the first range
s_old_name = sav_ranges(1)
s_new_name = s_name
i_return_value = @
ga_range_rename @
( s_old_name, @
s_new_name )
dump i_return_value
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_startend_set | () |
# Purpose : This file provides an example of a call to the
# function ga_range_startend_set()
#
# In this file first the number of ranges and
# the list of ranges in the database are found.
# Then the sub-ranges in the first range are
# found. The sub-ranges are set using start and
# end values and are displayed.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_startend_set()
# has the following arguments:
#
# ga_range_startend_set
# ( name,
# start,
# end )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL r_start, r_end
REAL ra_from(VIRTUAL),ra_to(VIRTUAL),ra_mid(VIRTUAL)
REAL ra_old_from(VIRTUAL),ra_old_to(VIRTUAL),ra_old_mid(VIRTUAL)
INTEGER i_number
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Get the number of sub-ranges in the first range
s_name = sav_ranges(1)
i_return_value = @
ga_range_nvalues_get @
( s_name, @
i_number )
dump i_return_value, i_number
sys_allocate_array(ra_from,1,i_number)
sys_allocate_array(ra_to,1,i_number)
sys_allocate_array(ra_mid,1,i_number)
sys_allocate_array(ra_old_from,1,i_number)
sys_allocate_array(ra_old_to,1,i_number)
sys_allocate_array(ra_old_mid,1,i_number)
# Get the sub-ranges in the first range
i_return_value = @
ga_range_values_get @
( s_name, @
ra_old_from, @
ra_old_to, @
ra_old_mid )
dump i_return_value,ra_old_from,ra_old_to,ra_old_mid
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the sub-ranges taking start and end
r_start = 100000
r_end = 0
i_return_value = @
ga_range_startend_set @
( s_name, @
r_start, @
r_end )
dump i_return_value
# Get the sub-ranges in the first range
i_return_value = @
ga_range_values_get @
( s_name, @
ra_from, @
ra_to, @
ra_mid )
dump i_return_value,ra_from,ra_to,ra_mid
# Session file paused. Press “Resume” to continue..
sf_pause()
# Reset the sub-ranges in the first range to the old values
i_return_value = @
ga_range_values_set @
( s_name, @
ra_old_from, @
ra_old_to, @
ra_old_mid )
dump i_return_value
# Close the database “spool.db”
uil_file_close.go()
sys_free_array(ra_from)
sys_free_array(ra_to)
sys_free_array(ra_mid)
sys_free_array(ra_old_from)
sys_free_array(ra_old_to)
sys_free_array(ra_old_mid)
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_threshold_set | () |
# Purpose : This file provides an example of a call to the
# function ga_range_threshold_set()
#
# In this file first the number of ranges and
# the list of ranges in the database are found.
# Then the sub_ranges in the first range are
# found. The sub-ranges are set using start,
# end and threshold values and are shown.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_threshold_set() has the following arguments:
#
# ga_range_threshold_set
# ( name,
# start,
# end,
# sthf,
# sth,
# ethf,
# eth )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sav_ranges[32](VIRTUAL)
REAL r_start, r_end, r_sth, r_eth
INTEGER i_sthf, i_ethf
REAL ra_from(VIRTUAL),ra_to(VIRTUAL),ra_mid(VIRTUAL)
REAL ra_old_from(VIRTUAL),ra_old_to(VIRTUAL),ra_old_mid(VIRTUAL)
INTEGER i_number
INTEGER i_nranges
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Get the number of sub-ranges in the first range
s_name = sav_ranges(1)
i_return_value = @
ga_range_nvalues_get @
( s_name, @
i_number )
dump i_return_value, i_number
sys_allocate_array(ra_from,1,i_number)
sys_allocate_array(ra_to,1,i_number)
sys_allocate_array(ra_mid,1,i_number)
sys_allocate_array(ra_old_from,1,i_number)
sys_allocate_array(ra_old_to,1,i_number)
sys_allocate_array(ra_old_mid,1,i_number)
# Get the sub-ranges in the first range
i_return_value = @
ga_range_values_get @
( s_name, @
ra_old_from, @
ra_old_to, @
ra_old_mid )
dump i_return_value,ra_old_from,ra_old_to,ra_old_mid
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the sub-ranges taking start, end and start thresholds
r_start = 100000.0
r_end = 0
i_sthf = 1
r_sth = 10000.0
i_ethf = 1
r_eth = 0.0
ga_viewport_range_set(““,s_name)
i_return_value = @
ga_range_threshold_set @
( s_name, @
r_start, @
r_end, @
i_sthf, @
r_sth, @
i_ethf, @
r_eth )
dump i_return_value
# Get the sub-ranges in the first range
i_return_value = @
ga_range_values_get @
( s_name, @
ra_from, @
ra_to, @
ra_mid )
dump i_return_value,ra_from,ra_to,ra_mid
# Session file paused. Press “Resume” to continue..
sf_pause()
# Reset the sub-ranges in the first range to the old values
i_return_value = @
ga_range_values_set @
( s_name, @
ra_old_from, @
ra_old_to, @
ra_old_mid )
dump i_return_value
# Close the database “spool.db”
uil_file_close.go()
sys_free_array(ra_from)
sys_free_array(ra_to)
sys_free_array(ra_mid)
sys_free_array(ra_old_from)
sys_free_array(ra_old_to)
sys_free_array(ra_old_mid)
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_values_get | () |
# Purpose : This file provides an example of a call to the
# function ga_range_values_get()
#
# In this file first the number of ranges and
# the list of ranges in the database are found.
# Then the number of sub-ranges in the first
# range and then the sub-ranges are found.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_values_get() has the following arguments:
#
# ga_range_values_get
# ( name,
# from,
# to,
# mid )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL ra_from(VIRTUAL),ra_to(VIRTUAL),ra_mid(VIRTUAL)
INTEGER i_number
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Get the number of sub-ranges in the first range
s_name = sav_ranges(1)
i_return_value = @
ga_range_nvalues_get @
( s_name, @
i_number )
dump i_return_value, i_number
sys_allocate_array(ra_from,1,i_number)
sys_allocate_array(ra_to,1,i_number)
sys_allocate_array(ra_mid,1,i_number)
# Get the sub-ranges in the first range
i_return_value = @
ga_range_values_get @
( s_name, @
ra_from, @
ra_to, @
ra_mid )
dump i_return_value,ra_from,ra_to,ra_mid
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
sys_free_array(ra_from)
sys_free_array(ra_to)
sys_free_array(ra_mid)
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_values_set | () |
# Purpose : This file provides two calls to the
# function ga_range_values_set()
#
# In this file first the number of ranges and
# the list of ranges in the database are found.
# Then the sub-ranges in the first range are
# found. Then theses ranges are set and the
# modified sub-ranges are displayed.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_values_set() has the following arguments:
#
# ga_range_values_set
# ( name,
# from,
# to,
# mid )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL ra_from(VIRTUAL),ra_to(VIRTUAL),ra_mid(VIRTUAL)
REAL ra_old_from(VIRTUAL),ra_old_to(VIRTUAL),ra_old_mid(VIRTUAL)
INTEGER i_number
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges, i_index
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
# Get the number of sub-ranges in the first range
s_name = sav_ranges(1)
i_return_value = @
ga_range_nvalues_get @
( s_name, @
i_number )
dump i_return_value, i_number
sys_allocate_array(ra_from,1,i_number)
sys_allocate_array(ra_to,1,i_number)
sys_allocate_array(ra_mid,1,i_number)
sys_allocate_array(ra_old_from,1,i_number)
sys_allocate_array(ra_old_to,1,i_number)
sys_allocate_array(ra_old_mid,1,i_number)
# Get the sub-ranges in the first range
i_return_value = @
ga_range_values_get @
( s_name, @
ra_old_from, @
ra_old_to, @
ra_old_mid )
dump i_return_value,ra_old_from,ra_old_to,ra_old_mid
# Session file paused. Press “Resume” to continue..
sf_pause()
FOR(i_index= 1 TO i_number)
ra_from(i_index) = (i_index-1) * 10000
ra_to(i_index) = (i_index) * 10000
ra_mid(i_index) = (ra_from(i_index) + ra_to(i_index))/2.0
END FOR
# Set the sub-ranges in the first range
i_return_value = @
ga_range_values_set @
( s_name, @
ra_from, @
ra_to, @
ra_mid )
dump i_return_value
# Clear the arrays
FOR(i_index= 1 TO i_number)
ra_from(i_index) = 0.0
ra_to(i_index) = 0.0
ra_mid(i_index) = 0.0
END FOR
# Get the sub-ranges in the first range
i_return_value = @
ga_range_values_get @
( s_name, @
ra_from, @
ra_to, @
ra_mid )
dump i_return_value,ra_from,ra_to,ra_mid
# Session file paused. Press “Resume” to continue..
sf_pause()
# Reset the sub-ranges in the first range to old values
i_return_value = @
ga_range_values_set @
( s_name, @
ra_old_from, @
ra_old_to, @
ra_old_mid )
dump i_return_value
# Close the database “spool.db”
uil_file_close.go()
sys_free_array(ra_from)
sys_free_array(ra_to)
sys_free_array(ra_mid)
sys_free_array(ra_old_from)
sys_free_array(ra_old_to)
sys_free_array(ra_old_mid)
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_spectrum_colors_get | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_colors_get()
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_colors_get()
# has the following arguments:
#
# ga_spectrum_colors_get
# ( name,
# colors )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
INTEGER iv_colors(VIRTUAL)
INTEGER i_return_value
INTEGER i_number
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
# Get the number of colors in the current spectrum
i_return_value = @
ga_spectrum_ncolors_get @
( s_name, @
i_number)
dump i_return_value
dump i_number
sys_allocate_array(iv_colors,1,i_number)
# Get the colors in the current spectrum
i_return_value = @
ga_spectrum_colors_get @
( s_name, @
iv_colors )
dump i_return_value
dump iv_colors
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(iv_colors)
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_colors_set | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_colors_set()
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_colors_set()
# has the following arguments:
#
# ga_spectrum_colors_set
# ( name,
# offset,
# number,
# colors )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
INTEGER iv_old_colors(VIRTUAL),ia_colors(16)
INTEGER i_old_number,i_number
INTEGER i_offset
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
# Get the number of colors in the current spectrum
i_return_value = @
ga_spectrum_ncolors_get @
( s_name, @
i_old_number)
dump i_return_value
dump i_old_number
sys_allocate_array(iv_old_colors,1,i_old_number)
# Get the colors in the current spectrum
i_return_value = @
ga_spectrum_colors_get @
( s_name, @
iv_old_colors )
dump i_return_value
dump iv_old_colors
# Set the colors in the current spectrum
i_offset =0
i_number =16
ia_colors =[0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_colors_set @
( s_name, @
i_offset, @
i_number, @
ia_colors )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the original colors in the current spectrum
i_offset =0
i_number =i_old_number
i_return_value = @
ga_spectrum_colors_set @
( s_name, @
i_offset, @
i_number, @
iv_old_colors )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_continuous_get | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_continuous_get()
#
# This function is used to get the continuous
# tone flag of a spectrum.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_continuous_get()
# has the following arguments:
#
# ga_spectrum_continuous_get
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
INTEGER i_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
# Get the continuous tone flag of the current spectrum
i_return_value = @
ga_spectrum_continuous_get @
( s_name, @
i_value )
dump i_return_value
dump i_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_continuous_set | () |
# Purpose : This file provides an example of two calls to
# the function ga_spectrum_continuous_set().
#
# This function is used to set the continuous
# tone flag of a spectrum.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_continuous_set()
# has the following arguments:
#
# ga_spectrum_continuous_set
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
INTEGER i_old_value,i_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
# Get the continuous tone flag of the current spectrum
i_return_value = @
ga_spectrum_continuous_get @
( s_name, @
i_old_value )
dump i_return_value
dump i_old_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the continuous tone flag of the current spectrum
i_value = 1
i_return_value = @
ga_spectrum_continuous_set @
( s_name, @
i_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the continuous tone flag of the current spectrum to it’s
# old value
i_value = i_old_value
i_return_value = @
ga_spectrum_continuous_set @
( s_name, @
i_value )
dump i_return_value
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_create | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_create()
#
# This function is used to create a spectrum.
# In this file first the current spectrum is
# saved, then a new spectrum is created and
# made current, finally restoring the original
# spectrum and deleting the new spectrum.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_create() has the following arguments:
#
# ga_spectrum_create
# ( name,
# number,
# colors )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_old_name[32],s_name[32]
STRING sav_spectrums[32](VIRTUAL)
INTEGER i_nspectrums
INTEGER i_number
INTEGER ia_colors(16)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of spectrums in the database
i_return_value = @
ga_spectrum_nspectrums_get @
( i_nspectrums )
dump i_return_value
dump i_nspectrums
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_old_name )
dump i_return_value
# Create a spectrum
s_name = “new_spectrum”
i_number = 16
ia_colors= [0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_create @
( s_name, @
i_number, @
ia_colors )
dump i_return_value
# Make the new spectrum as current spectrum
i_return_value = @
ga_spectrum_current_set @
( s_name )
# Get the number of spectrums in the database
i_return_value = @
ga_spectrum_nspectrums_get @
( i_nspectrums )
dump i_return_value
dump i_nspectrums
sys_free_array(sav_spectrums)
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
# Session file paused. Press “Resume” to continue..
sf_pause()
# Restore the old spectrum
i_return_value = @
ga_spectrum_current_set @
( s_old_name )
# Delete the created spectrum
i_return_value = @
ga_spectrum_delete @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_spectrums)
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_current_get | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_current_get()
#
# This function is used to get the current
# spectrum.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_current_get()
# has the following arguments:
#
# ga_spectrum_current_get
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_current_set | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_current_set()
#
# This function is used to set the current
# spectrum.
# In this file first the current spectrum is
# saved, then a new spectrum is created and
# made current, finally restoring the original
# spectrum and deleting the new spectrum.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_current_set()
# has the following arguments:
#
# ga_spectrum_current_set
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_old_name[32],s_name[32]
INTEGER i_number
INTEGER ia_colors(16)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_old_name )
dump i_return_value
# Create a spectrum
s_name = “new_spectrum”
i_number = 16
ia_colors= [0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_create @
( s_name, @
i_number, @
ia_colors )
dump i_return_value
# Make the new spectrum as current spectrum
i_return_value = @
ga_spectrum_current_set @
( s_name )
# Session file paused. Press “Resume” to continue..
sf_pause()
# Restore the old spectrum
i_return_value = @
ga_spectrum_current_set @
( s_old_name )
# Delete the created spectrum
i_return_value = @
ga_spectrum_delete @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_delete | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_delete()
#
# This function is used to delete a spectrum.
# In this file first the current spectrum is
# saved, then a new spectrum is created and
# made current, finally restoring the original
# spectrum and deleting the new spectrum.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_delete()
# has the following arguments:
#
# ga_spectrum_delete
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_old_name[32],s_name[32]
STRING sav_spectrums[32](VIRTUAL)
INTEGER i_nspectrums
INTEGER i_number
INTEGER ia_colors(16)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_old_name )
dump i_return_value
# Create a spectrum
s_name = “new_spectrum”
i_number = 16
ia_colors= [0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_create @
( s_name, @
i_number, @
ia_colors )
dump i_return_value
# Make the new spectrum as current spectrum
i_return_value = @
ga_spectrum_current_set @
( s_name )
# Get the number of spectrums in the database
i_return_value = @
ga_spectrum_nspectrums_get @
( i_nspectrums )
dump i_return_value
dump i_nspectrums
sys_allocate_array(sav_spectrums,1,i_nspectrums)
# Get the list of spectrums in the database
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
# Session file paused. Press “Resume” to continue..
sf_pause()
# Restore the old spectrum
i_return_value = @
ga_spectrum_current_set @
( s_old_name )
# Delete the created spectrum
i_return_value = @
ga_spectrum_delete @
( s_name )
dump i_return_value
# Get the number of spectrums in the database
i_return_value = @
ga_spectrum_nspectrums_get @
( i_nspectrums )
dump i_return_value
dump i_nspectrums
sys_free_array(sav_spectrums)
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_spectrums)
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_interpolation_get | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_interpolation_get()
#
# This function is used to get the interpolation
# factor of a spectrum.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_interpolation_get()
# has the following arguments:
#
# ga_spectrum_interpolation_get
# ( name,
# factor )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL r_factor
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
# Get the interpolation factor of the current spectrum
i_return_value = @
ga_spectrum_interpolation_get @
( s_name, @
r_factor )
dump i_return_value
dump r_factor
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_interpolation_set | () |
# Purpose : This file provides an example of two calls to
# the function ga_spectrum_interpolation_set()
#
# This function is used to set the interpolation
# factor of a spectrum.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_interpolation_set()
# has the following arguments:
#
# ga_spectrum_interpolation_set
# ( name,
# factor )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL r_old_factor,r_factor
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
# Get the interpolation factor of the current spectrum
i_return_value = @
ga_spectrum_interpolation_get @
( s_name, @
r_old_factor )
dump i_return_value
dump r_old_factor
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the interpolation factor of the current spectrum
r_factor = 4.0
i_return_value = @
ga_spectrum_interpolation_set @
( s_name, @
r_factor )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the interpolation factor of the current spectrum to it’s
# old value
r_factor = r_old_factor
i_return_value = @
ga_spectrum_interpolation_set @
( s_name, @
r_factor )
dump i_return_value
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_ncolors_get | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_ncolors_get()
#
# This function is used to get the number of
# colors in a given spectrum.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_ncolors_get()
# has the following arguments:
#
# ga_spectrum_ncolors_get
# ( name,
# number )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
INTEGER i_number
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the name of the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value, s_name
# Get the number of colors in the current spectrum
i_return_value = @
ga_spectrum_ncolors_get @
( s_name, @
i_number )
dump i_return_value,i_number
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_nspectrums_get | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_nspectrums_get()
#
# This function is used to get the number of
# spectrums in the database.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_nspectrums_get()
# has the following arguments:
#
# ga_spectrum_nspectrums_get
# ( nspectrums )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_nspectrums
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of spectrums in the database
i_return_value = @
ga_spectrum_nspectrums_get @
( i_nspectrums )
dump i_return_value
dump i_nspectrums
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_rename | () |
# Purpose : This file provides an example of two calls
# to the function ga_spectrum_rename()
#
# This function is used to rename a spectrum.
# In this file first the current spectrum is
# found and it is renamed, finally restoring
# it’s name.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_rename()
# has the following arguments:
#
# ga_spectrum_rename
# ( old_name,
# new_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32], s_old_name[32], s_new_name[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
# Session file paused. Press “Resume” to continue..
sf_pause()
# Rename the current spectrum
s_old_name = s_name
s_new_name = “new_spectrum_name”
i_return_value = @
ga_spectrum_rename @
( s_old_name, @
s_new_name )
dump i_return_value
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
# Session file paused. Press “Resume” to continue..
sf_pause()
# Restore the spectrum name
s_new_name = s_old_name
s_old_name = s_name
i_return_value = @
ga_spectrum_rename @
( s_old_name, @
s_new_name )
dump i_return_value
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_spectrums_get | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_spectrums_get()
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_spectrums_get()
# has the following arguments:
#
# ga_spectrum_spectrums_get
# ( spectrums )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_nspectrums
STRING sav_spectrums[32](VIRTUAL)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of spectrums in the database
i_return_value = @
ga_spectrum_nspectrums_get @
( i_nspectrums )
dump i_return_value
dump i_nspectrums
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_spectrums)
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_color_get | () |
# Purpose : This file provides an example of a call to the
# function ga_title_color_get()
#
# This function is used to get the color of
# a title.
# In this file first the number of the titles
# posted and then the list of titles are found.
# The color of the first title posted is get.
#
# 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 ga_title_color_get()
# has the following arguments:
#
# ga_title_color_get
# ( name,
# color )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[256]
STRING sav_list[256](VIRTUAL)
INTEGER i_posted
INTEGER i_color
INTEGER i_return_value
#---------------------------------------------------------------------
# This file opens the database “new.db” and creates some titles
sf_play(“titles.ses”)
# Get the number of titles posted
i_return_value = @
ga_title_nposted_get @
( i_posted )
dump i_return_value
dump i_posted
sys_allocate_array(sav_list,1,i_posted)
# Get the list of titles posted
i_return_value = @
ga_title_posted_get @
( sav_list )
dump i_return_value
dump sav_list
# Get the color of the first title posted
s_name = sav_list(1)
i_return_value = @
ga_title_color_get @
( s_name, @
i_color )
dump i_return_value
dump i_color
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_list)
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_color_set | () |
# Purpose : This file provides an example of two calls
# to the function ga_title_color_set()
#
# This function is used to set the color of
# a title.
#
# In this file first the number of the titles
# posted and then the list of titles are found.
# The color of the first title posted is set.
#
# 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 ga_title_color_set()
# has the following arguments:
#
# ga_title_color_set
# ( name,
# color )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[256]
STRING sav_list[256](VIRTUAL)
INTEGER i_posted
INTEGER i_index
INTEGER i_color
INTEGER i_return_value
#---------------------------------------------------------------------
# This file opens the database “new.db” and creates some titles
sf_play(“titles.ses”)
# Get the number of titles posted
i_return_value = @
ga_title_nposted_get @
( i_posted )
dump i_return_value
dump i_posted
sys_allocate_array(sav_list,1,i_posted)
# Get the list of titles posted
i_return_value = @
ga_title_posted_get @
( sav_list )
dump i_return_value
dump sav_list
# Change the color of the first title posted
s_name = sav_list(1)
dump s_name
i_color = 1
i_return_value = @
ga_title_color_set @
( s_name, @
i_color )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Change the color of the first title posted
s_name = sav_list(1)
dump s_name
i_color = 4
i_return_value = @
ga_title_color_set @
( s_name, @
i_color )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_list)
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_create | () |
# Purpose : This file provides an example of a call to the
# function ga_title_create()
#
# This function is used to create a title.
# In this file a title is created, posted to the
# current viewport, and finally deleted.
#
# 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 ga_title_create()
# has the following arguments:
#
# ga_title_create
# ( name,
# x,
# y,
# color,
# font_size )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL r_x
REAL r_y
INTEGER i_color
INTEGER i_font_size
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “new.db”
uil_file_open.go(“new.db”)
# Create a title at the centre
s_name = “New Title”
r_x = 50
r_y = 50
i_color = 1
# Choose 12 point Font
i_font_size = 2
i_return_value = @
ga_title_create @
( s_name, @
r_x, @
r_y, @
i_color, @
i_font_size )
dump i_return_value
# Post the title to the current viewport
i_return_value = @
ga_viewport_title_post @
( ““, @
s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the title created
i_return_value = @
ga_title_delete @
( s_name )
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_delete | () |
# Purpose : This file provides an example of a call to the
# function ga_title_delete()
#
# This function is used to delete a title.
# In this file a title is created, posted to the
# current viewport, and finally deleted.
#
# 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 ga_title_delete() has the following arguments:
#
# ga_title_delete
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL r_x
REAL r_y
INTEGER i_color
INTEGER i_font_size
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “new.db”
uil_file_open.go(“new.db”)
# Create a title at the centre
s_name = “New Title”
r_x = 50
r_y = 50
i_color = 7
# Choose 12 point Font
i_font_size = 2
i_return_value = @
ga_title_create @
( s_name, @
r_x, @
r_y, @
i_color, @
i_font_size )
dump i_return_value
# Post the title to the current viewport
i_return_value = @
ga_viewport_title_post @
( ““, @
s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the title created
i_return_value = @
ga_title_delete @
( s_name )
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_font_size_get | () |
# Purpose : This file provides an example of a call to the
# function ga_title_font_size_get()
#
# This function is used to get the font size of
# a title.
#
# In this file first the number of the titles
# posted and then the list of titles are found.
# The font size of the first title posted is get.
#
# 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 ga_title_font_size_get()
# has the following arguments:
#
# ga_title_font_size_get
# ( name,
# font_size )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[256]
STRING sav_list[256](VIRTUAL)
INTEGER i_posted
INTEGER i_size
INTEGER i_return_value
#---------------------------------------------------------------------
# This file opens the database “new.db” and creates some titles
sf_play(“titles.ses”)
# Get the number of titles posted
i_return_value = @
ga_title_nposted_get @
( i_posted )
dump i_return_value
dump i_posted
sys_allocate_array(sav_list,1,i_posted)
# Get the list of titles posted
i_return_value = @
ga_title_posted_get @
( sav_list )
dump i_return_value
dump sav_list
# Get the font_size of the first title posted
s_name = sav_list(1)
i_return_value = @
ga_title_font_size_get @
( s_name, @
i_size )
dump i_return_value
dump i_size
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_list)
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_font_size_set | () |
# Purpose : This file provides an example of two calls
# to the function ga_title_font_size_set()
#
# This function is used to set the font size of
# a title.
#
# In this file first the number of the titles
# posted and then the list of titles are found.
# The font size of the first title posted is set.
#
# 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 ga_title_font_size_set()
# has the following arguments:
#
# ga_title_font_size_set
# ( name,
# font_size )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[256]
STRING sav_list[256](VIRTUAL)
INTEGER i_posted
INTEGER i_size
INTEGER i_return_value
#---------------------------------------------------------------------
# This file opens the database “new.db” and creates some titles
sf_play(“titles.ses”)
# Get the number of titles posted
i_return_value = @
ga_title_nposted_get @
( i_posted )
dump i_return_value
dump i_posted
sys_allocate_array(sav_list,1,i_posted)
# Get the list of titles posted
i_return_value = @
ga_title_posted_get @
( sav_list )
dump i_return_value
dump sav_list
# Session file paused. Press “Resume” to continue...
sf_pause()
# Change the font_size of the first title posted
s_name = sav_list(1)
dump s_name
i_size = 2
i_return_value = @
ga_title_font_size_set @
( s_name, @
i_size )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Change the font_size of the first title posted
s_name = sav_list(1)
dump s_name
i_size = 4
i_return_value = @
ga_title_font_size_set @
( s_name, @
i_size )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_list)
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_list_get | () |
# Purpose : This file provides an example of a call to the
# function ga_title_list_get()
#
# This function is used to get the list of
# “Titles” in the database.
# In this file first the number of titles in the
# database is found and then the list of titles
# is found.
#
# 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 ga_title_list_get()
# has the following arguments:
#
# ga_title_list_get
# ( list )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING sav_list[256](VIRTUAL)
INTEGER i_ntitles
INTEGER i_return_value
#---------------------------------------------------------------------
# This file opens the database “new.db” and creates some titles
sf_play(“titles.ses”)
# Get the number of titles in the database
i_return_value = @
ga_title_num_get @
( i_ntitles )
dump i_return_value
dump i_ntitles
sys_allocate_array(sav_list,1,i_ntitles)
# Get the list of the titles in the database
i_return_value = @
ga_title_list_get @
( sav_list )
dump i_return_value
dump sav_list
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_list)
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_loc_get | () |
# Purpose : This file provides an example of a call to the
# function ga_title_loc_get()
#
# This function is used to get the location of
# a title.
#
# In this file first the number of the titles
# posted and then the list of titles are found.
# The location of the first title posted is get.
#
# 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 ga_title_loc_get()
# has the following arguments:
#
# ga_title_loc_get
# ( name,
# x_pcnt,
# y_pcnt )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[256]
STRING sav_list[256](VIRTUAL)
INTEGER i_posted
REAL r_xpcnt,r_ypcnt
INTEGER i_return_value
#---------------------------------------------------------------------
# This file opens the database “new.db” and creates some titles
sf_play(“titles.ses”)
# Get the number of titles posted
i_return_value = @
ga_title_nposted_get @
( i_posted )
dump i_return_value
dump i_posted
sys_allocate_array(sav_list,1,i_posted)
# Get the list of titles posted
i_return_value = @
ga_title_posted_get @
( sav_list )
dump i_return_value
dump sav_list
# Get the location of the first title posted
s_name = sav_list(1)
i_return_value = @
ga_title_loc_get @
( s_name, @
r_xpcnt, @
r_ypcnt )
dump i_return_value
# The location of first title in percentage is
dump r_xpcnt, r_ypcnt
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_list)
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_loc_set | () |
# Purpose : This file provides an example of two calls
# to the function ga_title_loc_set()
#
# This function is used to set the location of
# a title.
#
# In this file first the number of the titles
# posted and then the list of titles are found.
# The location of the first title posted is set.
#
# 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 ga_title_loc_set()
# has the following arguments:
#
# ga_title_loc_set
# ( name,
# xpcnt,
# ypcnt )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[256]
STRING sav_list[256](VIRTUAL)
INTEGER i_posted
INTEGER i_index
REAL r_xpcnt,r_ypcnt
INTEGER i_return_value
#---------------------------------------------------------------------
# This file opens the database “new.db” and creates some titles
sf_play(“titles.ses”)
# Get the number of titles posted
i_return_value = @
ga_title_nposted_get @
( i_posted )
dump i_return_value
dump i_posted
sys_allocate_array(sav_list,1,i_posted)
# Get the list of titles posted
i_return_value = @
ga_title_posted_get @
( sav_list )
dump i_return_value
dump sav_list
# Change the location of the first title posted to top left
s_name = sav_list(1)
dump s_name
r_xpcnt = 10
r_ypcnt = 10
i_return_value = @
ga_title_loc_set @
( s_name, @
r_xpcnt, @
r_ypcnt )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Change the location of the first title posted to bottom right
s_name = sav_list(1)
dump s_name
r_xpcnt = 90
r_ypcnt = 90
i_return_value = @
ga_title_loc_set @
( s_name, @
r_xpcnt, @
r_ypcnt )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_list)
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_nposted_get | () |
# Purpose : This file provides an example of a call to the
# function ga_title_nposted_get()
#
# This function is used to get the number of
# titles currently posted.
#
# 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 ga_title_nposted_get()
# has the following arguments:
#
# ga_title_nposted_get
# ( nposted )
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_nposted
INTEGER i_return_value
#---------------------------------------------------------------------
# This file opens the database “new.db” and creates some titles
sf_play(“titles.ses”)
i_return_value = @
ga_title_nposted_get @
( i_nposted )
dump i_return_value
dump i_nposted
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_num_get | () |
# Purpose : This file provides an example of a call to the
# function ga_title_num_get()
#
# This functuion is used to get the number of
# “Titles” in the database.
#
# 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 ga_title_num_get()
# has the following arguments:
#
# ga_title_num_get
# ( ntitles )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_ntitles
INTEGER i_return_value
#---------------------------------------------------------------------
# This file opens the database “new.db” and creates some titles
sf_play(“titles.ses”)
i_return_value = @
ga_title_num_get @
( i_ntitles )
dump i_return_value
dump i_ntitles
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_posted_get | () |
# Purpose : This file provides an example of a call to the
# function ga_title_posted_get()
#
# This function is used to get the list of
# titles currently posted.
# In this file first the number of titles posted
# is found and then the list of titles posted
# is found.
#
# 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 ga_title_posted_get()
# has the following arguments:
#
# ga_title_posted_get
# ( list )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING sav_list[256](VIRTUAL)
INTEGER i_posted
INTEGER i_return_value
#---------------------------------------------------------------------
# This file opens the database “new.db” and creates some titles
sf_play(“titles.ses”)
# Get the number of titles posted
i_return_value = @
ga_title_nposted_get @
( i_posted )
dump i_return_value
dump i_posted
sys_allocate_array(sav_list,1,i_posted)
# Get the list of titles posted
i_return_value = @
ga_title_posted_get @
( sav_list )
dump i_return_value
dump sav_list
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_list)
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_rename | () |
# Purpose : This file provides an example of a call to the
# function ga_title_rename()
#
# This function is used to rename a title.
# In this file a title is created, posted to the
# current viewport,renamed and finally deleted.
#
# 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 ga_title_rename()
# has the following arguments:
#
# ga_title_rename
# ( old_name,
# new_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],s_new_name[32],s_old_name[32]
REAL r_x
REAL r_y
INTEGER i_color
INTEGER i_font_size
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “new.db”
uil_file_open.go(“new.db”)
# Create a title near top left corner
s_name = “Old Title”
r_x = 5
r_y = 5
i_color = 1
# Choose 12 point Font
i_font_size = 2
i_return_value = @
ga_title_create @
( s_name, @
r_x, @
r_y, @
i_color, @
i_font_size )
dump i_return_value
# Post the title to the current viewport
i_return_value = @
ga_viewport_title_post @
( ““, @
s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Rename the newly created Title
s_old_name = s_name
s_new_name = “New Title”
i_return_value = @
ga_title_rename @
( s_old_name, @
s_new_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the title created
s_name = s_new_name
i_return_value = @
ga_title_delete @
( s_name )
# Close the database “new.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_vector_create | () |
# Purpose : This file provides an example of a call to the
# function ga_vector_create()
#
# This function is used to create a vector table.
# In this file the deformation results are read
# from the database and a table is created.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
#
# 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 ga_vector_create()
# has the following arguments:
#
# ga_vector_create
# ( title,
# comp_vect_flag,
# sym_flag,
# nvectors,
# vect_ent_types,
# vect_ent_ids,
# vect_locs,
# normals,
# vect_types,
# anchor_styles,
# vect_colors,
# sub_ids,
# id )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_title[32]
INTEGER i_ncases, i_nbr_nodes, i_index
INTEGER iv_lcids(VIRTUAL),iv_nsub(VIRTUAL), iv_node_ids(VIRTUAL)
REAL rv_deform(VIRTUAL)
INTEGER i_dtype,ia_minloc(6),ia_maxloc(6), ia_resids(5)
INTEGER i_comp_vect_flag,i_sym_flag,i_nvectors
INTEGER iv_vect_ent_types(VIRTUAL), iv_vect_ent_ids(VIRTUAL)
REAL rv_vect_locs(VIRTUAL)
INTEGER iv_vect_types(VIRTUAL), iv_anchor_styles(VIRTUAL)
INTEGER iv_vect_colors(VIRTUAL), iv_sub_ids(VIRTUAL)
INTEGER i_id, i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of Load cases and their IDs
i_return_value = @
res_utl_get_loadcases(i_ncases,iv_lcids,iv_nsub)
dump i_return_value
dump i_ncases,iv_lcids,iv_nsub
# Extract the stress results from the database
# Load case ID = iv_lcids(1)
# Sub case ID = 1
# Primary Result ID = 2 ( Corresponds to deformation )
# Secondary Result ID = 1
# Layer ID = 1
# node_list = “Node 1:#” (All nodes )
# derivation = ““
# coord_id = ““
ia_resids(1) = iv_lcids(1)
ia_resids(2) = 1
ia_resids(3) = 3
ia_resids(4) = 1
ia_resids(5) = 2
i_return_value = @
res_utl_extract_nodal_results(ia_resids,” Node 1:#”,””,””, @
i_dtype,i_nbr_nodes,iv_node_ids,rv_deform,ia_minloc,ia_maxloc)
dump i_return_value
# Create a vector table
s_title = “Vector Table”
i_comp_vect_flag = 0
i_sym_flag = 0
i_nvectors = i_nbr_nodes
sys_allocate_array(iv_vect_ent_types,1,i_nvectors)
sys_allocate_array(iv_vect_ent_ids,1,i_nvectors)
sys_allocate_array(rv_vect_locs,1,i_nvectors,1,3)
sys_allocate_array(iv_vect_types,1,i_nvectors)
sys_allocate_array(iv_anchor_styles,1,i_nvectors)
sys_allocate_array(iv_vect_colors,1,i_nvectors)
sys_allocate_array(iv_sub_ids,1,i_nvectors)
FOR(i_index = 1 TO i_nvectors)
iv_vect_ent_types(i_index) = 123 /* from dbtypes.h */
iv_vect_ent_ids(i_index) = iv_node_ids(i_index)
iv_vect_types(i_index) = 1
iv_anchor_styles(i_index) = 1
iv_vect_colors(i_index) = 0
iv_sub_ids(i_index) = 0
END FOR
i_return_value = @
ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
iv_vect_ent_types, @
iv_vect_ent_ids, @
rv_vect_locs, @
rv_deform, @
iv_vect_types, @
iv_anchor_styles, @
iv_vect_colors, @
iv_sub_ids, @
i_id )
dump i_return_value, i_id
# Session file paused. Press “Resume” to continue..
sf_pause()
# Associate the vector table with the group “fem_model”
i_return_value = @
ga_group_result_vector_set @
( “fem_model”, @
i_id )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(iv_vect_ent_types)
sys_free_array(iv_vect_ent_ids)
sys_free_array(rv_vect_locs)
sys_free_array(iv_vect_types)
sys_free_array(iv_anchor_styles)
sys_free_array(iv_vect_colors)
sys_free_array(iv_sub_ids)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_vector_get | () |
# Purpose : This file provides an example of a call to the
# function ga_vector_get()
#
# This function is used to get a vector table.
# In this file the deformation results are read
# from the database and a table is created and
# then deleted.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
#
# 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 ga_vector_get()
# has the following arguments:
#
# ga_vector_get
# ( id,
# title,
# comp_vect_flag,
# sym_flag,
# vect_ent_types,
# vect_ent_ids,
# vect_locs,
# normals,
# vect_types,
# anchor_styles,
# vect_colors,
# sub_ids )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_title[32]
INTEGER i_ncases, i_nbr_nodes, i_index
INTEGER iv_lcids(VIRTUAL),iv_nsub(VIRTUAL), iv_node_ids(VIRTUAL)
REAL rv_deform(VIRTUAL)
INTEGER i_dtype,ia_minloc(6),ia_maxloc(6), ia_resids(5)
INTEGER i_comp_vect_flag,i_sym_flag,i_nvectors
INTEGER iv_vect_ent_types(VIRTUAL), iv_vect_ent_ids(VIRTUAL)
REAL rv_vect_locs(VIRTUAL)
INTEGER iv_vect_types(VIRTUAL), iv_anchor_styles(VIRTUAL)
INTEGER iv_vect_colors(VIRTUAL), iv_sub_ids(VIRTUAL)
INTEGER i_id, i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of Load cases and their IDs
i_return_value = @
res_utl_get_loadcases(i_ncases,iv_lcids,iv_nsub)
dump i_return_value
dump i_ncases,iv_lcids,iv_nsub
# Extract the stress results from the database
# Load case ID = iv_lcids(1)
# Sub case ID = 1
# Primary Result ID = 2 ( Corresponds to deformation )
# Secondary Result ID = 1
# Layer ID = 1
# node_list = “Node 1:#” (All nodes )
# derivation = ““
# coord_id = ““
ia_resids(1) = iv_lcids(1)
ia_resids(2) = 1
ia_resids(3) = 3
ia_resids(4) = 1
ia_resids(5) = 2
i_return_value = @
res_utl_extract_nodal_results(ia_resids,” Node 1:#”,””,””, @
i_dtype,i_nbr_nodes,iv_node_ids,rv_deform,ia_minloc,ia_maxloc)
dump i_return_value
# Create a vector table
s_title = “Vector Table”
i_comp_vect_flag = 0
i_sym_flag = 0
i_nvectors = i_nbr_nodes
sys_allocate_array(iv_vect_ent_types,1,i_nvectors)
sys_allocate_array(iv_vect_ent_ids,1,i_nvectors)
sys_allocate_array(rv_vect_locs,1,i_nvectors,1,3)
sys_allocate_array(iv_vect_types,1,i_nvectors)
sys_allocate_array(iv_anchor_styles,1,i_nvectors)
sys_allocate_array(iv_vect_colors,1,i_nvectors)
sys_allocate_array(iv_sub_ids,1,i_nvectors)
FOR(i_index = 1 TO i_nvectors)
iv_vect_ent_types(i_index) = 123 /* from dbtypes.h */
iv_vect_ent_ids(i_index) = iv_node_ids(i_index)
iv_vect_types(i_index) = 1
iv_anchor_styles(i_index) = 1
iv_vect_colors(i_index) = 0
iv_sub_ids(i_index) = 0
END FOR
i_return_value = @
ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
iv_vect_ent_types, @
iv_vect_ent_ids, @
rv_vect_locs, @
rv_deform, @
iv_vect_types, @
iv_anchor_styles, @
iv_vect_colors, @
iv_sub_ids, @
i_id )
dump i_return_value, i_id
# Session file paused. Press “Resume” to continue..
sf_pause()
# Associate the vector table with the group “fem_model”
i_return_value = @
ga_group_result_vector_set @
( “fem_model”, @
i_id )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(iv_vect_ent_types)
sys_free_array(iv_vect_ent_ids)
sys_free_array(rv_vect_locs)
sys_free_array(rv_deform)
sys_free_array(iv_vect_types)
sys_free_array(iv_anchor_styles)
sys_free_array(iv_vect_colors)
sys_free_array(iv_sub_ids)
# Get the number of vectors in the table
i_nvectors = 0
i_return_value = @
ga_vector_number_get @
( i_id, @
i_nvectors )
dump i_return_value, i_nvectors
sys_allocate_array(iv_vect_ent_types,1,i_nvectors)
sys_allocate_array(iv_vect_ent_ids,1,i_nvectors)
sys_allocate_array(rv_vect_locs,1,i_nvectors,1,3)
sys_allocate_array(rv_deform,1,i_nvectors,1,3)
sys_allocate_array(iv_vect_types,1,i_nvectors)
sys_allocate_array(iv_anchor_styles,1,i_nvectors)
sys_allocate_array(iv_vect_colors,1,i_nvectors)
sys_allocate_array(iv_sub_ids,1,i_nvectors)
# Get the vector table
i_return_value = @
ga_vector_get @
( i_id, @
s_title, @
i_comp_vect_flag, @
i_sym_flag, @
iv_vect_ent_types, @
iv_vect_ent_ids, @
rv_vect_locs, @
rv_deform, @
iv_vect_types, @
iv_anchor_styles, @
iv_vect_colors, @
iv_sub_ids )
dump i_return_value
dump s_title, i_comp_vect_flag,i_sym_flag
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(iv_vect_ent_types)
sys_free_array(iv_vect_ent_ids)
sys_free_array(rv_vect_locs)
sys_free_array(iv_vect_types)
sys_free_array(iv_anchor_styles)
sys_free_array(iv_vect_colors)
sys_free_array(iv_sub_ids)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_vector_number_get | () |
# Purpose : This file provides an example of a call to the
# function ga_vector_number_get()
#
# This function is used to get the number of
# vectors in a data table. In this file the
# deformation results are read from the database
# and a table is created and then deleted.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
#
# 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 ga_vector_number_get()
# has the following arguments:
#
# ga_vector_number_get
# ( id,
# nvectors )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_title[32]
INTEGER i_ncases, i_nbr_nodes, i_index
INTEGER iv_lcids(VIRTUAL),iv_nsub(VIRTUAL), iv_node_ids(VIRTUAL)
REAL rv_deform(VIRTUAL)
INTEGER i_dtype,ia_minloc(6),ia_maxloc(6), ia_resids(5)
INTEGER i_comp_vect_flag,i_sym_flag,i_nvectors
INTEGER iv_vect_ent_types(VIRTUAL), iv_vect_ent_ids(VIRTUAL)
REAL rv_vect_locs(VIRTUAL)
INTEGER iv_vect_types(VIRTUAL), iv_anchor_styles(VIRTUAL)
INTEGER iv_vect_colors(VIRTUAL), iv_sub_ids(VIRTUAL)
INTEGER i_id, i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the number of Load cases and their IDs
i_return_value = @
res_utl_get_loadcases(i_ncases,iv_lcids,iv_nsub)
dump i_return_value
dump i_ncases,iv_lcids,iv_nsub
# Extract the stress results from the database
# Load case ID = iv_lcids(1)
# Sub case ID = 1
# Primary Result ID = 2 ( Corresponds to deformation )
# Secondary Result ID = 1
# Layer ID = 1
# node_list = “Node 1:#” (All nodes )
# derivation = ““
# coord_id = ““
ia_resids(1) = iv_lcids(1)
ia_resids(2) = 1
ia_resids(3) = 3
ia_resids(4) = 1
ia_resids(5) = 2
i_return_value = @
res_utl_extract_nodal_results(ia_resids,” Node 1:#”,””,””, @
i_dtype,i_nbr_nodes,iv_node_ids,rv_deform,ia_minloc,ia_maxloc)
dump i_return_value
# Create a vector table
s_title = “Vector Table”
i_comp_vect_flag = 0
i_sym_flag = 0
i_nvectors = i_nbr_nodes
sys_allocate_array(iv_vect_ent_types,1,i_nvectors)
sys_allocate_array(iv_vect_ent_ids,1,i_nvectors)
sys_allocate_array(rv_vect_locs,1,i_nvectors,1,3)
sys_allocate_array(iv_vect_types,1,i_nvectors)
sys_allocate_array(iv_anchor_styles,1,i_nvectors)
sys_allocate_array(iv_vect_colors,1,i_nvectors)
sys_allocate_array(iv_sub_ids,1,i_nvectors)
FOR(i_index = 1 TO i_nvectors)
iv_vect_ent_types(i_index) = 123 /* from dbtypes.h */
iv_vect_ent_ids(i_index) = iv_node_ids(i_index)
iv_vect_types(i_index) = 1
iv_anchor_styles(i_index) = 1
iv_vect_colors(i_index) = 0
iv_sub_ids(i_index) = 0
END FOR
i_return_value = @
ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
iv_vect_ent_types, @
iv_vect_ent_ids, @
rv_vect_locs, @
rv_deform, @
iv_vect_types, @
iv_anchor_styles, @
iv_vect_colors, @
iv_sub_ids, @
i_id )
dump i_return_value, i_id
# Session file paused. Press “Resume” to continue..
sf_pause()
# Associate the vector table with the group “fem_model”
i_return_value = @
ga_group_result_vector_set @
( “fem_model”, @
i_id )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Get the number of vectors in the table
i_nvectors = 0
i_return_value = @
ga_vector_number_get @
( i_id, @
i_nvectors )
dump i_return_value, i_nvectors
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(iv_vect_ent_types)
sys_free_array(iv_vect_ent_ids)
sys_free_array(rv_vect_locs)
sys_free_array(iv_vect_types)
sys_free_array(iv_anchor_styles)
sys_free_array(iv_vect_colors)
sys_free_array(iv_sub_ids)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_view_normal_get | () |
# Purpose : This file provides an example of a call to the
# function ga_view_normal_get()
#
# This file opens a new database "new.db".
# It changes the view to isometric and uses
# this function to get the view vector.
#
# 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 ga_view_normal_get()
# has the following arguments:
#
# ga_view_normal_get
# ( viewport,
# view_vector )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport[16]
REAL ra_vector(3)
INTEGER i_return_value = 5
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Setting the view to isometric.
ga_view_aa_set( 23., -34., 0. )
#---------------------------------------------------------------------
# Getting the view vector.
s_viewport = ""
i_return_value = @
ga_view_normal_get @
( s_viewport, @
ra_vector )
dump i_return_value
dump ra_vector
#---------------------------------------------------------------------
gm_conv_device_to_subject | () |
# Purpose : This file provides an example of a call to the
# function gm_conv_device_to_subject()
#
# This function is used to convert from device
# space to subject space.
#
# 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 gm_conv_device_to_subject()
# has the following arguments:
#
# gm_conv_device_to_subject
# ( vp_id,
# dev_pt,
# sub_pt )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_vp_id
INTEGER ia_dev_pt(2)
REAL ra_sub_pt(3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the ID of the current viewport
i_return_value = @
db_get_current_viewport_id @
( i_vp_id )
dump i_return_value, i_vp_id
# Get the subject point corresponding to [100,100] (in pixels)
ia_dev_pt = [100,100]
i_return_value = @
gm_conv_device_to_subject @
( i_vp_id, @
ia_dev_pt, @
ra_sub_pt )
dump i_return_value, ra_sub_pt
#---------------------------------------------------------------------
gm_convert_name | () |
# Purpose : This file provides an example of a call to the
# function gm_convert_name()
#
# This function is used to remove the directory
# specification from the database name.
#
# 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 gm_convert_name()
# has the following arguments:
#
# gm_convert_name
# ( orig_name,
# new_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_orig_name[128]
STRING s_new_name[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “spool.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# Get the database name(full path)
i_return_value = @
db_name_get @
( s_orig_name )
dump i_return_value,s_orig_name
# Get the stripped name( only file name)
gm_convert_name @
( s_orig_name, @
s_new_name )
dump s_new_name
s_orig_name=”/one/two/three/four”
# Get the stripped name( only file name)
gm_convert_name @
( s_orig_name, @
s_new_name )
dump s_new_name
#---------------------------------------------------------------------
gm_database_current | () |
# Purpose : This file provides an example of a call to the
# function gm_database_current()
#
# This function is used to get the current
# database from the graphics manager.
#
# 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 gm_database_current()
# has no arguments.
#
# gm_database_current
# ( dbname )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_dbname[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
gm_database_current @
( s_dbname )
dump i_return_value, s_dbname
#---------------------------------------------------------------------
gm_draw_entity | () |
# Purpose : This file provides an example of a call to the
# function gm_draw_entity()
#
# This function draws an entity in the segment
# or current viewport.
#
# 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 gm_draw_entity()
# has the following arguments:
#
# gm_draw_entity ( segment_id, @
# color_id, @
# entity_type, @
# entity_id)
#
#---------------------------------------------------------------------
# Variable Declarations
STRING asm_create_patch_xy_created_ids[VIRTUAL]
INTEGER segment_id
INTEGER color_id
INTEGER entity_type
INTEGER entity_id
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new data base.
uil_file_new.go( "", "new.db" )
#---------------------------------------------------------------------
# Create a 2-D patch.
asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", @
asm_create_patch_xy_created_ids )
#---------------------------------------------------------------------
# Argument Initialization.
color_id = 5
entity_type = 3
entity_id = 1
#---------------------------------------------------------------------
# Create the segment id.
gm_segment_create(segment_id)
#---------------------------------------------------------------------
# Draw the selected entity.
i_return_value = gm_draw_entity ( segment_id, @
color_id, @
entity_type, @
entity_id)
#---------------------------------------------------------------------
# Dump the output of the function
dump i_return_value
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
gm_fit_view | () |
# Purpose : This file provides an example of a call to the
# function gm_fit_view()
#
# This function is used make fit view.
#
# 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 gm_fit_view()
# has the following arguments:
#
# gm_fit_view
# ( flag )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_flag
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Zoom in to the viewport to simulate lack of fit
ga_view_zoom_set(2)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Make a fit view
i_flag = 1
i_return_value = @
gm_fit_view @
( i_flag )
dump i_return_value
#---------------------------------------------------------------------
gm_fullcolor_mode | () |
# Purpose : This file provides an example of a call to the
# function gm_fullcolor_mode()
#
# This function is used to find whether the
# device is in full color mode or not.
#
# 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 gm_fullcolor_mode() has no arguments.
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
i_return_value = gm_fullcolor_mode()
dump i_return_value
#---------------------------------------------------------------------
gm_graphics_off | () |
# Purpose : This file provides an example of a call to the
# function gm_graphics_off()
#
# This function is used to shutdown the graphics.
# Executing this function will close the database
# and free all colors.
#
# 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 gm_graphics_off() has no arguments.
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Shutdown the graphics
i_return_value = gm_graphics_off()
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Restore the graphics ( loads last database and allocated colors)
i_return_value = gm_graphics_on()
dump i_return_value
#---------------------------------------------------------------------
gm_graphics_on | () |
# Purpose : This file provides an example of a call to the
# function gm_graphics_on()
#
# 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 gm_graphics_on() has no arguments.
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Shutdown the graphics
i_return_value = gm_graphics_off()
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Restore the graphics ( loads last database and allocated colors)
i_return_value = gm_graphics_on()
dump i_return_value
#---------------------------------------------------------------------
gm_hilight_clear | () |
# Purpose : This file provides an example of a call to the
# function gm_hilight_clear()
#
# This function is used to unhilight all of the
# hilighted entities.
#
# The hilight.pcl file is used to create
# a single width quarter height sized form
# containing a select frame, a selectdatabox and
# a button.
#
# The hilight.pob file used below can be created
# from hilight.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 hilight.pob file:
#
# cpp -I$P3_HOME/customisation hilight.pcl hilight.pob
# 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 gm_hilight_clear() has no arguments.
#
#---------------------------------------------------------------------
# Variable Declarations
WIDGET w_wid_id
INTEGER i_color
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Compile hilight.pob to get hilight.plb
!!COMPILE hilight.pob
# Add hilight.plb to library
!!LIBRARY ADD hilight.plb
ui_exec_function(“hilight”, “display”)
# Get the widget ID of the selectdatabox
hilight.get_select_id(w_wid_id)
dump w_wid_id
# Set the value of the selectdatabox
ui_wid_set(w_wid_id,”VALUE”,”Surface 1:3”)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Hilight the entities listed in the selectdatabox
i_color= -1 /* Use preference color */
i_return_value = @
gm_hilight_widget @
( w_wid_id, @
i_color )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Unhilight all hilighted entities
i_return_value = gm_hilight_clear()
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Hide the form
ui_form_hide(“hilight”)
#---------------------------------------------------------------------
gm_hilight_entity | () |
# Purpose : This file provides an example of two calls to
# the function gm_hilight_entity()
#
# This function is used to hilight an entity.
#
# 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 gm_hilight_entity()
# has the following arguments:
#
# gm_hilight_entity
# ( type,
# id,
# color )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_type
INTEGER i_id
INTEGER i_color
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Highlight surfaces 1 and 2
i_type = 3 /* from dbtypes.h */
i_id = 1
i_color= -1 /* Highlight using preference color */
gm_hilight_entity @
( i_type, @
i_id, @
i_color )
i_id = 2
gm_hilight_entity @
( i_type, @
i_id, @
i_color )
# Session file paused. Press “Resume” to continue..
sf_pause()
# Unhighlight surface 1
i_id = 1
i_color= 0
gm_hilight_entity @
( i_type, @
i_id, @
i_color )
#---------------------------------------------------------------------
gm_hilight_string | () |
# Purpose : This file provides an example of a call to the
# function gm_hilight_string()
#
# This function hilights all the selected entities.
#
# 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 gm_hilight_string()
# has the following arguments:
#
# gm_hilight_string (entities, color_id )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING asm_create_patch_xy_created_ids[VIRTUAL]
INTEGER color_id
STRING entities[80]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new data base.
uil_file_new.go( "", "new.db" )
#---------------------------------------------------------------------
# Create a 2-D patch.
asm_const_patch_xyz( "1", "<1 1 0>", @
"[0 0 0]", "Coord 0", @
asm_create_patch_xy_created_ids )
#---------------------------------------------------------------------
# Argument Initialization.
entities = "Surface 1"
color_id = 1
#---------------------------------------------------------------------
# Hilight all the selected entities.
gm_hilight_string ( entities, color_id)
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
gm_hilight_widget | () |
# Purpose : This file provides an example of a call to the
# function gm_hilight_widget()
#
# This function is used to hilight all of the
# entities in the selectdatabox.
#
# The hilight.pcl file is used to create
# a single width quarter height sized form
# containing a select frame, a selectdatabox and
# a button.
#
# The hilight.pob file used below can be created
# from hilight.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 hilight.pob file:
#
# cpp -I$P3_HOME/customisation hilight.pcl hilight.pob
# 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 gm_hilight_widget()
# has the following arguments:
#
# gm_hilight_widget
# ( wid_id,
# color )
#
#---------------------------------------------------------------------
# Variable Declarations
WIDGET w_wid_id
INTEGER i_color
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Compile hilight.pob to get hilight.plb
!!COMPILE hilight.pob
# Add hilight.plb to library
!!LIBRARY ADD hilight.plb
ui_exec_function(“hilight”,”display”)
# Get the widget ID of the selectdatabox
hilight.get_select_id(w_wid_id)
dump w_wid_id
# Set the value of the selectdatabox
ui_wid_set(w_wid_id,”VALUE”,”Element 1:100”)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Hilight the entities listed in the selectdatabox
i_color= -1 /* Use preference color */
gm_hilight_widget @
( w_wid_id, @
i_color )
# Session file paused. Press “Resume” to continue..
sf_pause()
# Unhilight the entities listed in the selectdatabox
i_color= 0
gm_hilight_widget @
( w_wid_id, @
i_color )
# Session file paused. Press “Resume” to continue..
sf_pause()
# Hide the form
ui_form_hide(“hilight”)
#---------------------------------------------------------------------
gm_lookup_write | () |
# Purpose : This file provides an example of a call to the
# function gm_lookup_write()
#
# 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 gm_lookup_write()
# has the following arguments:
#
# gm_lookup_write
# ( start,
# ncolors,
# colors )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_start
INTEGER i_ncolors
REAL ra_colors(16,3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Create the color array
ra_colors = [[0.0,0.0,0.0][0.5,0.0,0.0][0.0,0.5,0.0][0.0,0.0,0.5] @
[0.5,0.5,0.0][0.0,0.5,0.5][0.5,0.0,0.5][0.5,0.5,0.5] @
[0.8,0.8,0.8][1.0,0.0,0.0][0.0,1.0,0.0][0.0,0.0,1.0] @
[1.0,1.0,0.0][0.0,1.0,1.0][1.0,0.0,1.0][1.0,1.0,1.0]]
i_start = 1
i_ncolors = 16
i_return_value = @
gm_lookup_write @
( i_start, @
i_ncolors, @
ra_colors )
dump i_return_value
#---------------------------------------------------------------------
gm_mpeg_pause_recording | () |
# Purpose : This file contains an example of a call to the
# following function:
#
# 1. gm_mpeg_start_recording()
# 2. gm_mpeg_pause_recording()
# 3. gm_mpeg_resume_recording()
# 4. gm_mpeg_stop_recording()
#
# These functions are for the recording of .mpeg
# images file. gm_mpeg_start_recording function
# starts recording. Rest three functions are
# void functions. These functions do not contain any
# input/output arguments and return value etc.
#
# 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 gm_mpeg_start_recording()
# has the following arguments:
#
# gm_mpeg_start_recording ( file_name, @
# file_version, @
# x, @
# y, @
# width, @
# height, @
# quality, @
# maxframes)
#
#---------------------------------------------------------------------
# Variable Declarations
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING asm_delete_any_deleted_ids[VIRTUAL]
STRING file_name[80]
STRING file_version[80]
REAL x
REAL y
REAL width
REAL height
INTEGER quality
INTEGER maxframes
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new data base.
uil_file_new.go( "", "new.db" )
#---------------------------------------------------------------------
# Argument Initialization.
file_name = "./new.mpg"
file_version = "Increment"
x = 0.
y = 0.
width = 1.0
height = 1.0
quality = 90
maxframes = 1000
#---------------------------------------------------------------------
# Start the recording of .mpeg images file named "./new.mpg".
i_return_value = gm_mpeg_start_recording(file_name, @
file_version, @
x, @
y, @
width, @
height, @
quality, @
maxframes)
#---------------------------------------------------------------------
# Dump the output of the function
dump i_return_value
#---------------------------------------------------------------------
# Create a 2-D patch.
ga_viewport_location_set( "default_viewport", @
0.049213, 3.592520, 1 )
asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", @
asm_create_patch_xy_created_ids )
ga_view_aa_set( -157., 34, -180. )
#---------------------------------------------------------------------
# Pause the recording .mpeg images file named "./new.mpg".
gm_mpeg_pause_recording( )
#---------------------------------------------------------------------
# Create the second 2-D patch.
ga_view_aa_set( 178.170273, -38.784752, -148.256989 )
asm_const_patch_xyz( "2", "<1 1 0>", "[ 10 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
#---------------------------------------------------------------------
# Resume the recording .mpeg images file named "./new.mpg".
gm_mpeg_resume_recording( )
#---------------------------------------------------------------------
# Delete the second 2-D patch.
asm_delete_surface( "Surface 2", asm_delete_any_deleted_ids )
#---------------------------------------------------------------------
# Stop the recording .mpeg images file named "./new.mpg".
gm_mpeg_stop_recording( )
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
gm_mpeg_resume_recording | () |
# Purpose : This file contains an example of a call to the
# following function:
#
# 1. gm_mpeg_start_recording()
# 2. gm_mpeg_pause_recording()
# 3. gm_mpeg_resume_recording()
# 4. gm_mpeg_stop_recording()
#
# These functions are for the recording of .mpeg
# images file. gm_mpeg_start_recording function
# starts recording. Rest three functions are
# void functions. These functions do not contain any
# input/output arguments and return value etc.
#
# 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 gm_mpeg_start_recording()
# has the following arguments:
#
# gm_mpeg_start_recording ( file_name, @
# file_version, @
# x, @
# y, @
# width, @
# height, @
# quality, @
# maxframes)
#
#---------------------------------------------------------------------
# Variable Declarations
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING asm_delete_any_deleted_ids[VIRTUAL]
STRING file_name[80]
STRING file_version[80]
REAL x
REAL y
REAL width
REAL height
INTEGER quality
INTEGER maxframes
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new data base.
uil_file_new.go( "", "new.db" )
#---------------------------------------------------------------------
# Argument Initialization.
file_name = "./new.mpg"
file_version = "Increment"
x = 0.
y = 0.
width = 1.0
height = 1.0
quality = 90
maxframes = 1000
#---------------------------------------------------------------------
# Start the recording of .mpeg images file named "./new.mpg".
i_return_value = gm_mpeg_start_recording(file_name, @
file_version, @
x, @
y, @
width, @
height, @
quality, @
maxframes)
#---------------------------------------------------------------------
# Dump the output of the function
dump i_return_value
#---------------------------------------------------------------------
# Create a 2-D patch.
ga_viewport_location_set( "default_viewport", @
0.049213, 3.592520, 1 )
asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", @
asm_create_patch_xy_created_ids )
ga_view_aa_set( -157., 34, -180. )
#---------------------------------------------------------------------
# Pause the recording .mpeg images file named "./new.mpg".
gm_mpeg_pause_recording( )
#---------------------------------------------------------------------
# Create the second 2-D patch.
ga_view_aa_set( 178.170273, -38.784752, -148.256989 )
asm_const_patch_xyz( "2", "<1 1 0>", "[ 10 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
#---------------------------------------------------------------------
# Resume the recording .mpeg images file named "./new.mpg".
gm_mpeg_resume_recording( )
#---------------------------------------------------------------------
# Delete the second 2-D patch.
asm_delete_surface( "Surface 2", asm_delete_any_deleted_ids )
#---------------------------------------------------------------------
# Stop the recording .mpeg images file named "./new.mpg".
gm_mpeg_stop_recording( )
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
gm_mpeg_start_recording | () |
# Purpose : This file contains an example of a call to the
# following function:
#
# 1. gm_mpeg_start_recording()
# 2. gm_mpeg_pause_recording()
# 3. gm_mpeg_resume_recording()
# 4. gm_mpeg_stop_recording()
#
# These functions are for the recording of .mpeg
# images file. gm_mpeg_start_recording function
# starts recording. Rest three functions are
# void functions. These functions do not contain any
# input/output arguments and return value etc.
#
# 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 gm_mpeg_start_recording()
# has the following arguments:
#
# gm_mpeg_start_recording ( file_name, @
# file_version, @
# x, @
# y, @
# width, @
# height, @
# quality, @
# maxframes)
#
#---------------------------------------------------------------------
# Variable Declarations
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING asm_delete_any_deleted_ids[VIRTUAL]
STRING file_name[80]
STRING file_version[80]
REAL x
REAL y
REAL width
REAL height
INTEGER quality
INTEGER maxframes
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new data base.
uil_file_new.go( "", "new.db" )
#---------------------------------------------------------------------
# Argument Initialization.
file_name = "./new.mpg"
file_version = "Increment"
x = 0.
y = 0.
width = 1.0
height = 1.0
quality = 90
maxframes = 1000
#---------------------------------------------------------------------
# Start the recording of .mpeg images file named "./new.mpg".
i_return_value = gm_mpeg_start_recording(file_name, @
file_version, @
x, @
y, @
width, @
height, @
quality, @
maxframes)
#---------------------------------------------------------------------
# Dump the output of the function
dump i_return_value
#---------------------------------------------------------------------
# Create a 2-D patch.
ga_viewport_location_set( "default_viewport", @
0.049213, 3.592520, 1 )
asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", @
asm_create_patch_xy_created_ids )
ga_view_aa_set( -157., 34, -180. )
#---------------------------------------------------------------------
# Pause the recording .mpeg images file named "./new.mpg".
gm_mpeg_pause_recording( )
#---------------------------------------------------------------------
# Create the second 2-D patch.
ga_view_aa_set( 178.170273, -38.784752, -148.256989 )
asm_const_patch_xyz( "2", "<1 1 0>", "[ 10 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
#---------------------------------------------------------------------
# Resume the recording .mpeg images file named "./new.mpg".
gm_mpeg_resume_recording( )
#---------------------------------------------------------------------
# Delete the second 2-D patch.
asm_delete_surface( "Surface 2", asm_delete_any_deleted_ids )
#---------------------------------------------------------------------
# Stop the recording .mpeg images file named "./new.mpg".
gm_mpeg_stop_recording( )
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
gm_mpeg_stop_recording | () |
# Purpose : This file contains an example of a call to the
# following function:
#
# 1. gm_mpeg_start_recording()
# 2. gm_mpeg_pause_recording()
# 3. gm_mpeg_resume_recording()
# 4. gm_mpeg_stop_recording()
#
# These functions are for the recording of .mpeg
# images file. gm_mpeg_start_recording function
# starts recording. Rest three functions are
# void functions. These functions do not contain any
# input/output arguments and return value etc.
#
# 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 gm_mpeg_start_recording()
# has the following arguments:
#
# gm_mpeg_start_recording ( file_name, @
# file_version, @
# x, @
# y, @
# width, @
# height, @
# quality, @
# maxframes)
#
#---------------------------------------------------------------------
# Variable Declarations
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING asm_delete_any_deleted_ids[VIRTUAL]
STRING file_name[80]
STRING file_version[80]
REAL x
REAL y
REAL width
REAL height
INTEGER quality
INTEGER maxframes
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new data base.
uil_file_new.go( "", "new.db" )
#---------------------------------------------------------------------
# Argument Initialization.
file_name = "./new.mpg"
file_version = "Increment"
x = 0.
y = 0.
width = 1.0
height = 1.0
quality = 90
maxframes = 1000
#---------------------------------------------------------------------
# Start the recording of .mpeg images file named "./new.mpg".
i_return_value = gm_mpeg_start_recording(file_name, @
file_version, @
x, @
y, @
width, @
height, @
quality, @
maxframes)
#---------------------------------------------------------------------
# Dump the output of the function
dump i_return_value
#---------------------------------------------------------------------
# Create a 2-D patch.
ga_viewport_location_set( "default_viewport", @
0.049213, 3.592520, 1 )
asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", @
asm_create_patch_xy_created_ids )
ga_view_aa_set( -157., 34, -180. )
#---------------------------------------------------------------------
# Pause the recording .mpeg images file named "./new.mpg".
gm_mpeg_pause_recording( )
#---------------------------------------------------------------------
# Create the second 2-D patch.
ga_view_aa_set( 178.170273, -38.784752, -148.256989 )
asm_const_patch_xyz( "2", "<1 1 0>", "[ 10 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
#---------------------------------------------------------------------
# Resume the recording .mpeg images file named "./new.mpg".
gm_mpeg_resume_recording( )
#---------------------------------------------------------------------
# Delete the second 2-D patch.
asm_delete_surface( "Surface 2", asm_delete_any_deleted_ids )
#---------------------------------------------------------------------
# Stop the recording .mpeg images file named "./new.mpg".
gm_mpeg_stop_recording( )
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
gm_viewport_hardware_mode_get | () |
# Purpose : This file provides an example of a call to the
# function gm_viewport_hardware_mode_get()
#
# This function is used to get the hardware
# drawing mode of viewports.
#
# 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 gm_viewport_hardware_mode_get()
# has the following arguments:
#
# gm_viewport_hardware_mode_get
# ( hard_flag )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_hard_flag
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
gm_viewport_hardware_mode_get @
( i_hard_flag )
dump i_return_value, i_hard_flag
#---------------------------------------------------------------------
gm_viewport_hardware_mode_set | () |
# Purpose : This file provides an example of two calls
# to function gm_viewport_hardware_mode_set()
#
# This function is used to set the hardware
# drawing mode of viewports.
#
# 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 gm_viewport_hardware_mode_set()
# has the following arguments:
#
# gm_viewport_hardware_mode_set
# ( hard_flag )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_hard_flag
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Set hardware mode to ON
i_hard_flag = 1
gm_viewport_hardware_mode_set @
( i_hard_flag )
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set hardware mode to OFF
i_hard_flag = 0
gm_viewport_hardware_mode_set @
( i_hard_flag )
#---------------------------------------------------------------------
gm_viewport_id_to_name | () |
# Purpose : This file provides an example of a call to the
# function gm_viewport_id_to_name()
#
# 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 gm_viewport_id_to_name()
# has the following arguments:
#
# gm_viewport_id_to_name
# ( id,
# name )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_id
STRING s_name[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the ID of the current viewport
i_return_value = @
db_get_current_viewport_id @
( i_id )
dump i_return_value, i_id
# Get the name of the current viewport
i_return_value = @
gm_viewport_id_to_name @
( i_id, @
s_name )
dump i_return_value, s_name
#---------------------------------------------------------------------
gm_viewport_limits_get | () |
# Purpose : This file provides an example of a call to the
# function gm_viewport_limits_get()
#
# This function is used to determine the limits
# of the model in View Space.
#
# 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 gm_viewport_limits_get()
# has the following arguments:
#
# gm_viewport_limits_get
# ( persp,
# limits )
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL l_persp
REAL ra_limits(6)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
ga_view_aa_set(23.,56.,0.)
# Get the limits of the model (min/max X,Y and Z co-ordinates)
# skip perspective
l_persp = TRUE
i_return_value = @
gm_viewport_limits_get @
( l_persp, @
ra_limits )
dump i_return_value, ra_limits
# use perspective settings
l_persp = FALSE
i_return_value = @
gm_viewport_limits_get @
( l_persp, @
ra_limits )
dump i_return_value, ra_limits
#---------------------------------------------------------------------
gm_viewport_ncolors_get | () |
# Purpose : This file provides an example of a call to the
# function gm_viewport_ncolors_get()
#
# This function is used to get the number of
# colors used by graphics manager.
#
# 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 gm_viewport_ncolors_get()
# has the following arguments:
#
# gm_viewport_ncolors_get
# ( ncolors )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_ncolors
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
gm_viewport_ncolors_get @
( i_ncolors )
dump i_ncolors
#---------------------------------------------------------------------
gm_viewport_refresh_off | () |
# Purpose : This file provides an example of a call to the
# function gm_viewport_refresh_off()
#
# This function is used to turn OFF automatic
# viewport refresh.
#
# 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 gm_viewport_refresh_off() has no arguments.
#
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Show wireframe model
uil_toolbar.wireframe()
repaint_graphics()
# Turn automatic viewport refresh to OFF
gm_viewport_refresh_off()
# Select shaded model
uil_toolbar.shaded_smooth()
# Session file paused. Press “Resume” to continue..
sf_pause()
# Force repaint
repaint_graphics()
# Select wireframe model
uil_toolbar.wireframe()
# Session file paused. Press “Resume” to continue..
sf_pause()
# Force repaint
repaint_graphics()
#---------------------------------------------------------------------
gm_viewport_refresh_on | () |
# Purpose : This file provides an example of a call to the
# function gm_viewport_refresh_on()
#
# This function is used to turn ON automatic
# viewport refresh.
#
# 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 gm_viewport_refresh_on() has no arguments.
#
#---------------------------------------------------------------------
# Variable Declarations
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Show wireframe model
uil_toolbar.wireframe()
repaint_graphics()
# Turn automatic viewport refresh to ON
gm_viewport_refresh_on()
# Select shaded model
uil_toolbar.shaded_smooth()
# Session file paused. Press “Resume” to continue..
sf_pause()
# Select wireframe model
uil_toolbar.wireframe()
# Session file paused. Press “Resume” to continue..
sf_pause()
#---------------------------------------------------------------------
gm_viewport_refresh_status | () |
# Purpose : This file provides an example of a call to the
# function gm_viewport_refresh_status()
#
# This function is used to return the current
# viewport refresh status.
#
# 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 gm_viewport_refresh_status() has no arguments.
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL l_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Turn automatic viewport refresh to OFF
gm_viewport_refresh_off()
# Findout the current status of refresh mode
l_return_value = gm_viewport_refresh_status()
dump l_return_value
# Turn automatic viewport refresh to ON
gm_viewport_refresh_on()
# Findout the current status of refresh mode
l_return_value = gm_viewport_refresh_status()
dump l_return_value
#---------------------------------------------------------------------
gm_viewport_view_corners | () |
# Purpose : This file provides an example of a call to the
# function gm_viewport_view_corners()
#
# This function is used to calculate the centre
# and zoom for viewport given two corners of
# a rectangle.
#
# 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 gm_viewport_view_corners()
# has the following arguments:
#
# gm_viewport_view_corners
# ( id,
# ul,
# lr,
# cent_x,
# cent_y,
# zoom )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_id
INTEGER ia_ul(2), ia_br(2)
INTEGER i_ulx,i_uly,i_brx,i_bry,i_ppi
REAL r_cent_x, r_cent_y, r_zoom
REAL r_width, r_height
INTEGER i_return_value
STRING s_name[32]
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get screen Info
uid_get_screen_info(i_ulx,i_uly,i_brx,i_bry,i_ppi)
# Get the ID of the current viewport
i_return_value = @
db_get_current_viewport_id @
( i_id )
dump i_return_value, i_id
# Get the name of the current viewport
i_return_value = @
gm_viewport_id_to_name @
( i_id, @
s_name )
dump i_return_value, s_name
# Get the width and height of the current viewport
i_return_value = @
ga_viewport_size_get @
( s_name, @
r_width, @
r_height )
dump i_return_value, r_width, r_height
# Zoom to the centre
ia_ul(1) = r_width *i_ppi/2 -20
ia_ul(2) = r_height*i_ppi/2 -20
ia_br(1) = r_width *i_ppi/2 +20
ia_br(2) = r_height*i_ppi/2 +20
i_return_value = @
gm_viewport_view_corners @
( i_id, @
ia_ul, @
ia_br, @
r_cent_x, @
r_cent_y, @
r_zoom )
dump i_return_value, r_cent_x, r_cent_y, r_zoom
# Zoom in
ga_view_center_set(r_cent_x,r_cent_y)
ga_view_zoom_set(r_zoom)
#---------------------------------------------------------------------
gm_visibility_all | () |
# Purpose : This file provides an example of two calls to
# the function gm_visibility_all()
#
# This function is used to set the visibility
# status of all widgets.
#
# 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 gm_visibility_all()
# has the following arguments:
#
# gm_visibility_all
# ( vstat )
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL l_vstat
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set visibility status of all objects to FALSE
l_vstat = FALSE
i_return_value = @
gm_visibility_all @
( l_vstat )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set visibility status of all objects to TRUE
l_vstat = TRUE
i_return_value = @
gm_visibility_all @
( l_vstat )
dump i_return_value
#---------------------------------------------------------------------
gm_visibility_widget | () |
# Purpose : This file provides an example of a call to the
# function gm_visibility_widget()
#
# This function is used to set visibility status
# of all the objects listed in the string.
#
# 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 gm_visibility_widget()
# has the following arguments:
#
# gm_visibility_widget
# ( entity_list,
# visibility )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_entity_list[128]
LOGICAL l_visibility
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Make sure that all objects are visible
gm_visibility_all(TRUE)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the visibility of “Element 1:200” to FALSE
s_entity_list = “Element 1:200”
l_visibility = FALSE
i_return_value = @
gm_visibility_widget @
( s_entity_list, @
l_visibility )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
gm_visibility_all(TRUE)
#---------------------------------------------------------------------
gm_write_image | () |
# Purpose : This function prints the output window to
# a 'ppm' or a 'bmp' file. It returns a
# status 0 for success and 1 for failure.
#
# This file can be run from the MSC Patran window
# by running this session file through the
# "File","Session","Play" pulldown menus
# on the menu bar.
#
#
# The function gm_write_image()
# has the following arguments:
#
# gm_write_image
# ( imagetype,
# filename,
# version_option,
# xpcnt,
# ypcnt,
# widthpcnt,
# heightpcnt,
# quality )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING fem_create_mesh_s_nodes_created[VIRTUAL]
STRING fem_create_mesh_s_elems_created[VIRTUAL]
INTEGER fem_create_mesh_surfa_num_nodes
INTEGER fem_create_mesh_surfa_num_elems
INTEGER i_return_value
#----------------------------------------------------------------------
# Open a new database
if(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
endif
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#----------------------------------------------------------------------
# Create the geometry - SURFACE 1
#
i_return_value = asm_const_patch_xyz @
( "1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
dump i_return_value
#----------------------------------------------------------------------
# Create finite element entities
# Creating 36 nodes and 25 elements for Surface 1.
ui_exec_function( "mesh_seed_display_mgr", "init" )
mesh_seed_create( "Surface 1.4 1.3 1.2 1.1 ", @
1, 5, 0., 0., 0. )
i_return_value = fem_create_mesh_surf_3( @
"IsoMesh", @
0, @
"Surface 1 ", @
1, @
["0.2"], @
"Quad4", @
"1", @
"1", @
"Coord 0", @
"Coord 0", @
fem_create_mesh_surfa_num_nodes, @
fem_create_mesh_surfa_num_elems, @
fem_create_mesh_s_nodes_created, @
fem_create_mesh_s_elems_created )
dump i_return_value
mesh_seed_display_mgr.erase( )
#----------------------------------------------------------------------
# Create loads/boundary conditions
# Creating set 'fixed_nodes' on L.H.S. of the model
# Creating set of forces 'Loads_at_ends', Force of 50 units downwards.
i_return_value = loadsbcs_create2( @
"fixed_nodes", @
"Displacement", @
"Nodal", @
"", @
"Static", @
[" Node 1 31"], @
"FEM", @
"Coord 0", @
"1.", @
["<0,0,0>", @
"<0,0,0>"], @
["", ""] )
dump i_return_value
i_return_value = loadsbcs_create2( @
"Load_at_ends", @
"Force", @
"Nodal", @
"", @
"Static", @
[" Node 36 6"], @
"FEM", @
"Coord 0", @
"1.", @
["<0,-50,0>", @
"<0,0,0>"], @
["", ""] )
dump i_return_value
#----------------------------------------------------------------------
# Using the function gm_write_image() to dump the output of the
# window into a file image_0.bmp
i_return_value = gm_write_image( @
"ppm", @
"image.ppm", @
"", @
0, @
0, @
1, @
1, @
0 )
dump i_return_value
#----------------------------------------------------------------------
# Closing the file new.db
uil_file_close.goquit()
#----------------------------------------------------------------------
# End of file
gm_write_vrml |
# Purpose : This function copies the image from the
# screen into a "vrml" format. It returns an
# integer value for the execution status:
# 1 for success, 0 for failure.
# The function requires filename and the option
# for filename version.
#
# 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 gm_write_vrml()
# has the following arguments:
#
# gm_write_vrml
# ( filename,
# Version_logic )
#---------------------------------------------------------------------
# Variable Declarations
INTEGER fem_create_mesh_surfa_num_nodes
INTEGER fem_create_mesh_surfa_num_elems
INTEGER int_status
STRING fem_create_mesh_s_nodes_created[VIRTUAL]
STRING fem_create_mesh_s_elems_created[VIRTUAL]
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING filename[256] = "image.wrl"
#----------------------------------------------------------------------
# Open a new database
if(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
endif
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#----------------------------------------------------------------------
# Create the surface 1
int_status = asm_const_patch_xyz( @
"1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
dump int_status
#----------------------------------------------------------------------
# Create the finite elements
# Create 121 nodes and 100 elements for Surface 1.
ui_exec_function( "mesh_seed_display_mgr", "init" )
int_status = fem_create_mesh_surf_3( @
"IsoMesh", @
16384, @
"Surface 1", @
1, @
["0.1"], @
"Quad4", @
"#", @
"#", @
"Coord 0", @
"Coord 0", @
fem_create_mesh_surfa_num_nodes, @
fem_create_mesh_surfa_num_elems, @
fem_create_mesh_s_nodes_created, @
fem_create_mesh_s_elems_created )
mesh_seed_display_mgr.erase( )
dump int_status
#----------------------------------------------------------------------
# Using the function gm_write_vrml() to send the output of screen to
# the file image_0.wrl
# The function returns 1 for success and 0 for failure
int_status = gm_write_vrml(filename,"Overwrite")
dump int_status
#----------------------------------------------------------------------
# Closing the file "new.db"
uil_file_close.goquit()
# End of file
#----------------------------------------------------------------------
ga_lookup_create | () |
# Purpose : This file provides an example of a call to the
# function ga_lookup_create()
#
# This function is used to create a new color
# lookup table
#
# 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 ga_lookup_create()
# has the following arguments:
#
# ga_lookup_create
# ( name,
# number,
# rgb )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sa_tables[32](VIRTUAL)
INTEGER i_number
INTEGER i_ntables
REAL ra_rgb(8,3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Create a new color lookup table
s_name = “new_8colors”
i_number = 8
ra_rgb = [ @
[0.0, 0.0, 0.0] [1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] @
[1.0, 1.0, 0.0] [0.0, 1.0, 1.0] [1.0, 0.0, 1.0] [1.0, 1.0, 1.0] ]
i_return_value = @
ga_lookup_create @
( s_name, @
i_number, @
ra_rgb )
dump i_return_value
# Get the number of LUTs present in the database
i_return_value = @
ga_lookup_ntables_get @
( i_ntables )
SYS_ALLOCATE_ARRAY(sa_tables,1,i_ntables)
# Get the list of LUTs present in the database
i_return_value = @
ga_lookup_tables_get @
( sa_tables )
dump i_return_value
dump sa_tables
SYS_FREE_ARRAY(sa_tables)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the created color table
i_return_value = @
ga_lookup_delete @
( s_name )
dump i_return_value
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_lookup_current_set | () |
# Purpose : This file provides an example of a call to the
# function ga_lookup_current_set()
#
# This function is used to set the current
# color lookup table
#
# 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 ga_lookup_current_set()
# has the following arguments:
#
# ga_lookup_current_set
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],s_old_name[32],s_new_name[32]
INTEGER i_number
REAL ra_rgb(8,3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Get the current color lookup table
i_return_value = @
ga_lookup_current_get @
( s_old_name )
# Create a new color lookup table
s_name = “new_8colors”
i_number = 8
ra_rgb = [ @
[0.0, 0.0, 0.0] [1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] @
[1.0, 1.0, 0.0] [0.0, 1.0, 1.0] [1.0, 0.0, 1.0] [1.0, 1.0, 1.0] ]
i_return_value = @
ga_lookup_create @
( s_name, @
i_number, @
ra_rgb )
dump i_return_value
# Set the new color lookup table
i_return_value = @
ga_lookup_current_set @
( s_name )
dump i_return_value
# Get the current color lookup table
i_return_value = @
ga_lookup_current_get @
( s_new_name )
dump i_return_value
dump s_new_name
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the old color lookup table
i_return_value = @
ga_lookup_current_set @
( s_old_name )
dump i_return_value
# Delete the created color table
i_return_value = @
ga_lookup_delete @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_lookup_delete | () |
# Purpose : This file provides an example of a call to the
# function ga_lookup_delete()
#
# This function is used to delete a color
# lookup table
#
# 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 ga_lookup_delete()
# has the following arguments:
#
# ga_lookup_delete
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sa_tables[32](VIRTUAL)
INTEGER i_number
INTEGER i_ntables
REAL ra_rgb(8,3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Create a new color lookup table
s_name = “new_8colors”
i_number = 8
ra_rgb = [ @
[0.0, 0.0, 0.0] [1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] @
[1.0, 1.0, 0.0] [0.0, 1.0, 1.0] [1.0, 0.0, 1.0] [1.0, 1.0, 1.0] ]
i_return_value = @
ga_lookup_create @
( s_name, @
i_number, @
ra_rgb )
dump i_return_value
# Get the number of LUTs present in the database
i_return_value = @
ga_lookup_ntables_get @
( i_ntables )
SYS_ALLOCATE_ARRAY(sa_tables,1,i_ntables)
# Get the list of LUTs present in the database
i_return_value = @
ga_lookup_tables_get @
( sa_tables )
dump i_return_value
dump sa_tables
SYS_FREE_ARRAY(sa_tables)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the created color table
i_return_value = @
ga_lookup_delete @
( s_name )
dump i_return_value
# Get the number of LUTs present in the database
i_return_value = @
ga_lookup_ntables_get @
( i_ntables )
SYS_ALLOCATE_ARRAY(sa_tables,1,i_ntables)
# Get the list of LUTs present in the database
i_return_value = @
ga_lookup_tables_get @
( sa_tables )
dump i_return_value
dump sa_tables
SYS_FREE_ARRAY(sa_tables)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_range_create | () |
# Purpose : This file provides an example of a call to the
# function ga_range_create()
#
# In this file a range is created, it’s existence
# in the database is verified, it is deleted from
# the database, and it’s non-existence in the
# database is verified.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_create() has the following arguments:
#
# ga_range_create
# ( name,
# number )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges
INTEGER i_number
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Create a new range
s_name = “New Range”
i_number = 15
i_return_value = @
ga_range_create @
( s_name, @
i_number )
dump i_return_value
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
sys_free_array(sav_ranges)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the range
i_return_value = @
ga_range_delete @
( s_name )
dump i_return_value
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
#---------------------------------------------------------------------
ga_range_delete | () |
# Purpose : This file provides an example of a call to the
# function ga_range_delete()
#
# In this file a range is created, it’s existence
# in the database is verified, it is deleted from
# the database, and it’s non-existence in the
# database is verified.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_range_delete() has the following arguments:
# ga_range_delete
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges
INTEGER i_number
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Create a new range
s_name = “New Range”
i_number = 15
i_return_value = @
ga_range_create @
( s_name, @
i_number )
dump i_return_value
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
sys_free_array(sav_ranges)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the new range
i_return_value = @
ga_range_delete @
( s_name )
dump i_return_value
# Get the number of ranges in the database
i_return_value = @
ga_range_nranges_get @
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# Get the list of ranges in the database
i_return_value = @
ga_range_ranges_get @
( sav_ranges )
dump i_return_value, sav_ranges
#---------------------------------------------------------------------
ga_spectrum_colors_set | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_colors_set()
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_colors_set()
# has the following arguments:
#
# ga_spectrum_colors_set
# ( name,
# offset,
# number,
# colors )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
INTEGER iv_old_colors(VIRTUAL),ia_colors(16)
INTEGER iv_colors(VIRTUAL)
INTEGER i_old_number,i_number,iv_number
INTEGER i_offset
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
# Get the number of colors in the current spectrum
i_return_value = @
ga_spectrum_ncolors_get @
( s_name, @
i_old_number)
dump i_return_value
dump i_old_number
sys_allocate_array(iv_old_colors,1,i_old_number)
# Get the colors in the current spectrum
i_return_value = @
ga_spectrum_colors_get @
( s_name, @
iv_old_colors )
dump i_return_value
dump iv_old_colors
# Observe the original color settings.
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the colors in the current spectrum
i_offset =0
i_number =16
ia_colors =[0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_colors_set @
( s_name, @
i_offset, @
i_number, @
ia_colors )
dump i_return_value
# Get the number of colors in the current spectrum
i_return_value = @
ga_spectrum_ncolors_get @
( s_name, @
iv_number)
dump i_return_value
dump iv_number
sys_allocate_array(iv_colors,1,iv_number)
# Get the colors in the current spectrum
i_return_value = @
ga_spectrum_colors_get @
( s_name, @
iv_colors )
dump i_return_value
dump iv_colors
sys_free_array(iv_colors)
# Observe the changed color settings.
# Session file paused. Press “Resume” to continue
# and restore the original color settings.
sf_pause()
# Set the original colors in the current spectrum
i_offset =0
i_number =i_old_number
i_return_value = @
ga_spectrum_colors_set @
( s_name, @
i_offset, @
i_number, @
iv_old_colors )
dump i_return_value
# Get the number of colors in the current spectrum
i_return_value = @
ga_spectrum_ncolors_get @
( s_name, @
iv_number)
dump i_return_value
dump iv_number
sys_allocate_array(iv_colors,1,iv_number)
# Get the colors in the current spectrum
i_return_value = @
ga_spectrum_colors_get @
( s_name, @
iv_colors )
dump i_return_value
dump iv_colors
#---------------------------------------------------------------------
ga_spectrum_continuous_set | () |
# Purpose : This file provides an example of two calls to
# the function ga_spectrum_continuous_set().
#
# This function is used to set the continuous
# tone flag of a spectrum.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_continuous_set()
# has the following arguments:
#
# ga_spectrum_continuous_set
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
INTEGER i_old_value,i_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
# Get the continuous tone flag of the current spectrum
i_return_value = @
ga_spectrum_continuous_get @
( s_name, @
i_old_value )
dump i_return_value
dump i_old_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the continuous tone flag of the current spectrum
i_value = 1
i_return_value = @
ga_spectrum_continuous_set @
( s_name, @
i_value )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Get the continuous tone flag of the current spectrum
i_value = 0
i_return_value = @
ga_spectrum_continuous_get @
( s_name, @
i_value )
dump i_return_value
dump i_value
# Set the continuous tone flag of the current spectrum to it’s
# old value
i_value = i_old_value
i_return_value = @
ga_spectrum_continuous_set @
( s_name, @
i_value )
dump i_return_value
#---------------------------------------------------------------------
ga_spectrum_create | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_create()
#
# In this file a spectrum is created, it’s
# existence in the database is verified, it is
# deleted from the database, and it’s
# non-existence in the database is verified.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_create() has the following arguments:
#
# ga_spectrum_create
# ( name,
# number,
# colors )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sav_spectrums[32](VIRTUAL)
INTEGER i_nspectrums
INTEGER i_number
INTEGER ia_colors(16)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Create a spectrum
s_name = “new_spectrum”
i_number = 16
ia_colors= [0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_create @
( s_name, @
i_number, @
ia_colors )
dump i_return_value
# Get the number of spectrums in the database
i_return_value = @
ga_spectrum_nspectrums_get @
( i_nspectrums )
dump i_return_value
dump i_nspectrums
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
sys_free_array(sav_spectrums)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the created spectrum
i_return_value = @
ga_spectrum_delete @
( s_name )
dump i_return_value
# Get the number of spectrums in the database
i_return_value = @
ga_spectrum_nspectrums_get @
( i_nspectrums )
dump i_return_value
dump i_nspectrums
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_spectrums)
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_current_set | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_current_set()
#
# This function is used to set the current
# spectrum.
# In this file first the current spectrum is
# saved, then a new spectrum is created and
# made current, finally restoring the original
# spectrum and deleting the new spectrum.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_current_set()
# has the following arguments:
#
# ga_spectrum_current_set
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_old_name[32],s_name[32]
INTEGER i_number
INTEGER ia_colors(16)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_old_name )
dump i_return_value, s_old_name
# Create a spectrum
s_name = “new_spectrum”
i_number = 16
ia_colors= [0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_create @
( s_name, @
i_number, @
ia_colors )
dump i_return_value
# Make the new spectrum as current spectrum
i_return_value = @
ga_spectrum_current_set @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Get the current spectrum
s_name = ““
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value, s_name
# Restore the old spectrum
i_return_value = @
ga_spectrum_current_set @
( s_old_name )
dump i_return_value
# Delete the created spectrum
i_return_value = @
ga_spectrum_delete @
( s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_delete | () |
# Purpose : This file provides an example of a call to the
# function ga_spectrum_delete()
#
# This function is used to delete a spectrum.
# In this file a spectrum is created, it’s
# existence in the database is verified, it is
# deleted from the database, and it’s
# non-existence in the database is verified.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_delete()
# has the following arguments:
#
# ga_spectrum_delete
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sav_spectrums[32](VIRTUAL)
INTEGER i_nspectrums
INTEGER i_number
INTEGER ia_colors(16)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Create a spectrum
s_name = “new_spectrum”
i_number = 16
ia_colors= [0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_create @
( s_name, @
i_number, @
ia_colors )
dump i_return_value
# Get the number of spectrums in the database
i_return_value = @
ga_spectrum_nspectrums_get @
( i_nspectrums )
dump i_return_value
dump i_nspectrums
sys_allocate_array(sav_spectrums,1,i_nspectrums)
# Get the list of spectrums in the database
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
sys_free_array(sav_spectrums)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the created spectrum
i_return_value = @
ga_spectrum_delete @
( s_name )
dump i_return_value
# Get the number of spectrums in the database
i_return_value = @
ga_spectrum_nspectrums_get @
( i_nspectrums )
dump i_return_value
dump i_nspectrums
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_spectrums)
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_spectrum_interpolation_set | () |
# Purpose : This file provides an example of two calls to
# the function ga_spectrum_interpolation_set()
#
# This function is used to set the interpolation
# factor of a spectrum.
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# 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 ga_spectrum_interpolation_set()
# has the following arguments:
#
# ga_spectrum_interpolation_set
# ( name,
# factor )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL r_old_factor,r_factor
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Get the current spectrum
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
# Get the interpolation factor of the current spectrum
i_return_value = @
ga_spectrum_interpolation_get @
( s_name, @
r_old_factor )
dump i_return_value
dump r_old_factor
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the interpolation factor of the current spectrum
r_factor = 4.0
i_return_value = @
ga_spectrum_interpolation_set @
( s_name, @
r_factor )
dump i_return_value
# Get the interpolation factor of the current spectrum
r_factor = 0.0
i_return_value = @
ga_spectrum_interpolation_get @
( s_name, @
r_factor )
dump i_return_value
dump r_factor
# Session file paused. Press “Resume” to continue..
sf_pause()
# Set the interpolation factor of the current spectrum to it’s
# old value
r_factor = r_old_factor
i_return_value = @
ga_spectrum_interpolation_set @
( s_name, @
r_factor )
dump i_return_value
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_create | () |
# Purpose : This file provides an example of a call to the
# function ga_title_create()
#
# This function is used to create a title.
# In this file a title is created, verify it’s
# existence in the database, remove it from the
# database, and verify that it no longer exists
# in the database.
#
# 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 ga_title_create()
# has the following arguments:
#
# ga_title_create
# ( name,
# x,
# y,
# color,
# font_size )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sav_list[256](VIRTUAL)
REAL r_x
REAL r_y
INTEGER i_color
INTEGER i_font_size
INTEGER i_ntitles
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “new.db”
uil_file_open.go(“new.db”)
# Create a title at the centre
s_name = “New Title”
r_x = 50
r_y = 50
i_color = 1
# Choose 12 point Font
i_font_size = 2
i_return_value = @
ga_title_create @
( s_name, @
r_x, @
r_y, @
i_color, @
i_font_size )
dump i_return_value
# Get the number of titles in the database
i_return_value = @
ga_title_num_get @
( i_ntitles )
dump i_return_value
dump i_ntitles
sys_allocate_array(sav_list,1,i_ntitles)
# Get the list of the titles in the database
i_return_value = @
ga_title_list_get @
( sav_list )
dump i_return_value
dump sav_list
sys_free_array(sav_list)
# Post the title to the current viewport
i_return_value = @
ga_viewport_title_post @
( ““, @
s_name )
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the title created
i_return_value = @
ga_title_delete @
( s_name )
dump i_return_value
# Get the number of titles in the database
# There should be zero titles in the database -
# one was created and then one was deleted.
i_return_value = @
ga_title_num_get @
( i_ntitles )
dump i_return_value
dump i_ntitles
# Post the title to the current viewport
i_return_value = @
ga_viewport_title_post @
( ““, @
s_name )
dump i_return_value
#---------------------------------------------------------------------
ga_title_delete | () |
# Purpose : This file provides an example of a call to the
# function ga_title_delete()
#
# This function is used to delete a title.
# In this file a title is created, verify it’s
# existence in the database, remove it from the
# database, and verify that it no longer exists
# in the database.
#
# 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 ga_title_delete() has the following arguments:
#
# ga_title_delete
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sav_list[256](VIRTUAL)
REAL r_x
REAL r_y
INTEGER i_color
INTEGER i_font_size
INTEGER i_ntitles
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “new.db”
uil_file_open.go(“new.db”)
# Create a title at the centre
s_name = “New Title”
r_x = 50
r_y = 50
i_color = 7
# Choose 12 point Font
i_font_size = 2
i_return_value = @
ga_title_create @
( s_name, @
r_x, @
r_y, @
i_color, @
i_font_size )
dump i_return_value
# Post the title to the current viewport
i_return_value = @
ga_viewport_title_post @
( ““, @
s_name )
dump i_return_value
# Get the number of titles in the database
i_return_value = @
ga_title_num_get @
( i_ntitles )
dump i_return_value
dump i_ntitles
sys_allocate_array(sav_list,1,i_ntitles)
# Get the list of the titles in the database
i_return_value = @
ga_title_list_get @
( sav_list )
dump i_return_value
dump sav_list
sys_free_array(sav_list)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Delete the title created
# The title displayed in the viewport should be deleted.
i_return_value = @
ga_title_delete @
( s_name )
dump i_return_value
# Get the number of titles in the database
# The number of titles returned should be zero.
i_return_value = @
ga_title_num_get @
( i_ntitles )
dump i_return_value
dump i_ntitles
# Post the title to the current viewport
i_return_value = @
ga_viewport_title_post @
( ““, @
s_name )
dump i_return_value
#---------------------------------------------------------------------
start_vrml_animation | () |
# Purpose : This function copies the animation from the
# screen into a VRML format. It has no
# returns conditions. This session files
# requires nastran preference to be loaded
# with Patran.
#
# 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 start_vrml_animation()
# has the following arguments:
#
# start_vrml_animation
# ( filename,
# Version_logic )
#---------------------------------------------------------------------
# Variable Declarations
INTEGER fem_create_mesh_surfa_num_nodes
INTEGER fem_create_mesh_surfa_num_elems
INTEGER int_status
STRING fem_create_mesh_s_nodes_created[VIRTUAL]
STRING fem_create_mesh_s_elems_created[VIRTUAL]
STRING asm_create_patch_xy_created_ids[VIRTUAL]
INTEGER res_create_demo_mcid
INTEGER res_create_demo_scid
INTEGER res_create_demo_rcid
INTEGER res_create_demo_layerposid
INTEGER res_create_demo_rtid
STRING filename[256] = "animate.wrl"
#----------------------------------------------------------------------
# Open a new database
if(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
endif
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#----------------------------------------------------------------------
# Create the surface 1
int_status = asm_const_patch_xyz( @
"1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
dump int_status
#----------------------------------------------------------------------
# Create the finite elements
# Create 121 nodes and 100 elements for Surface 1.
ui_exec_function( "mesh_seed_display_mgr", "init" )
int_status = fem_create_mesh_surf_3( @
"IsoMesh", @
16384, @
"Surface 1", @
1, @
["0.1"], @
"Quad4", @
"#", @
"#", @
"Coord 0", @
"Coord 0", @
fem_create_mesh_surfa_num_nodes, @
fem_create_mesh_surfa_num_elems, @
fem_create_mesh_s_nodes_created, @
fem_create_mesh_s_elems_created )
mesh_seed_display_mgr.erase( )
dump int_status
#----------------------------------------------------------------------
# Creating a dummy Result case for demonstration of
# animation.
db_drop_res_index( )
res_db_create_loadcase_c( "Default case", @
1, @
"Created by MSC Patran for demo results",@
res_create_demo_mcid )
res_db_create_subcase_c( 2, @
"demo", @
res_create_demo_scid, @
res_create_demo_rcid )
res_db_createlayerpos_c( 0, @
0, @
res_create_demo_layerposid )
res_db_create_restype_c( "Nodal Vector", @
"Demo Result1", @
2, 1, @
"By MSC Patran For Demo Results", @
0, @
res_create_demo_rtid )
res_create_demoresult2( 3, 1, 1., 1, 1, 1, @
[0, 0, 0, 0], @
2, 0, 0, 0 )
$# Demo result done
#----------------------------------------------------------------------
# Using the function start_vrml_animation to start the animation recording
start_vrml_animation(filename,"Increment")
#----------------------------------------------------------------------
# The animation parameters are defined here
db_post_results_load( )
res_display_tool_unpost( "Deformation", @
"default_Deformation" )
res_data_load_dbresult( 0, @
"Nodal", @
"Scalar", @
"Default case", @
"demo", @
"Nodal Vector", @
"Demo Result1", @
"(NON-LAYERED)", @
"XX", @
"Default", @
"DeriveAverage", @
"All", @
"ShapeFunc" )
res_data_title( 0, "Nodal", "Scalar",1, @
["Default case, demo: Nodal Vector,Demo Result1-(NON-LAYERED) (XX)"] )
res_display_fringe_create( "", "FreeFaces", 0, [""], 12, @
["Range:Fri_default_Fringe", "RangeOverwrite:ON", @
"FringeStyle:Discrete/Smooth", "Shade:None", @
"ElemEdge:FreeEdge,Blue,Solid,1", "Shrink:0", @
"TitleDisplay:OFF", "MinMaxDisplay:OFF", "ValueDisplay:OFF", @
"Filter:None","ScaleFactor:1.", @
"LabelStyle:Exponential, 12, White, 3"], @
TRUE )
res_display_fringe_post( "", 0, "Nodal", TRUE, FALSE )
res_display_tool_animate_scale( "Modal", "Fringe", "", 0. )
res_display_anim_setup_2d( 30, "Linear", "" )
res_display_anim_run( 10 )
res_display_anim_clear( )
#----------------------------------------------------------------------
# Ending the animation.
end_vrml_animation()
#----------------------------------------------------------------------
# Closing the file new.db
uil_file_close.goquit()
# End of file
#----------------------------------------------------------------------
verify_boundaries_display_mgr.erase | () |
# Purpose : This file provides an example of a call to the
# function
# verify_boundaries_display_mgr.erase()
#
# This function is used to erase the free
# boundary display by resetting graphics
# properties.
#
# 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 verify_boundaries_display_mgr.erase()
# has no arguments.
#---------------------------------------------------------------------
# Variable declaration
STRING s_displ_type[32]
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Initialise the verify_boundaries_display manager.
verify_boundaries_display_mgr.initialize()
# Plot the free edges
s_displ_type=”Free_Edges”
verify_boundaries_display_mgr.plot(s_displ_type)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Erase the free edges plot
verify_boundaries_display_mgr.erase()
# Plot the free surfaces
s_displ_type=”Free_Faces”
verify_boundaries_display_mgr.plot(s_displ_type)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Erase the free surfaces plot
verify_boundaries_display_mgr.erase()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
verify_boundaries_display_mgr.initialize | () |
# Purpose : This file provides an example of a call to the
# function
# verify_boundaries_display_mgr.initialize()
#
# This function is used to save graphics
# properties associated with the current group
#
# 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 verify_boundaries_display_mgr.initialize()
# has no arguments.
#---------------------------------------------------------------------
# Variable declaration
STRING s_displ_type[32]
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Initialise the verify_boundaries_display manager.
verify_boundaries_display_mgr.initialize()
# Plot the free edges
s_displ_type=”Free_Edges”
verify_boundaries_display_mgr.plot(s_displ_type)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Erase the free edges plot
verify_boundaries_display_mgr.erase()
# Plot the free surfaces
s_displ_type=”Free_Faces”
verify_boundaries_display_mgr.plot(s_displ_type)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Erase the free surfaces plot
verify_boundaries_display_mgr.erase()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------
verify_boundaries_display_mgr.plot | () |
# Purpose : This file provides an example of a call to the
# function
# verify_boundaries_display_mgr.plot()
#
# This function is used to plot the free
# boundaries by changing the display properties.
#
# 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 verify_boundaries_display_mgr.plot(displ_type)
# has the following arguments.
#
# verify_boundaries_display_mgr.plot
# (displ_type)
#
#---------------------------------------------------------------------
# Variable declaration
STRING s_displ_type[32]
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Initialise the verify_boundaries_display manager.
verify_boundaries_display_mgr.initialize()
# Plot the free edges
s_displ_type=”Free_Edges”
verify_boundaries_display_mgr.plot(s_displ_type)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Erase the free edges plot
verify_boundaries_display_mgr.erase()
# Plot the free surfaces
s_displ_type=”Free_Faces”
verify_boundaries_display_mgr.plot(s_displ_type)
# Session file paused. Press “Resume” to continue..
sf_pause()
# Erase the free surfaces plot
verify_boundaries_display_mgr.erase()
# Close the database “spool.db”
uil_file_close.go()
#---------------------------------------------------------------------