() |
#
# Purpose : This file provides an example of two calls
# to the function ga_viewport_axis_get()
#
# This file opens a new database and gets the
# flag for axis display. Later it sets the
# axis display and gets the flag again.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_axis_get()
# has the following arguments:
#
# ga_viewport_axis_get
# ( viewport_name,
# axis_display )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
INTEGER i_axis_display
INTEGER i_axis_display_s
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
# s_viewport_name = "default_viewport".
s_viewport_name = "default_viewport"
# Get the axis display flag.
i_return_value = @
ga_viewport_axis_get @
( s_viewport_name, @
i_axis_display )
dump i_return_value
# The axis display flag is
dump i_axis_display
IF( i_axis_display == 1) THEN
i_axis_display_s = 0
ELSE
i_axis_display_s = 1
END IF
# Note the change in viewport for the axis display.
# Session file paused. Press "Resume" to continue..
sf_pause()
#---------------------------------------------------------------------
# Set the axis display flag.
i_return_value = @
ga_viewport_axis_set @
( s_viewport_name, @
i_axis_display_s )
dump i_return_value
# Get the axis display flag.
i_return_value = @
ga_viewport_axis_get @
( s_viewport_name, @
i_axis_display )
dump i_return_value
# The axis display flag is
dump i_axis_display
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call
# to the function ga_viewport_axis_set()
#
# This file opens a new database and gets the
# flag for axis display. Later it sets the
# axis display and gets the flag again.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_axis_set()
# has the following arguments:
#
# ga_viewport_axis_get
# ( viewport_name,
# axis_display )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
INTEGER i_axis_display
INTEGER i_axis_display_g
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
# s_viewport_name = "default_viewport".
s_viewport_name = "default_viewport"
# Get the axis display flag.
i_return_value = @
ga_viewport_axis_get @
( s_viewport_name, @
i_axis_display_g )
dump i_return_value
# The axis display flag is
dump i_axis_display_g
IF( i_axis_display_g == 1) THEN
i_axis_display = 0
ELSE
i_axis_display = 1
END IF
# Note the change in viewport for the axis display.
# Session file paused. Press "Resume" to continue..
sf_pause()
# Set the axis display flag.
i_return_value = @
ga_viewport_axis_set @
( s_viewport_name, @
i_axis_display )
dump i_return_value
# Get the axis display flag.
i_return_value = @
ga_viewport_axis_get @
( s_viewport_name, @
i_axis_display_g )
dump i_return_value
# The axis display flag is
dump i_axis_display_g
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_background_get()
#
# This file opens a new database "new.db" and
# gets the background color of the viewport.
# Later it sets the background color and gets
# color.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_background_get()
# has the following arguments:
#
# ga_viewport_background_get
# ( viewport_name,
# background_color )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
INTEGER i_background_color
INTEGER i_background_color_s
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
s_viewport_name = "default_viewport"
# Get the background color of the viewport.
i_return_value = @
ga_viewport_background_get @
( s_viewport_name, @
i_background_color )
dump i_return_value
dump i_background_color
IF ( i_background_color == 4 ) THEN
i_background_color_s = 8
ELSE
i_background_color_s = 4
END IF
# Set the background color of the viewport.
i_return_value = @
ga_viewport_background_set @
( s_viewport_name, @
i_background_color_s )
dump i_return_value
# Get the background color of the viewport.
i_return_value = @
ga_viewport_background_get @
( s_viewport_name, @
i_background_color )
dump i_return_value
dump i_background_color
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_background_set()
#
# This file opens a new database "new.db" and
# gets the background color of the viewport.
# Later it sets the background color and gets
# color.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_background_set()
# has the following arguments:
#
# ga_viewport_background_set
# ( viewport_name,
# background_color )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
INTEGER i_background_color
INTEGER i_background_color_g
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
s_viewport_name = "default_viewport"
# Get the background color of the viewport.
i_return_value = @
ga_viewport_background_get @
( s_viewport_name, @
i_background_color_g )
dump i_return_value
dump i_background_color_g
IF ( i_background_color_g == 4 ) THEN
i_background_color = 8
ELSE
i_background_color = 4
END IF
# Set the background color of the viewport.
i_return_value = @
ga_viewport_background_set @
( s_viewport_name, @
i_background_color )
dump i_return_value
# Get the background color of the viewport.
i_return_value = @
ga_viewport_background_get @
( s_viewport_name, @
i_background_color_g )
dump i_return_value
dump i_background_color_g
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_create()
#
# This file opens a new database and creates
# a new viewport in addition to the existing
# "default_viewport". The created new viewport
# is visible on the screen. The count of the
# viewports before and after creation is done.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_create()
# has the following arguments:
#
# ga_viewport_create
# ( viewport_name,
# x_location,
# y_location,
# width,
# height )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
REAL r_x_location
REAL r_y_location
REAL r_width
REAL r_height
INTEGER i_number_of_viewports
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#
# Create a new viewport with x,y location (6.5,6.5),width 4.5 and
# height 3.5.
s_viewport_name = "new_viewport"
r_x_location = 6.5
r_y_location = 6.5
r_width = 4.5
r_height = 3.5
# Count the number of view ports in the database.
i_return_value = @
ga_viewport_nviewports_get @
( i_number_of_viewports )
dump i_return_value
dump i_number_of_viewports
i_return_value = @
ga_viewport_create @
( s_viewport_name, @
r_x_location, @
r_y_location, @
r_width, @
r_height )
dump i_return_value
# Count the number of view ports in the database.
i_return_value = @
ga_viewport_nviewports_get @
( i_number_of_viewports )
dump i_return_value
dump i_number_of_viewports
# Note the increase in count by 1 due to newly created viewport.
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of two calls to
# the function ga_viewport_current_get()
#
# This file opens the existing database "view.db"
# which has three viewports.This file gets the
# current viewport and later sets the current
# viewport to a different viewport and finally
# gets the current viewport.
#
# Before running this session file run view.ses
# to create view.db
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_current_get()
# has the following arguments:
#
# ga_viewport_current_get
# ( viewport_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_viewport_name_s[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database "view.db"
uil_file_open.go("view.db")
# Get the current viewport.
i_return_value = @
ga_viewport_current_get @
( s_viewport_name )
dump i_return_value
dump s_viewport_name
IF ( s_viewport_name == "view1" ) THEN
s_viewport_name_s = "view2"
ELSE
s_viewport_name_s = "view1"
END IF
# The change of viewport can be noticed in the Viewport/Modify
# form in the current viewport.
# Session file paused. Press "Resume" to continue..
sf_pause()
# Set the current viewport.
i_return_value = @
ga_viewport_current_set @
( s_viewport_name_s )
dump i_return_value
# Get the current viewport.
i_return_value = @
ga_viewport_current_get @
( s_viewport_name )
dump i_return_value
dump s_viewport_name
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to
# the function ga_viewport_current_set()
#
# This file opens the existing database "view.db"
# which has three viewports.This file gets the
# current viewport and later sets the current
# viewport to a different viewport and finally
# gets the current viewport.
#
# Before running this session file run view.ses
# to create view.db
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_current_set()
# has the following arguments:
#
# ga_viewport_current_set
# ( viewport_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_viewport_name_g[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database "view.db"
uil_file_open.go("view.db")
# Get the current viewport.
i_return_value = @
ga_viewport_current_get @
( s_viewport_name_g )
dump i_return_value
dump s_viewport_name_g
IF ( s_viewport_name_g == "view1" ) THEN
s_viewport_name = "view2"
ELSE
s_viewport_name = "view1"
END IF
# The change of viewport can be noticed in the Viewport/Modify
# form in the current viewport.
# Session file paused. Press "Resume" to continue..
sf_pause()
# Set the current viewport.
i_return_value = @
ga_viewport_current_set @
( s_viewport_name )
dump i_return_value
# Get the current viewport.
i_return_value = @
ga_viewport_current_get @
( s_viewport_name_g )
dump i_return_value
dump s_viewport_name_g
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_delete()
#
# This file opens a new database and creates
# a new viewport in addition to the existing
# "default_viewport". Later it counts the
# number of viewports in the database before
# and after deleting the view port.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_delete()
# has the following arguments:
#
# ga_viewport_delete
# ( viewport_name )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
REAL r_x_location
REAL r_y_location
REAL r_width
REAL r_height
INTEGER i_number_of_viewports
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
# Create a new viewport with x,y location (6.5,6.5),width 4.5 and
# height 3.5.
s_viewport_name = "new_viewport"
r_x_location = 6.5
r_y_location = 6.5
r_width = 4.5
r_height = 3.5
i_return_value = @
ga_viewport_create @
( s_viewport_name, @
r_x_location, @
r_y_location, @
r_width, @
r_height )
dump i_return_value
# Count the number of view ports in the database.
i_return_value = @
ga_viewport_nviewports_get @
( i_number_of_viewports )
dump i_number_of_viewports
# Session file paused. Press "Resume" to continue..
# Note that the new viewport will be deleted when session file
# is resumed.
sf_pause()
# Delete the newly created viewport.
i_return_value = @
ga_viewport_delete @
( s_viewport_name )
dump i_return_value
# Count the number of view ports in the database.
i_return_value = @
ga_viewport_nviewports_get @
( i_number_of_viewports )
dump i_number_of_viewports
# Note the count has decreased by 1 in comparison with the
# earlier count.
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of two calls to
# the function ga_viewport_exist_get()
#
# This file opens an existing database "view.db"
# which has three viewports.Later it checks
# for existance of an existing and a non-existing
# viewport.
#
# Before running this session file run view.ses
# to create view.db
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_exist_get()
# has the following arguments:
#
# ga_viewport_exist_get
# ( viewport_name,
# existance_flag )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
INTEGER i_existance_flag
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database "view.db"
uil_file_open.go("view.db")
# Check for the existant viewport.
s_viewport_name = "view1"
i_return_value = @
ga_viewport_exist_get @
( s_viewport_name, @
i_existance_flag )
dump i_return_value
dump i_existance_flag
# Check for the non-existant viewport.
s_viewport_name = "no_view"
i_return_value = @
ga_viewport_exist_get @
( s_viewport_name, @
i_existance_flag )
dump i_return_value
dump i_existance_flag
#---------------------------------------------------------------------
() |
#---------------------------------------------------------------------
# Purpose : This file provides an example of a call to the
# function ga_viewport_group_post()
#
# This file opens a existing database "view.db"
# which has three groups.It posts the group
# "new1_group" which contains a square surface
# on the default_viewport.Later it unposts this
# group.
#
# Before running this session file run view.ses
# to create view.db
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_group_post()
# has the following arguments:
#
# ga_viewport_group_post
# ( viewport_name,
# group_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_group_name[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database "view.db"
uil_file_open.go("view.db")
# Post the default_viewport
s_viewport_name = "default_viewport"
i_return_value = @
ga_viewport_post @
( s_viewport_name )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Post the group "new1_group" to the "default_viewport" which
# contains only "default_group".
s_group_name = "new1_group"
i_return_value = @
ga_viewport_group_post @
( s_viewport_name, @
s_group_name )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Unpost the group "new1_group" from the "default_viewport" which
# contains "default_group" and "new1_group".
i_return_value = @
ga_viewport_group_unpost @
( s_viewport_name, @
s_group_name )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_group_post_all()
#
# This file opens an existing database "view.db"
# which has three groups.It posts all the groups
# to the default viewport.Later it unposts all
# the groups from the default viewport.Finally
# it posts the default group to the viewport.
#
# Before running this session file run view.ses
# to create view.db
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_group_post_all()
# has the following arguments:
#
# ga_viewport_group_post_all
# ( viewport_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database "view.db"
uil_file_open.go("view.db")
# Post the default viewport which contains just the default group.
s_viewport_name = "default_viewport"
i_return_value = @
ga_viewport_post @
( s_viewport_name )
dump i_return_value
# Post all the groups to the default viewport.
# Session file paused. Press "Resume" to continue..
sf_pause()
i_return_value = @
ga_viewport_group_post_all @
( s_viewport_name )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Unpost all the groups from the default viewport.
i_return_value = @
ga_viewport_group_unpost_all @
( s_viewport_name )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Post the default group to the default viewport.
i_return_value = @
ga_viewport_group_post @
( s_viewport_name, @
"default_group" )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_group_unpost()
#
# This file opens a existing database "view.db"
# which has three groups.It posts the group
# "new1_group" which contains a square surface
# on the default_viewport.Later it unposts this
# group.
#
# Before running this session file run view.ses
# to create view.db
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_group_unpost()
# has the following arguments:
#
# ga_viewport_group_unpost
# ( viewport_name,
# group_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_group_name[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database "view.db"
uil_file_open.go("view.db")
# Post the default_viewport
s_viewport_name = "default_viewport"
i_return_value = @
ga_viewport_post @
( s_viewport_name )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Post the group "new1_group" to the "default_viewport" which
# contains only "default_group".
s_group_name = "new1_group"
i_return_value = @
ga_viewport_group_post @
( s_viewport_name, @
s_group_name )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Unpost the group "new1_group" from the "default_viewport" which
# contains "default_group" and "new1_group".
i_return_value = @
ga_viewport_group_unpost @
( s_viewport_name, @
s_group_name )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_group_unpost_all()
#
# This file opens an existing database "view.db"
# which has three groups.It posts all the groups
# to the default viewport.Later it unposts all
# the groups from the default viewport.Finally
# it posts the default group to the viewport.
#
# Before running this session file run view.ses
# to create view.db
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_group_unpost_all()
# has the following arguments:
#
# ga_viewport_group_unpost_all
# ( viewport_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database "view.db"
uil_file_open.go("view.db")
# Post the default viewport which contains just the default group.
s_viewport_name = "default_viewport"
i_return_value = @
ga_viewport_post @
( s_viewport_name )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Post all the groups to the default viewport.
i_return_value = @
ga_viewport_group_post_all @
( s_viewport_name )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Unpost all the groups from the default viewport.
i_return_value = @
ga_viewport_group_unpost_all @
( s_viewport_name )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Post the default group to the default viewport.
i_return_value = @
ga_viewport_group_post @
( s_viewport_name, @
"default_group" )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_groups_get()
#
# This file opens a new database "new.db" and
# gets the count of groups in the default
# viewport. Later it gets the groups. The new
# database has "default_group" as the only
# group in the "default_viewport".
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_groups_get()
# has the following arguments:
#
# ga_viewport_groups_get
# ( viewport_name,
# number_of_groups )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING sa_group_list[32](VIRTUAL)
INTEGER i_number_of_groups
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#
i_return_value = @
ga_viewport_ngroups_get @
( s_viewport_name, @
i_number_of_groups )
dump i_return_value
# The number of groups are
dump i_number_of_groups
SYS_ALLOCATE_ARRAY(sa_group_list,1,i_number_of_groups)
i_return_value = @
ga_viewport_groups_get @
( s_viewport_name, @
sa_group_list )
dump i_return_value
# The list of groups are
dump sa_group_list
SYS_FREE_ARRAY(sa_group_list)
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of two calls
# to the function ga_viewport_light_post()
#
# This file opens a new database "new.db" and
# creates a surface. It posts the light "ambient"
# and "directional_1" to the viewport. It gets
# the lights posted before and after posting.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_light_post()
# has the following arguments:
#
# ga_viewport_light_post
# ( viewport_name,
# light )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_light[32]
INTEGER i_number_of_lights
STRING sa_light_list[32](2)
STRING sv_asm_create_patch_xy_created[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
# Create a surface.
asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", @
"Coord 0",sv_asm_create_patch_xy_created)
s_viewport_name = "default_viewport"
# Get the number of posted viewports.
i_return_value = @
ga_viewport_nlights_get @
( s_viewport_name, @
i_number_of_lights )
dump i_return_value
dump i_number_of_lights
# Post the ambient light.
s_light = "ambient"
i_return_value = @
ga_viewport_light_post @
( s_viewport_name, @
s_light )
dump i_return_value
# Post the "directional_1" light.
s_light = "directional_1"
i_return_value = @
ga_viewport_light_post @
( s_viewport_name, @
s_light )
dump i_return_value
# Get the number of posted lights.
i_return_value = @
ga_viewport_nlights_get @
( s_viewport_name, @
i_number_of_lights )
dump i_return_value
dump i_number_of_lights
# Get the posted lights.
i_return_value = @
ga_viewport_lights_get @
( s_viewport_name, @
sa_light_list )
dump i_return_value
dump sa_light_list
SYS_FREE_STRING(sv_asm_create_patch_xy_created)
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_light_unpost()
#
# This file opens a new database "new.db" and
# creates a surface. It posts the light "ambient"
# and "directional_1" to the viewport. Then it
# unposts the "directional_1" light.It gets
# the lights posted before and after unposting.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_light_unpost()
# has the following arguments:
#
# ga_viewport_light_unpost
# ( viewport_name,
# light )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_light[32]
INTEGER i_number_of_lights
STRING sv_asm_create_patch_xy_created[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
# Create a surface.
asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", @
"Coord 0",sv_asm_create_patch_xy_created)
s_viewport_name = "default_viewport"
# Post the ambient light.
s_light = "ambient"
i_return_value = @
ga_viewport_light_post @
( s_viewport_name, @
s_light )
dump i_return_value
# Post the "directional_1" light.
s_light = "directional_1"
i_return_value = @
ga_viewport_light_post @
( s_viewport_name, @
s_light )
dump i_return_value
# Get the number of posted viewports.
i_return_value = @
ga_viewport_nlights_get @
( s_viewport_name, @
i_number_of_lights )
dump i_return_value
dump i_number_of_lights
# Unpost the "directional_1" light.
s_light = "directional_1"
i_return_value = @
ga_viewport_light_unpost @
( s_viewport_name, @
s_light )
dump i_return_value
# Get the number of posted viewports.
i_return_value = @
ga_viewport_nlights_get @
( s_viewport_name, @
i_number_of_lights )
dump i_return_value
dump i_number_of_lights
SYS_FREE_STRING(sv_asm_create_patch_xy_created)
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of two calls
# to the function ga_viewport_lights_get()
#
# This file opens a new database "new.db" and
# creates a surface. It posts the light "ambient"
# and "directional_1" to the viewport. It gets
# the lights posted before and after posting.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_lights_post()
# has the following arguments:
#
# ga_viewport_lights_get
# ( viewport_name,
# light_list )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_light[32]
INTEGER i_number_of_lights
STRING sa_light_list[32](2)
STRING sv_asm_create_patch_xy_created[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
# Create a surface.
asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", @
"Coord 0",sv_asm_create_patch_xy_created)
s_viewport_name = "default_viewport"
# Get the number of posted viewports.
i_return_value = @
ga_viewport_nlights_get @
( s_viewport_name, @
i_number_of_lights )
dump i_return_value
dump i_number_of_lights
# Post the ambient light.
s_light = "ambient"
i_return_value = @
ga_viewport_light_post @
( s_viewport_name, @
s_light )
dump i_return_value
# Post the "directional_1" light.
s_light = "directional_1"
i_return_value = @
ga_viewport_light_post @
( s_viewport_name, @
s_light )
dump i_return_value
# Get the number of posted lights.
i_return_value = @
ga_viewport_nlights_get @
( s_viewport_name, @
i_number_of_lights )
dump i_return_value
dump i_number_of_lights
# Get the posted lights.
i_return_value = @
ga_viewport_lights_get @
( s_viewport_name, @
sa_light_list )
dump i_return_value
dump sa_light_list
SYS_FREE_STRING(sv_asm_create_patch_xy_created)
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of two calls
# to the function ga_viewport_location_get()
#
# This file opens a new database "new.db"and
# gets the location of the default viewport.
# Later it changes the location of the viewport
# and gets the location.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_location_get()
# has the following arguments:
#
# ga_viewport_location_get
# ( viewport_name,
# x,
# y )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
REAL r_x
REAL r_y
REAL r_x_s
REAL r_y_s
INTEGER i_update_control
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
s_viewport_name = "default_viewport"
i_update_control = 1
# Get the location of the viewport.
i_return_value = @
ga_viewport_location_get @
( s_viewport_name, @
r_x, @
r_y )
dump i_return_value
dump r_x
dump r_y
# Set the location of the viewport.
r_x_s = r_x + 1.0
r_y_s = r_y + 1.0
i_return_value = @
ga_viewport_location_set @
( s_viewport_name, @
r_x_s, @
r_y_s, @
i_update_control )
dump i_return_value
# Get the location of the viewport.
i_return_value = @
ga_viewport_location_get @
( s_viewport_name, @
r_x, @
r_y )
dump i_return_value
dump r_x
dump r_y
# Note the change of location of viewport on the screen.
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_location_set()
#
# This file opens a new database "new.db"and
# gets the location of the default viewport.
# Later it changes the location of the viewport
# get the location.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_location_set()
# has the following arguments:
#
# ga_viewport_location_set
# ( viewport_name,
# x,
# y,
# update_control )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
REAL r_x
REAL r_y
REAL r_x_g
REAL r_y_g
INTEGER i_update_control
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
s_viewport_name = "default_viewport"
i_update_control = 1
# Get the location of the viewport.
i_return_value = @
ga_viewport_location_get @
( s_viewport_name, @
r_x_g, @
r_y_g )
dump i_return_value
dump r_x_g
dump r_y_g
# Set the location of the viewport.
r_x = r_x_g + 1.0
r_y = r_y_g + 1.0
i_return_value = @
ga_viewport_location_set @
( s_viewport_name, @
r_x, @
r_y, @
i_update_control )
dump i_return_value
# Get the location of the viewport.
i_return_value = @
ga_viewport_location_get @
( s_viewport_name, @
r_x_g, @
r_y_g )
dump i_return_value
dump r_x_g
dump r_y_g
# Note the change of location of viewport on the screen.
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_ngroups_get()
#
# This file opens a new database "new.db" and
# gets the count of groups in the default
# viewport. Later it gets the groups. The new
# database has "default_group" as the only
# group in the "default_viewport".
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_ngroups_get()
# has the following arguments:
#
# ga_viewport_ngroups_get
# ( viewport_name,
# number_of_groups )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING sa_group_list[32](VIRTUAL)
INTEGER i_number_of_groups
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#
i_return_value = @
ga_viewport_ngroups_get @
( s_viewport_name, @
i_number_of_groups )
dump i_return_value
# The number of groups are
dump i_number_of_groups
SYS_ALLOCATE_ARRAY(sa_group_list,1,i_number_of_groups)
i_return_value = @
ga_viewport_groups_get @
( s_viewport_name, @
sa_group_list )
dump i_return_value
# The list of groups are
dump sa_group_list
SYS_FREE_ARRAY(sa_group_list)
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of two calls
# to the function ga_viewport_nlights_get()
#
# This file opens a new database "new.db" and
# creates a surface. It posts the light "ambient"
# and "directional_1" to the viewport. It gets
# the lights posted before and after posting.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_nlights_get()
# has the following arguments:
#
# ga_viewport_nlights_get
# ( viewport_name,
# number_of_lights )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_light[32]
INTEGER i_number_of_lights
STRING sa_light_list[32](2)
STRING sv_asm_create_patch_xy_created[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
# Create a surface.
asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", @
"Coord 0",sv_asm_create_patch_xy_created)
s_viewport_name = "default_viewport"
# Get the number of posted viewports.
i_return_value = @
ga_viewport_nlights_get @
( s_viewport_name, @
i_number_of_lights )
dump i_return_value
dump i_number_of_lights
# Post the ambient light.
s_light = "ambient"
i_return_value = @
ga_viewport_light_post @
( s_viewport_name, @
s_light )
dump i_return_value
# Post the "directional_1" light.
s_light = "directional_1"
i_return_value = @
ga_viewport_light_post @
( s_viewport_name, @
s_light )
dump i_return_value
# Get the number of posted lights.
i_return_value = @
ga_viewport_nlights_get @
( s_viewport_name, @
i_number_of_lights )
dump i_return_value
dump i_number_of_lights
# Get the posted lights.
i_return_value = @
ga_viewport_lights_get @
( s_viewport_name, @
sa_light_list )
dump i_return_value
dump sa_light_list
SYS_FREE_STRING(sv_asm_create_patch_xy_created)
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_nposted_get()
#
# This file opens an existing database "view.db"
# which has three viewports.Later it gets the
# number and the list of posted viewports.Finally
# it unposts one of the viewport and gets the
# number and the list of posted viewports.
#
# Before running this session file run view.ses
# to create view.db
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_nposted_get()
# has the following arguments:
#
# ga_viewport_nposted_get
# ( number_of_viewports )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_number_of_viewports
STRING sa_viewport_list[32](3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database "view.db"
uil_file_open.go("view.db")
# Get the number of viewports marked as posted.
i_return_value = @
ga_viewport_nposted_get @
( i_number_of_viewports )
dump i_return_value
# Number of viewports marked as posted.
dump i_number_of_viewports
# Get the list of posted viewports.
i_return_value = @
ga_viewport_posted_get @
( sa_viewport_list )
dump i_return_value
# The list of posted view ports.
dump sa_viewport_list
# Unpost the viewport "view2".
i_return_value = @
ga_viewport_unpost @
( "view2" )
dump i_return_value
# Get the number of viewports marked as posted.
i_return_value = @
ga_viewport_nposted_get @
( i_number_of_viewports )
dump i_return_value
# Number of viewports marked as posted.
dump i_number_of_viewports
sa_viewport_list(1) = ""
sa_viewport_list(2) = ""
sa_viewport_list(3) = ""
# Get the list of posted viewports.
i_return_value = @
ga_viewport_posted_get @
( sa_viewport_list )
dump i_return_value
# The list of posted view ports.
dump sa_viewport_list
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of two calls
# to the function ga_viewport_nviewports_get()
#
# This file opens a new database and creates
# a new viewport in addition to the existing
# "default_viewport". The created new viewport
# is visible on the screen. The count of the
# viewports before and after creation is done.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_nviewports_get()
# has the following arguments:
#
# ga_viewport_nviewports_get
# ( number_of_viewports )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
REAL r_x_location
REAL r_y_location
REAL r_width
REAL r_height
INTEGER i_number_of_viewports
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#
# Create a new viewport with x,y location (6.5,6.5),width 4.5 and
# height 3.5.
s_viewport_name = "new_viewport"
r_x_location = 6.5
r_y_location = 6.5
r_width = 4.5
r_height = 3.5
# Count the number of view ports in the database.
i_return_value = @
ga_viewport_nviewports_get @
( i_number_of_viewports )
dump i_return_value
dump i_number_of_viewports
i_return_value = @
ga_viewport_create @
( s_viewport_name, @
r_x_location, @
r_y_location, @
r_width, @
r_height )
dump i_return_value
# Count the number of view ports in the database.
i_return_value = @
ga_viewport_nviewports_get @
( i_number_of_viewports )
dump i_return_value
dump i_number_of_viewports
# Note the increase in count by 1 due to newly created viewport.
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_origin_get()
#
# This file opens a new database and gets the
# flag for origin display. Later it sets the
# origin display and gets the flag again.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_origin_get()
# has the following arguments:
#
# ga_viewport_origin_get
# ( viewport_name,
# origin_status )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
INTEGER i_origin_status
INTEGER i_origin_status_s
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
# s_viewport_name = "default_viewport".
s_viewport_name = "default_viewport"
# Get the origin display flag.
i_return_value = @
ga_viewport_origin_get @
( s_viewport_name, @
i_origin_status )
dump i_return_value
# The origin display flag is
dump i_origin_status
IF( i_origin_status == 1) THEN
i_origin_status_s = 0
ELSE
i_origin_status_s = 1
END IF
# Note the change in viewport for the origin display.
# Session file paused. Press "Resume" to continue..
sf_pause()
# Set the axis display flag.
i_return_value = @
ga_viewport_origin_set @
( s_viewport_name, @
i_origin_status_s )
dump i_return_value
# Get the origin display flag.
i_return_value = @
ga_viewport_origin_get @
( s_viewport_name, @
i_origin_status )
dump i_return_value
# The origin display flag is
dump i_origin_status
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_origin_set()
#
# This file opens a new database and gets the
# flag for origin display. Later it sets the
# origin display and gets the flag again.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_origin_set()
# has the following arguments:
#
# ga_viewport_origin_set
# ( viewport_name,
# origin_status )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
INTEGER i_origin_status
INTEGER i_origin_status_g
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
# s_viewport_name = "default_viewport".
s_viewport_name = "default_viewport"
# Get the origin display flag.
i_return_value = @
ga_viewport_origin_get @
( s_viewport_name, @
i_origin_status_g )
dump i_return_value
# The origin display flag is
dump i_origin_status_g
IF( i_origin_status_g == 1) THEN
i_origin_status = 0
ELSE
i_origin_status = 1
END IF
# Note the change in viewport for the origin display.
# Session file paused. Press "Resume" to continue..
sf_pause()
# Set the axis display flag.
i_return_value = @
ga_viewport_origin_set @
( s_viewport_name, @
i_origin_status )
dump i_return_value
# Get the origin display flag.
i_return_value = @
ga_viewport_origin_get @
( s_viewport_name, @
i_origin_status_g )
dump i_return_value
# The origin display flag is
dump i_origin_status_g
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call
# to the function ga_viewport_post()
#
# This file opens a new database "new.db" and
# and creates a viewport "new_viewport". Later
# it unposts the viewport and finally posts it.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_post()
# has the following arguments:
#
# ga_viewport_post
# ( viewport_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
REAL r_x_location
REAL r_y_location
REAL r_width
REAL r_height
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
# Create a new viewport
s_viewport_name = "new_viewport"
r_x_location = 6.5
r_y_location = 6.5
r_width = 4.5
r_height = 3.5
i_return_value = @
ga_viewport_create @
( s_viewport_name, @
r_x_location, @
r_y_location, @
r_width, @
r_height )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Unpost the viewport "new_viewport"
i_return_value = @
ga_viewport_unpost @
( s_viewport_name )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Post the viewport "new_view"
i_return_value = @
ga_viewport_post @
( s_viewport_name )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_posted_get()
#
# This file opens an existing database "view.db"
# which has three viewports.Later it gets the
# number and the list of posted viewports.Finally
# it unposts one of the viewport and gets the
# number and the list of posted viewports.
#
# Before running this session file run view.ses
# to create view.db
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_posted_get()
# has the following arguments:
#
# ga_viewport_posted_get
# ( viewport_list )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_number_of_viewports
STRING sa_viewport_list[32](3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database "view.db"
uil_file_open.go("view.db")
# Get the number of viewports marked as posted.
i_return_value = @
ga_viewport_nposted_get @
( i_number_of_viewports )
dump i_return_value
# Number of viewports marked as posted.
dump i_number_of_viewports
# Get the list of posted viewports.
i_return_value = @
ga_viewport_posted_get @
( sa_viewport_list )
dump i_return_value
# The list of posted view ports.
dump sa_viewport_list
# Unpost the viewport "view2".
i_return_value = @
ga_viewport_unpost @
( "view2" )
dump i_return_value
# Get the number of viewports marked as posted.
i_return_value = @
ga_viewport_nposted_get @
( i_number_of_viewports )
dump i_return_value
# Number of viewports marked as posted.
dump i_number_of_viewports
sa_viewport_list(1) = ""
sa_viewport_list(2) = ""
sa_viewport_list(3) = ""
# Get the list of posted viewports.
i_return_value = @
ga_viewport_posted_get @
( sa_viewport_list )
dump i_return_value
# The list of posted view ports.
dump sa_viewport_list
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_range_get()
#
# This file opens a new database "new.db" and
# gets the name of the range used for displaying
# the results posted to the viewport. Later it
# creates a new range and sets this range to the
# viewport. Finally it again gets the name
# of the range.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_range_get()
# has the following arguments:
#
# ga_viewport_range_get
# ( viewport_list,
# range )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_range[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
s_viewport_name = "default_viewport"
# Get the name of the range.
i_return_value = @
ga_viewport_range_get @
( s_viewport_name, @
s_range )
dump i_return_value
dump s_range
# Create a new range.
i_return_value = @
ga_range_create @
( "new_range", @
10 )
dump i_return_value
# Set the range "new_range" to "default_viewport".
i_return_value = @
ga_viewport_range_set @
( s_viewport_name, @
"new_range" )
dump i_return_value
# Get the name of the range.
i_return_value = @
ga_viewport_range_get @
( s_viewport_name, @
s_range )
dump i_return_value
dump s_range
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_range_set()
#
# This file opens a new database "new.db" and
# gets the name of the range used for displaying
# the results posted to the viewport. Later it
# creates a new range and sets this range to the
# viewport. Finally it again gets the name
# of the range.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_range_set()
# has the following arguments:
#
# ga_viewport_range_set
# ( viewport_list,
# range )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_range_g[32]
STRING s_range[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
s_viewport_name = "default_viewport"
# Get the name of the range.
i_return_value = @
ga_viewport_range_get @
( s_viewport_name, @
s_range_g )
dump i_return_value
dump s_range_g
# Create a new range.
s_range = "new_range"
i_return_value = @
ga_range_create @
( s_range, @
10 )
dump i_return_value
# Set the name of the range to new_range.
i_return_value = @
ga_viewport_range_set @
( s_viewport_name, @
s_range )
dump i_return_value
# Get the name of the range.
i_return_value = @
ga_viewport_range_get @
( s_viewport_name, @
s_range_g )
dump i_return_value
dump s_range_g
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_rename()
#
# This file opens a new database "new.db" and
# gets the viewport name. Later it renames the
# viewport and gets the changed name.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_rename()
# has the following arguments:
#
# ga_viewport_rename
# ( original_name,
# new_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_original_name[32]
STRING s_new_name[32]
STRING sa_viewport_list[32](1)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
# Get the name of the viewport.
i_return_value = @
ga_viewport_viewports_get @
( sa_viewport_list )
dump i_return_value
# The name of the viewport before renaming.
dump sa_viewport_list
s_original_name = sa_viewport_list(1)
# Rename the viewport.
s_new_name = "renamed_viewport"
i_return_value = @
ga_viewport_rename @
( s_original_name, @
s_new_name )
dump i_return_value
# Get the name of the viewport.
i_return_value = @
ga_viewport_viewports_get @
( sa_viewport_list )
dump i_return_value
# The name of the viewport after renaming.
dump sa_viewport_list
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of two calls
# to the function ga_viewport_size_get()
#
# This file opens a new database "new.db" and
# gets the size of the default viewport. Later
# it resizes the viewport to half its size and
# gets the size.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_size_get()
# has the following arguments:
#
# ga_viewport_size_get
# ( viewport_name,
# width,
# height )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
REAL r_width
REAL r_height
REAL r_width_s
REAL r_height_s
INTEGER i_update_control
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
s_viewport_name = "default_viewport"
i_update_control = 1
# Get the viewport size.
i_return_value = @
ga_viewport_size_get @
( s_viewport_name, @
r_width, @
r_height )
dump i_return_value
# The viewport sizes are
dump r_width
dump r_height
# Set the viewport size to half of the original size.
r_width_s = r_width/2
r_height_s = r_height/2
i_return_value = @
ga_viewport_size_set @
( s_viewport_name, @
r_width_s, @
r_height_s, @
i_update_control )
dump i_return_value
# Get the viewport size.
i_return_value = @
ga_viewport_size_get @
( s_viewport_name, @
r_width, @
r_height )
dump i_return_value
# The viewport sizes are
dump r_width
dump r_height
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_size_set()
#
# This file opens a new database "new.db" and
# gets the size of the default viewport. Later
# it resizes the viewport to half its size and
# gets the size.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_size_set()
# has the following arguments:
#
# ga_viewport_size_set
# ( viewport_name,
# width,
# height,
# update_control )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
REAL r_width
REAL r_height
REAL r_width_g
REAL r_height_g
INTEGER i_update_control
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
s_viewport_name = "default_viewport"
i_update_control = 1
# Get the viewport size.
i_return_value = @
ga_viewport_size_get @
( s_viewport_name, @
r_width_g, @
r_height_g )
dump i_return_value
# The viewport sizes are
dump r_width_g
dump r_height_g
# Set the viewport size to half of the original size.
r_width = r_width_g/2
r_height = r_height_g/2
i_return_value = @
ga_viewport_size_set @
( s_viewport_name, @
r_width, @
r_height, @
i_update_control )
dump i_return_value
# Get the viewport size.
i_return_value = @
ga_viewport_size_get @
( s_viewport_name, @
r_width_g, @
r_height_g )
dump i_return_value
# The viewport sizes are
dump r_width_g
dump r_height_g
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of two calls
# to the function ga_viewport_spectrum_get()
#
# This file opens a new database "new.db" and
# gets the posting status of the spectrum to
# the viewport. Later it changes the posting
# status and finally gets the status.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_spectrum_get()
# has the following arguments:
#
# ga_viewport_spectrum_get
# ( viewport_name,
# spectrum_status )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
INTEGER i_spectrum_status
INTEGER i_spectrum_status_s
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#
# Get the spectrum status.
i_return_value = @
ga_viewport_spectrum_get @
( s_viewport_name, @
i_spectrum_status )
dump i_return_value
dump i_spectrum_status
IF ( i_spectrum_status == 0 ) THEN
i_spectrum_status_s = 1
ELSE
i_spectrum_status_s = 0
END IF
# Session file paused. Press "Resume" to continue..
# Note the change of spectrum status on the viewport after
# resuming the session file.
sf_pause()
# Set the spectrum status.
i_return_value = @
ga_viewport_spectrum_set @
( s_viewport_name, @
i_spectrum_status_s )
dump i_return_value
# Get the spectrum status.
i_return_value = @
ga_viewport_spectrum_get @
( s_viewport_name, @
i_spectrum_status )
dump i_return_value
dump i_spectrum_status
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_spectrum_set()
#
# This file opens a new database "new.db" and
# gets the posting status of the spectrum to
# the viewport. Later it changes the posting
# status and finally gets the status.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_spectrum_set()
# has the following arguments:
#
# ga_viewport_spectrum_set
# ( viewport_name,
# spectrum_status )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
INTEGER i_spectrum_status
INTEGER i_spectrum_status_g
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#
# Get the spectrum status.
i_return_value = @
ga_viewport_spectrum_get @
( s_viewport_name, @
i_spectrum_status_g )
dump i_return_value
dump i_spectrum_status_g
IF ( i_spectrum_status_g == 0 ) THEN
i_spectrum_status = 1
ELSE
i_spectrum_status = 0
END IF
# Session file paused. Press "Resume" to continue..
# Note the change of spectrum status on the viewport after resuming
# the session file.
sf_pause()
# Set the spectrum status.
i_return_value = @
ga_viewport_spectrum_set @
( s_viewport_name, @
i_spectrum_status )
dump i_return_value
# Get the spectrum status.
i_return_value = @
ga_viewport_spectrum_get @
( s_viewport_name, @
i_spectrum_status_g )
dump i_return_value
dump i_spectrum_status_g
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_title_post()
#
# This file opens a new database "new.db" and
# creates the title "VIEWPORT_TITLE" and posts
# on the default viewport. Later it unposts
# the title.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_title_post()
# has the following arguments:
#
# ga_viewport_title_post
# ( viewport_name,
# title )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_title[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#
s_viewport_name = "default_viewport"
s_title = "VIEWPORT_TITLE"
i_return_value = @
ga_title_create @
( s_title, @
3.0, @
5.0, @
2, @
16 )
dump i_return_value
i_return_value = @
ga_viewport_title_post @
( s_viewport_name, @
s_title )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Unpost the title
i_return_value = @
ga_viewport_title_unpost @
( s_viewport_name, @
s_title )
dump i_return_value
# Note that the tile has been unposted from the viewport.
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_title_unpost()
#
# This file opens a new database "new.db" and
# creates the title "VIEWPORT_TITLE" and posts
# it on the default viewport. Later it unposts
# the title.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_title_unpost()
# has the following arguments:
#
# ga_viewport_title_unpost
# ( viewport_name,
# title )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_title[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
s_viewport_name = "default_viewport"
s_title = "VIEWPORT_TITLE"
i_return_value = @
ga_title_create @
( s_title, @
3.0, @
5.0, @
2, @
16 )
dump i_return_value
# Post the title.
i_return_value = @
ga_viewport_title_post @
( s_viewport_name, @
s_title )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Unpost the title.
i_return_value = @
ga_viewport_title_unpost @
( s_viewport_name, @
s_title )
dump i_return_value
# Note that the tile has been unposted from the viewport.
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of two calls
# to the function ga_viewport_unpost()
#
# This file opens an existing database "view.db"
# which has three viewports. This file unposts
# two viewports in succession.
#
# Before running this session file run view.ses
# to create view.db
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_unpost()
# has the following arguments:
#
# ga_viewport_unpost
# ( viewport_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database "view.db"
uil_file_open.go("view.db")
# Observe the three viewports.
# Session file paused. Press "Resume" to continue..
sf_pause()
# Unpost the viewport "view2"
s_viewport_name = "view2"
i_return_value = @
ga_viewport_unpost @
( s_viewport_name )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Unpost the viewport "view1"
s_viewport_name = "view1"
i_return_value = @
ga_viewport_unpost @
( s_viewport_name )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_view_get()
#
# This file opens a new database "new.db" and
# creates a surface and rotates it. Later it
# creates a new view and assign the present
# viewport view to the new view. Then it sets
# the default view to the viewport. Finally it
# sets the new view to the viewport.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_view_get()
# has the following arguments:
#
# ga_viewport_view_get
# ( viewport_name,
# name_of_view )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_name_of_view[32]
STRING sv_asm_create_patch_xy_created[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
s_viewport_name = "default_viewport"
s_name_of_view = "new_view"
# Create a surface and rotate it.
asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", @
"Coord 0", sv_asm_create_patch_xy_created )
ga_view_aa_set( -149.988297, 47.723133, -160.791473 )
# Create a new view.
i_return_value = @
ga_view_create @
( s_name_of_view, @
s_viewport_name )
dump i_return_value
# Assign a view name to the current view parameters.
i_return_value = @
ga_viewport_view_get @
( s_viewport_name, @
s_name_of_view )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Set the default_view to the viewport.
s_name_of_view = "default_view"
i_return_value = @
ga_viewport_view_set @
( s_viewport_name, @
s_name_of_view )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Set the new_view to the viewport.
s_name_of_view = "new_view"
i_return_value = @
ga_viewport_view_set @
( s_viewport_name, @
s_name_of_view )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_patch_xy_created)
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_view_name()
#
# This file opens a new database "new.db" and
# gets the name of the view of the default
# view port.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_view_name()
# has the following arguments:
#
# ga_viewport_view_name
# ( viewport_name,
# name_of_view )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_name_of_view[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
s_viewport_name = "default_viewport"
i_return_value = @
ga_viewport_view_name @
( s_viewport_name, @
s_name_of_view )
dump i_return_value
# The name of the view in the viewport is
dump s_name_of_view
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of two calls
# to the function ga_viewport_view_set()
#
# This file opens a new database "new.db" and
# creates a surface and rotates it. Later it
# creates a new view and assign the present
# viewport view to the new view. Then it sets
# the default view to the viewport. Finally it
# sets the new view to the viewport.
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_view_set()
# has the following arguments:
#
# ga_viewport_view_set
# ( viewport_name,
# name_of_view )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport_name[32]
STRING s_name_of_view[32]
STRING sv_asm_create_patch_xy_created[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
s_viewport_name = "default_viewport"
s_name_of_view = "new_view"
# Create a new view.
i_return_value = @
ga_view_create @
( s_name_of_view, @
s_viewport_name )
dump i_return_value
# Create a surface and rotate it.
asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", @
"Coord 0", sv_asm_create_patch_xy_created )
ga_view_aa_set( -149.988297, 47.723133, -160.791473 )
# Assign a view name to the current view parameters.
i_return_value = @
ga_viewport_view_get @
( s_viewport_name, @
s_name_of_view )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Set the new_view to the viewport.
s_name_of_view = "default_view"
i_return_value = @
ga_viewport_view_set @
( s_viewport_name, @
s_name_of_view )
dump i_return_value
# Session file paused. Press "Resume" to continue..
sf_pause()
# Set the new_view to the viewport.
s_name_of_view = "new_view"
i_return_value = @
ga_viewport_view_set @
( s_viewport_name, @
s_name_of_view )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_patch_xy_created)
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function ga_viewport_viewports_get()
#
# This file opens a existing database "view.db"
# which has three viewports. Later it gets the
# number and the list of viewports in the
# database.
#
# Before running this session file run view.ses
# to create view.db
#
# This file can be run by starting a session of
# Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function ga_viewport_viewports_get()
# has the following arguments:
#
# ga_viewport_viewports_get
# ( viewportlist )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING sa_viewportlist[32](VIRTUAL)
INTEGER i_number_of_viewports
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database "view.db"
uil_file_open.go("view.db")
# Get the number of viewports in the database.
i_return_value = @
ga_viewport_nviewports_get @
( i_number_of_viewports )
dump i_return_value
dump i_number_of_viewports
SYS_ALLOCATE_ARRAY(sa_viewportlist,1,i_number_of_viewports)
# Get the list of viewports.
i_return_value = @
ga_viewport_viewports_get @
( sa_viewportlist )
dump i_return_value
dump sa_viewportlist
SYS_FREE_ARRAY(sa_viewportlist)
#---------------------------------------------------------------------