PCL Examples > Finite Element Functions > Disassociate Action
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Disassociate Action
This section contains examples of some of the functions used to disassociate the identifiers used to reference a selection of finite element model (FEM) nodes or elements.
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function fem_disassoc_geo()
#
#                      This session file creates a new database by
#                      name new.db. A line is created and is meshed
#                      to create FEM entities associated with the
#                      geometry. This function is then called to
#                      disassociate all the elements from the line.
#
#                      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 fem_disassoc_geo()
#  has the following arguments:
#
#  fem_disassoc_geo
#     (  nodes,
#        elements,
#        geo_list )
#
#---------------------------------------------------------------------
#  Variable Declarations
LOGICAL  l_nodes
LOGICAL  l_elements
STRING   sv_geo_list[VIRTUAL]
STRING   sv_created_ids[VIRTUAL]
INTEGER  i_num_fem_nodes
INTEGER  i_num_fem_elements
STRING   sv_fem_nodes_created[VIRTUAL]
STRING   sv_fem_elements_created[VIRTUAL]
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
 
#---------------------------------------------------------------------
#  Create a line
 
i_return_value =                                 @
   asm_const_line_2point                         @
      (  "1", "[2 2 0]", "[8 2 0]", 0, "", 50., 1, sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Mesh the line to create associated FEM entities
 
i_return_value =                                 @
   fem_create_mesh_curv                          @
      (  "Curve 1 ", 1., "Bar2", "1",            @
         "1", "Coord 0", "Coord 0",              @
         i_num_fem_nodes, i_num_fem_elements,    @
         sv_fem_nodes_created, sv_fem_elements_created)
dump i_return_value
 
node_label( TRUE )
bar_elem_label( TRUE )
 
#---------------------------------------------------------------------
#  Disassociate all the elements associated with the line
#
l_nodes     = FALSE
l_elements  = TRUE
sv_geo_list = "Curve 1"
 
i_return_value =                                 @
   fem_disassoc_geo                              @
      (  l_nodes,                                @
         l_elements,                             @
         sv_geo_list )
dump i_return_value
 
#---------------------------------------------------------------------
#
#  For confirming that elements have been disassociated, access the
#  form given by "Finite Elements", set Action switch to "Show",
#  Object switch to "Element" and the Method switch to "Attributes".
#  Give Element List as "Elm 1:6".
#
#---------------------------------------------------------------------
sys_free_string(sv_geo_list)
sys_free_string(sv_created_ids)
sys_free_string(sv_fem_nodes_created)
sys_free_string(sv_fem_elements_created)
 
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function fem_disassoc_ids()
#
#                      This session file creates a new database by
#                      name new.db. A line is created and is meshed
#                      to create FEM entities associated with the
#                      geometry. This function is then called to
#                      disassociate the specified FEM entities.
#
#                      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 fem_disassoc_ids()
#  has the following arguments:
#
#  fem_disassoc_ids
#     (  option,
#        fem_list )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_option
STRING   sv_fem_list[VIRTUAL]
STRING   sv_created_ids[VIRTUAL]
INTEGER  i_num_fem_nodes
INTEGER  i_num_fem_elements
STRING   sv_fem_nodes_created[VIRTUAL]
STRING   sv_fem_elements_created[VIRTUAL]
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
 
#---------------------------------------------------------------------
#  Create a line
 
i_return_value =                                 @
   asm_const_line_2point                         @
      (  "1", "[2 2 0]", "[8 2 0]", 0, "", 50., 1, sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Mesh the line to create associated FEM entities
 
i_return_value =                                 @
   fem_create_mesh_curv                          @
      (  "Curve 1 ", 1., "Bar2", "1",            @
         "1", "Coord 0", "Coord 0",              @
         i_num_fem_nodes, i_num_fem_elements,    @
         sv_fem_nodes_created, sv_fem_elements_created)
dump i_return_value
 
node_label( TRUE )
bar_elem_label( TRUE )
 
#---------------------------------------------------------------------
#  Disassociate some elements from the line
#
i_option    = 1
sv_fem_list = "Elem 1:4"
 
i_return_value =                                 @
   fem_disassoc_ids                              @
      (  i_option,                               @
         sv_fem_list )
dump i_return_value
 
#---------------------------------------------------------------------
#
#  For confirming that elements have been disassociated, access the
#  form given by "Finite Elements", set Action switch to "Show",
#  Object switch to "Element" and the Method switch to "Attributes".
#  Give Element List as "Elm 1:6".
#
#---------------------------------------------------------------------
 
sys_free_string(sv_fem_list)
sys_free_string(sv_created_ids)
sys_free_string(sv_fem_nodes_created)
sys_free_string(sv_fem_elements_created)
 
#---------------------------------------------------------------------