PCL Examples > XY Plot Functions > Post Action
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Post Action
This section contains examples of some of the functions used to implement the “Post” actions.
  
()
#
#  Purpose          :  This file provides example of  two calls to the
#                      function xy_curve_nposted_get()
#
#                      This file opens a new database "new.db" and
#                      creates a window. Later it gets the number of
#                      posted curves in the database. Finally it
#                      creates a curve and gets the number of posted
#                      curves again.
#
#                      This file can be run by starting a session of
#                      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 xy_curve_nposted_get()
#  has the following arguments:
#
#  xy_curve_nposted_get
#     (  nposted )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_nposted
INTEGER  i_return_value
STRING   s_window_name[32]
REAL     r_x_location
REAL     r_y_location
REAL     r_width
REAL     r_height
#---------------------------------------------------------------------
#  Opening new database new.db
uil_file_new.go("","new.db")
$? YES 36000002
 
#  Create a new window.
s_window_name  = "XY_Window"
r_x_location   = 2.5
r_y_location   = 3.5
r_width        = 5.0
r_height       = 5.0
i_return_value =                                 @
   xy_window_create                              @
      (  s_window_name,                          @
         r_x_location,                           @
         r_y_location,                           @
         r_width,                                @
         r_height )
dump i_return_value
 
#  Get the number of posted curves
i_return_value =                                 @
   xy_curve_nposted_get( i_nposted)
dump i_return_value
dump i_nposted
#---------------------------------------------------------------------
#  Session file paused. Press "Resume" to continue..
sf_pause()
#---------------------------------------------------------------------
# Create a curve
i_return_value =                                 @
   xy_curve_create( "curve_1", "data of x vs y", 1)
dump i_return_value
 
i_return_value =                                 @
   xy_curve_data_set                             @
      (  "curve_1", FALSE, 10, [1., 2., 3., 4.,  @
         5., 6., 7., 8., 9., 10.], [-5., 6., 4., @
         -10., -7., 10., 15., 23., -20., -11.])
dump i_return_value
#---------------------------------------------------------------------
#  Get the number of posted curves
i_return_value =                                 @
   xy_curve_nposted_get( i_nposted)
dump i_return_value
dump i_nposted
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function xy_curve_posted_get()
#
#                      This file opens a new database "new.db" and
#                      creates a window and a curve in it. The above
#                      mentioned function is called to get the list of
#                      posted curves from the database.
#                      
#                      This file can be run by starting a session of
#                      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 xy_curve_posted_get()
#  has the following arguments:
#
#  xy_curve_posted_get
#     (  posted_list )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   sav_posted_list[32](VIRTUAL)
INTEGER  i_return_value
STRING   s_window_name[32]
REAL     r_x_location
REAL     r_y_location
REAL     r_width
REAL     r_height
INTEGER  i_nposted
#---------------------------------------------------------------------
#  Opening new database new.db
uil_file_new.go("","new.db")
$? YES 36000002
 
#  Create a new window.
s_window_name  = "XY_Window"
r_x_location   = 2.5
r_y_location   = 3.5
r_width        = 5.0
r_height       = 5.0
i_return_value =                                 @
   xy_window_create                              @
      (  s_window_name,                          @
         r_x_location,                           @
         r_y_location,                           @
         r_width,                                @
         r_height )
dump i_return_value
#---------------------------------------------------------------------
# Create a curve
i_return_value =                                 @
   xy_curve_create("curve_1", "data of x vs y", 1)
dump i_return_value
 
i_return_value =                                 @
   xy_curve_data_set                             @
      (  "curve_1", FALSE, 10, [1., 2., 3., 4.,  @
         5., 6., 7., 8., 9., 10.], [-5., 6., 4., @
         -10., -7., 10., 15., 23., -20., -11.])
dump i_return_value
#---------------------------------------------------------------------
#  Get the number of posted curves
i_return_value =                                 @
   xy_curve_nposted_get( i_nposted)
dump i_return_value
 
#  Get the list of posted curves
sys_allocate_array( sav_posted_list, 1, i_nposted)
 
i_return_value =                                 @
   xy_curve_posted_get                           @
      ( sav_posted_list)
dump i_return_value
dump sav_posted_list
 
sys_free_array(sav_posted_list)
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of two call to 
#                      the function xy_title_nposted_get()
#
#                      This session file opens a new database ’new.db’
#                      and creates a xy window. The above mentioned
#                      function is called to get the number of posted
#                      titles in the database. A new title is then
#                      created and again the above mentioned function
#                      is called to get the number of posted titles.
#                      
#                      This file can be run by starting a session of
#                      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 xy_title_nposted_get()
#  has the following arguments:
#
#  xy_title_nposted_get
#     (  nposted )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_nposted
INTEGER  i_return_value
STRING   s_window_name[32]
REAL     r_x_location
REAL     r_y_location
REAL     r_width
REAL     r_height
#---------------------------------------------------------------------
#  Opening new database new.db
uil_file_new.go("","new.db")
$? YES 36000002
 
#  Create a new window.
s_window_name  = "XY_Window"
r_x_location   = 2.5
r_y_location   = 3.5
r_width        = 5.0
r_height       = 5.0
i_return_value =                                 @
   xy_window_create                              @
      (  s_window_name,                          @
         r_x_location,                           @
         r_y_location,                           @
         r_width,                                @
         r_height )
dump i_return_value
 
#  Get the number of posted titles
i_return_value =                                 @
   xy_title_nposted_get                          @
      (i_nposted)
dump i_return_value
dump i_nposted
#---------------------------------------------------------------------
#  Session file paused. Press "Resume" to continue..
sf_pause()
#---------------------------------------------------------------------
#  Create a title
i_return_value =                                 @
   xy_title_create                               @
      ( "TITLE_1", "TITLE_1", 14,[5.0, 10.0], 1)
dump i_return_value
#---------------------------------------------------------------------
#  Get the number of posted titles
i_return_value =                                 @
   xy_title_nposted_get                          @
      (  i_nposted )
dump i_return_value
dump i_nposted
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function xy_title_posted_get()
#
#                      This session file opens a new database ’new.db’
#                      and creates a new xy window. Two new titles are
#                      created and posted to the xy window. The above 
#                      mentioned function is called to get the list of
#                      posted titles.
#                      
#                      This file can be run by starting a session of
#                      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 xy_title_posted_get()
#  has the following arguments:
#
#  xy_title_posted_get
#     (  posted_list )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   sav_posted_list[32](VIRTUAL)
INTEGER  i_return_value
STRING   s_window_name[32]
REAL     r_x_location
REAL     r_y_location
REAL     r_width
REAL     r_height
INTEGER  i_nposted
#---------------------------------------------------------------------
#  Opening new database new.db
uil_file_new.go("","new.db")
$? YES 36000002
 
#  Create a new window.
s_window_name  = "XY_Window"
r_x_location   = 2.5
r_y_location   = 3.5
r_width        = 5.0
r_height       = 5.0
i_return_value =                                 @
   xy_window_create                              @
      (  s_window_name,                          @
         r_x_location,                           @
         r_y_location,                           @
         r_width,                                @
         r_height )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create two titles
i_return_value =                                 @
   xy_title_create                               @
      ( "TITLE_1", "TITLE_1", 14,[5.0, 10.0], 1)
dump i_return_value
 
i_return_value =                                 @
   xy_title_create                               @
      ( "TITLE_2", "TITLE_2", 14,[5.0, 20.0], 1)
dump i_return_value
 
#---------------------------------------------------------------------
#  Get the number of posted titles
i_return_value =                                 @
   xy_title_nposted_get( i_nposted)
dump i_return_value
 
#  Get the list of posted titles
sys_allocate_array( sav_posted_list, 1, i_nposted)
 
i_return_value =                                 @
   xy_title_posted_get                           @
      ( sav_posted_list)
dump i_return_value
dump sav_posted_list
 
sys_free_array(sav_posted_list)
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function xy_window_curve_post()
#
#                      This session file opens a new database ’new.db’
#                      and creates two xy windows. A curve is created 
#                      in the second xy window. The above mentioned 
#                      function is called to post this curve to the
#                      first xy window.
#                      
#                      This file can be run by starting a session of
#                      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 xy_window_curve_post()
#  has the following arguments:
#
#  xy_window_curve_post
#     (  window_name,
#        curve_name )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_window_name[32]
STRING   s_curve_name[32]
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Opening new database new.db
uil_file_new.go("","new.db")
$? YES 36000002
 
#  Create two xy windows
s_window_name  = "XY_Window1"
i_return_value =                                 @
   xy_window_create                              @
      (  s_window_name, 1.5, 3.5, 5., 5.)
dump i_return_value
 
s_window_name  = "XY_Window2"
i_return_value =                                 @
   xy_window_create                              @
      (  s_window_name, 6.5, 3.5, 5., 5.)
dump i_return_value
#---------------------------------------------------------------------
# Create a curve in the second window
i_return_value =                                 @
   xy_curve_create( "curve_1", "data of x vs y", 1)
dump i_return_value
 
i_return_value =                                 @
   xy_curve_data_set                             @
      (  "curve_1", FALSE, 10, [1., 2., 3., 4.,  @
         5., 6., 7., 8., 9., 10.], [-5., 6., 4., @
         -10., -7., 10., 15., 23., -20., -11.])
dump i_return_value
#---------------------------------------------------------------------
#  Session file paused press ’Resume’ to continue
sf_pause()
#---------------------------------------------------------------------
#  Post the curve to the first window
s_window_name  = "XY_Window1"
s_curve_name   = "curve_1"
 
i_return_value =                                 @
   xy_window_curve_post                          @
      (  s_window_name,                          @
         s_curve_name )
dump i_return_value
#---------------------------------------------------------------------
  
()
#  Purpose          :  This file provides an example of a call to the
#                      function xy_window_curve_unpost()
#
#                      This session file opens a new database ’new.db’
#                      and a new xy window is created. A new curve is
#                      created and the number of posted curves is get.
#                      The above mentioned function is then called to
#                      unpost the curve from the xy window. The number
#                      of posted curves is get again.
#                      
#                      This file can be run by starting a session of
#                      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 xy_window_curve_unpost()
#  has the following arguments:
#
#  xy_window_curve_unpost
#     (  window_name,
#        curve_name )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_window_name[32]
STRING   s_curve_name[32]
INTEGER  i_return_value
INTEGER  i_nposted
#---------------------------------------------------------------------
#  Opening new database new.db
uil_file_new.go("","new.db")
$? YES 36000002
 
#  Create a new window.
s_window_name  = "XY_Window1"
i_return_value =                                 @
   xy_window_create                              @
      (  s_window_name, 1.5, 3.5, 5., 5.)
dump i_return_value
#---------------------------------------------------------------------
# Create a curve and get the number of posted curves
i_return_value =                                 @
   xy_curve_create ( "curve_1", "data of x vs y", 1)
dump i_return_value
 
i_return_value =                                 @
   xy_curve_data_set                             @
      (  "curve_1", FALSE, 10, [1., 2., 3., 4.,  @
         5., 6., 7., 8., 9., 10.], [-5., 6., 4., @
         -10., -7., 10., 15., 23., -20., -11.])
dump i_return_value
 
i_return_value =                                 @
   xy_curve_nposted_get( i_nposted)
dump i_return_value
dump i_nposted
#---------------------------------------------------------------------
#  Session file paused press ’Resume’ to continue
sf_pause()
#---------------------------------------------------------------------
#  Unpost the current curve from the window
s_window_name  = "XY_Window1"
s_curve_name   = "curve_1"
 
i_return_value =                                 @
   xy_window_curve_unpost                        @
      (  s_window_name,                          @
         s_curve_name )
dump i_return_value
 
# Get the number of posted curves again
i_return_value =                                 @
   xy_curve_nposted_get( i_nposted)
dump i_return_value
dump i_nposted
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function xy_window_title_post()
#
#                      This session file opens a new database ’new.db’
#                      and creates two xy windows. A title is created 
#                      in the second xy window. The above mentioned 
#                      function is called to post this title to the
#                      first xy window.
#
#                      This file can be run by starting a session of
#                      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 xy_window_title_post()
#  has the following arguments:
#
#  xy_window_title_post
#     (  window_name,
#        title_name )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_window_name[32]
STRING   s_title_name[256]
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Opening new database new.db
uil_file_new.go("","new.db")
$? YES 36000002
 
#  Create two xy windows
s_window_name  = "XY_Window1"
i_return_value =                                 @
   xy_window_create                              @
      (  s_window_name, 1.5, 3.5, 5., 5.)
dump i_return_value
 
s_window_name  = "XY_Window2"
i_return_value =                                 @
   xy_window_create                              @
      (  s_window_name, 6.5, 3.5, 5., 5.)
dump i_return_value
 
#---------------------------------------------------------------------
#  Create a title
i_return_value =                                 @
   xy_title_create                               @
      ( "TITLE_1", "TITLE_1", 40,[5.0, 20.0], 1)
dump i_return_value
#---------------------------------------------------------------------
#  Session file paused. Press "Resume" to continue..
sf_pause()
#---------------------------------------------------------------------
#  Post the title to the first window
s_window_name  = "XY_Window1"
s_title_name   = "TITLE_1"
 
i_return_value =                                 @
   xy_window_title_post                          @
      (  s_window_name,                          @
         s_title_name )
dump i_return_value
 
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function xy_window_title_unpost()
#
#                      This session file opens a new database ’new.db’
#                      and a new xy window is created. A new title is
#                      created and the number of posted titles is get.
#                      The above mentioned function is then called to
#                      unpost the title from the xy window. The number
#                      of posted titles is get again.
#                      
#                      This file can be run by starting a session of
#                      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 xy_window_title_unpost()
#  has the following arguments:
#
#  xy_window_title_unpost
#     (  window_name,
#        title_name )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_window_name[32]
STRING   s_title_name[256]
INTEGER  i_return_value
INTEGER  i_nposted
#---------------------------------------------------------------------
#  Opening new database new.db
uil_file_new.go("","new.db")
$? YES 36000002
 
#  Create a new window.
s_window_name  = "XY_Window1"
i_return_value =                                 @
   xy_window_create                              @
      (  s_window_name, 1.5, 3.5, 5., 5.)
dump i_return_value
#---------------------------------------------------------------------
# Create a title and get the number of posted titles
i_return_value =                                 @
   xy_title_create                               @
      ( "TITLE_1", "TITLE_1", 40,[5.0, 20.0], 1)
dump i_return_value
 
i_return_value =                                 @
   xy_title_nposted_get( i_nposted)
dump i_return_value
dump i_nposted
#---------------------------------------------------------------------
#  Session file paused press ’Resume’ to continue
sf_pause()
#---------------------------------------------------------------------
#  Unpost the current title from the window
s_window_name  = "XY_Window1"
s_title_name   = "TITLE_1"
 
i_return_value =                                 @
   xy_window_title_unpost                        @
      (  s_window_name,                          @
         s_title_name )
dump i_return_value
 
# Get the number of posted titles again
i_return_value =                                 @
   xy_title_nposted_get( i_nposted)
dump i_return_value
dump i_nposted
#---------------------------------------------------------------------