PCL Examples > Property Assignment Functions > Element Properties
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Element Properties
This section contains examples of some of the functions that pertain to element properties.
 
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function elementprops_create()
#
#                      This function creates an element property set.
#
#                      In this example a new database is opened. A
#                      cuboid of dimension 5 X 1 X 1 is created and
#                      meshed.Then a material("Aluminium") is created.
#                      The material is associated with the elements
#                      1 & 2 using this function. The creation of the
#                      element property set is verified by getting the
#                      number of property words associated with the
#                      property regions.
#
#                      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 elementprops_create()
#  has the following arguments:
#
#  elementprops_create
#     (  name,
#        elem_type_id,
#        geo_opt_id,
#        con_opt_id,
#        for_opt_id,
#        lam_opt_id,
#        dof_opt_id,
#        pids,
#        dtypes,
#        dstrings,
#        app_str )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_name[32]
INTEGER  i_elem_type_id
INTEGER  i_geo_opt_id
INTEGER  i_con_opt_id
INTEGER  i_for_opt_id
INTEGER  i_lam_opt_id
INTEGER  i_dof_opt_id
INTEGER  ia_pids(5)
INTEGER  ia_dtypes(5)
STRING   sa_dstrings[32](5)
STRING   sv_app_str[VIRTUAL]
INTEGER  i_return_value
STRING   sv_create_hpat_xyz_created_ids[VIRTUAL]
INTEGER  i_create_mesh_solid_num_nodes
INTEGER  i_create_mesh_solid_num_elems
STRING   sv_create_mesh_s_nodes_created[VIRTUAL]
STRING   sv_create_mesh_s_elems_created[VIRTUAL]
INTEGER  i_region_id = 1
INTEGER  i_num_words
#---------------------------------------------------------------------
#  Open a new database
uil_file_new.go( "", "new.db" )
$? YES 36000002
 
#  Set ISO-1 viewing
i_return_value =                                 @
   ga_view_aa_set                                @
      (  23., -34., 0. )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create cuboid
i_return_value =                                 @
   asm_const_hpat_xyz                            @
      (  "1", "<5 1 1>", "[0 0 0]", "Coord 0",   @
         sv_create_hpat_xyz_created_ids )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create FEM mesh on solid
i_return_value =                                 @
   fem_create_mesh_sol( "Solid 1",               @
      1.0, "Hex8", "1", "1", "Coord 0",          @
      "Coord 0", i_create_mesh_solid_num_nodes,  @
      i_create_mesh_solid_num_elems,             @
      sv_create_mesh_s_nodes_created,            @
      sv_create_mesh_s_elems_created )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create material "Aluminium"
i_return_value =                                 @
   material.create( "Analysis code ID", 1,       @
      "Analysis type ID", 1, "Aluminium", 0, "", @
      "Isotropic", 1,"Directionality", 1,        @
      "Linearity", 1, "Homogeneous", 0,          @
      "Linear Elastic", 1, "Model Options & IDs",@
      ["", "", "", "", ""], [0, 0, 0, 0, 0],     @
      "Active Flag", 1, "Create", 10,            @
      "External Flag", FALSE, "Property IDs",    @
      ["Elastic Modulus","Poisson Ratio",        @
      "Density"], [2,5,16,0],"Property Values",  @
      ["10.1E6", "0.33", "0.1", ""] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Count the number of property words associated with property region
#  before creation of element property set.
i_return_value =                                 @
   db_count_props( i_region_id, i_num_words)
dump i_return_value
dump i_num_words
 
#---------------------------------------------------------------------
#  Create Element property set
 
s_name         = "elem_prop_1"
i_elem_type_id = 71
i_geo_opt_id   = 25
i_con_opt_id   = 30
i_for_opt_id   = 1
i_lam_opt_id   = 1
i_dof_opt_id   = 20
ia_pids        = [13, 21, 4124, 4126, 4125]
ia_dtypes      = [5, 4, 4, 4, 4]
sa_dstrings(1) = "m:Aluminium"
sv_app_str     = "Element 1 2"
 
i_return_value =                                 @
   elementprops_create                           @
      (  s_name,                                 @
         i_elem_type_id,                         @
         i_geo_opt_id,                           @
         i_con_opt_id,                           @
         i_for_opt_id,                           @
         i_lam_opt_id,                           @
         i_dof_opt_id,                           @
         ia_pids,                                @
         ia_dtypes,                              @
         sa_dstrings,                            @
         sv_app_str )
dump i_return_value
 
#---------------------------------------------------------------------
#  Count the number of property words associated with property region
#  after creation of element property set.
i_return_value =                                 @
   db_count_props( i_region_id, i_num_words)
dump i_return_value
dump i_num_words
 
#---------------------------------------------------------------------
#  Free allocated memory
sys_free_string( sv_app_str)
sys_free_string( sv_create_hpat_xyz_created_ids)
sys_free_string( sv_create_mesh_s_nodes_created)
sys_free_string( sv_create_mesh_s_elems_created)
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function elementprops_delete()
#
#                      This function deletes element property sets.
#
#                      In this example a new database is opened. A
#                      cuboid of dimension 5 X 1 X 1 is created and
#                      meshed. Then a material("Aluminium") is created
#                      and associated with the elements using function
#                      elementprops_create(). Then this function is
#                      called to delete the created element-property.
#                      The deletion of the element property set is
#                      verified by getting the number of property
#                      words associated with the property regions
#                      before and after deletion.
#
#                      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 elementprops_delete()
#  has the following arguments:
#
#  elementprops_delete
#     (  del_names )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   sa_del_names[32](1)
INTEGER  i_return_value
STRING   sv_create_mesh_s_nodes_created[VIRTUAL]
STRING   sv_create_mesh_s_elems_created[VIRTUAL]
STRING   sv_create_hpat_xyz_created_ids[VIRTUAL]
INTEGER  i_create_mesh_solid_num_nodes
INTEGER  i_create_mesh_solid_num_elems
INTEGER  i_region_id = 1
INTEGER  i_num_words
#---------------------------------------------------------------------
#  Open a new database
uil_file_new.go( "", "new.db" )
$? YES 36000002
 
#  Set ISO-1 viewing
i_return_value =                                                @
   ga_view_aa_set (  23., -34., 0. )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create cuboid
i_return_value =                                                @
   asm_const_hpat_xyz                                           @
      (  "1", "<5 1 1>", "[0 0 0]", "Coord 0",                  @
         sv_create_hpat_xyz_created_ids )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create FEM mesh on solid
 
i_return_value =                                                @
   fem_create_mesh_sol                                          @
      (  "Solid 1",1.,"Hex8","1", "1","Coord 0", "Coord 0",     @
         i_create_mesh_solid_num_nodes,                         @
         i_create_mesh_solid_num_elems,                         @
         sv_create_mesh_s_nodes_created,                        @
         sv_create_mesh_s_elems_created )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create material "Aluminium"
i_return_value =                                                @
   material.create                                              @
      (  "Analysis code ID",1,"Analysis type ID",1,"Aluminium", @
         0,"", "Isotropic", 1,"Directionality",1, "Linearity",1,@
         "Homogeneous",0,"Linear Elastic",1,"Model Options"//   @
         " & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],       @
         "Active Flag", 1, "Create", 10, "External Flag", FALSE,@
         "Property IDs", ["Elastic Modulus","Poisson Ratio",    @
         "Density"], [2,5,16,0],"Property Values", ["10.1E6",   @
         "0.33", "0.1", ""] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create Element property set
i_return_value =                                                @
   elementprops_create                                          @
      (  "elem_prop_1", 71, 25, 30, 1, 1, 20, [13, 21,4124,4126,@
         4125], [5,4,4, 4, 4],["m:Aluminium","", "", "", ""],   @
         "Element 1:5" )
dump i_return_value
 
#---------------------------------------------------------------------
#  Count the number of property words associated with property region
#  before deletion of element property set.
i_return_value =                                                @
   db_count_props( i_region_id, i_num_words)
dump i_return_value
dump i_num_words
 
#---------------------------------------------------------------------
#  Delete element property set
sa_del_names(1) = "elem_prop_1"
i_return_value =                                                @
   elementprops_delete                                          @
      (  sa_del_names )
dump i_return_value
 
#---------------------------------------------------------------------
#  Count the number of property words associated with property region
#  after deletion of element property set.
i_return_value =                                                @
   db_count_props( i_region_id, i_num_words)
dump i_return_value
dump i_num_words
 
#---------------------------------------------------------------------
#  Free allocated memory
sys_free_string( sv_create_hpat_xyz_created_ids)
sys_free_string( sv_create_mesh_s_nodes_created)
sys_free_string( sv_create_mesh_s_elems_created)
#---------------------------------------------------------------------
   
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function elementprops_modify()
#
#                      This function modifies element property sets.
#
#                      In this example a new database is opened. A
#                      cuboid of dimension 5 X 1 X 1 is created and
#                      meshed. Then a material("Aluminium") and an
#                      element property("Elem_Prop") is created. After
#                      a pause a new material("Polycarbonate") is
#                      created. Then the material of "Elem_Prop" is
#                      changed from "Aluminium" to "Polycarbonate" and
#                      the associated elements from "Element 1:5" to
#                      "Element 1:2". The change in element property
#                      is displayed in 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 elementprops_modify()
#  has the following arguments:
#
#  elementprops_modify
#     (  name,
#        new_name,
#        elem_type_id,
#        geo_opt_id,
#        con_opt_id,
#        for_opt_id,
#        lam_opt_id,
#        dof_opt_id,
#        pids,
#        dtypes,
#        dstrings,
#        app_str )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_name[32]
STRING   s_new_name[32]
INTEGER  i_elem_type_id
INTEGER  i_geo_opt_id
INTEGER  i_con_opt_id
INTEGER  i_for_opt_id
INTEGER  i_lam_opt_id
INTEGER  i_dof_opt_id
INTEGER  ia_pids(5)
INTEGER  ia_dtypes(5)
STRING   sa_dstrings[32](5)
STRING   sv_app_str[VIRTUAL]
INTEGER  i_return_value
STRING   sv_create_hpat_xyz_created_ids[VIRTUAL]
INTEGER  i_create_mesh_solid_num_nodes
INTEGER  i_create_mesh_solid_num_elems
STRING   sv_create_mesh_s_nodes_created[VIRTUAL]
STRING   sv_create_mesh_s_elems_created[VIRTUAL]
#---------------------------------------------------------------------
#  Open a new database
uil_file_new.go( "", "new.db" )
$? YES 36000002
 
#  Set ISO-1 viewing
i_return_value =                                                @
   ga_view_aa_set (  23., -34., 0. )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create cuboid
i_return_value =                                                @
   asm_const_hpat_xyz                                           @
      (  "1", "<5 1 1>", "[0 0 0]", "Coord 0",                  @
         sv_create_hpat_xyz_created_ids )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create FEM mesh on solid
i_return_value =                                                @
   fem_create_mesh_sol                                          @
      (  "Solid 1",1.,"Hex8","1", "1","Coord 0", "Coord 0",     @
         i_create_mesh_solid_num_nodes,                         @
         i_create_mesh_solid_num_elems,                         @
         sv_create_mesh_s_nodes_created,                        @
         sv_create_mesh_s_elems_created )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create material "Aluminium"
i_return_value =                                                @
   material.create                                              @
      (  "Analysis code ID",1,"Analysis type ID",1,"Aluminium", @
         0,"", "Isotropic", 1,"Directionality",1, "Linearity",1,@
         "Homogeneous",0,"Linear Elastic",1,"Model Options"//   @
         " & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],       @
         "Active Flag", 1, "Create", 10, "External Flag", FALSE,@
         "Property IDs", ["Elastic Modulus","Poisson Ratio",    @
         "Density"], [2,5,16,0],"Property Values", ["10.1E6",   @
         "0.33", "0.1", ""] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create Element property set
i_return_value =                                                @
   elementprops_create                                          @
      (  "Elem_Prop",   71, 25, 30, 1, 1, 20, [13, 21,4124,4126,@
         4125], [5,4,4, 4, 4],["m:Aluminium","", "", "", ""],   @
         "Element 1:5" )
dump i_return_value
 
#---------------------------------------------------------------------
#  Display Material Name
i_return_value =                                                @
   elementprops_show                                            @
      (  "Material Name", "Marker Plot", ["default_group"] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Session file paused. Press "Resume" to continue..
sf_pause()
 
#---------------------------------------------------------------------
#  Create material "Polycarbonate"
i_return_value =                                                @
   material.create                                              @
      (  "Analysis code ID",1,"Analysis type ID",1,             @
         "Polycarbonate",0,"","Isotropic", 1, "Directionality", @
         1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", @
         1, "Model Options & IDs", ["", "", "", "", ""], [0, 0, @
         0, 0, 0], "Active Flag", 1, "Create", 10,              @
         "External Flag", FALSE, "Property IDs",["Elastic"//    @
         " Modulus", "Poisson Ratio", "Density"], [2, 5, 16, 0],@
         "Property Values", ["3.9e5", "0.35", "0.042", ""] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Modify element property set "Elem_Prop"
 
s_name         = "Elem_Prop"
s_new_name     = "Elem_Prop"
i_elem_type_id = 71
i_geo_opt_id   = 25
i_con_opt_id   = 30
i_for_opt_id   = 1
i_lam_opt_id   = 1
i_dof_opt_id   = 20
ia_pids        = [13, 21, 4124, 4126, 4125]
ia_dtypes      = [5, 4, 4, 4, 4]
sa_dstrings(1) = "m:Polycarbonate"
sv_app_str     = "Element 1 2"
 
i_return_value=                                                 @
   elementprops_modify                                          @
      (  s_name,                                                @
         s_new_name,                                            @
         i_elem_type_id,                                        @
         i_geo_opt_id,                                          @
         i_con_opt_id,                                          @
         i_for_opt_id,                                          @
         i_lam_opt_id,                                          @
         i_dof_opt_id,                                          @
         ia_pids,                                               @
         ia_dtypes,                                             @
         sa_dstrings,                                           @
         sv_app_str )
dump i_return_value
 
#---------------------------------------------------------------------
#  Display Material Name
dump i_return_value
i_return_value =                                                @
   elementprops_show                                            @
      (  "Material Name", "Marker Plot", ["default_group"] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Free allocated memory
sys_free_string( sv_app_str)
sys_free_string( sv_create_hpat_xyz_created_ids)
sys_free_string( sv_create_mesh_s_nodes_created)
sys_free_string( sv_create_mesh_s_elems_created)
#---------------------------------------------------------------------
   
()
#
#  Purpose          :  This file provides an example of 2 calls to the
#                      function elementprops_show()
#
#                      This function displays element property values.
#
#                      In this example a new database is opened. A
#                      cuboid of dimension 5 X 1 X 1 is created and
#                      meshed. Then a material("Aluminium") and an
#                      element property("Elem_Prop") is created. 
#                      The Material name is displayed and after
#                      a pause the name of element property is
#                      displayed using this function.
#
#                      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 elementprops_show()
#  has the following arguments:
#
#  elementprops_show
#     (  prop_name,
#        disp_type,
#        grp_names )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_prop_name[32]
STRING   s_disp_type[32]
STRING   sa_grp_names[32](1)
INTEGER  i_return_value
STRING   sv_create_hpat_xyz_created_ids[VIRTUAL]
INTEGER  i_create_mesh_solid_num_nodes
INTEGER  i_create_mesh_solid_num_elems
STRING   sv_create_mesh_s_nodes_created[VIRTUAL]
STRING   sv_create_mesh_s_elems_created[VIRTUAL]
#---------------------------------------------------------------------
#  Open a new database
uil_file_new.go( "", "new.db" )
$? YES 36000002
 
#  Set ISO-1 viewing
i_return_value =                                                @
   ga_view_aa_set (  23., -34., 0. )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create cuboid
i_return_value =                                                @
   asm_const_hpat_xyz                                           @
      (  "1", "<5 1 1>", "[0 0 0]", "Coord 0",                  @
         sv_create_hpat_xyz_created_ids )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create FEM mesh on solid
i_return_value =                                                @
   fem_create_mesh_sol                                          @
      (  "Solid 1",1.,"Hex8","1", "1","Coord 0", "Coord 0",     @
         i_create_mesh_solid_num_nodes,                         @
         i_create_mesh_solid_num_elems,                         @
         sv_create_mesh_s_nodes_created,                        @
         sv_create_mesh_s_elems_created )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create material "Aluminium"
i_return_value =                                                @
   material.create                                              @
      (  "Analysis code ID",1,"Analysis type ID",1,"Aluminium", @
         0,"", "Isotropic", 1,"Directionality",1, "Linearity",1,@
         "Homogeneous",0,"Linear Elastic",1,"Model Options"//   @
         " & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],       @
         "Active Flag", 1, "Create", 10, "External Flag", FALSE,@
         "Property IDs", ["Elastic Modulus","Poisson Ratio",    @
         "Density"], [2,5,16,0],"Property Values", ["10.1E6",   @
         "0.33", "0.1", ""] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create Element property set
i_return_value =                                                @
   elementprops_create                                          @
      (  "Elem_Prop",   71, 25, 30, 1, 1, 20, [13, 21,4124,4126,@
         4125], [5,4,4, 4, 4],["m:Aluminium","", "", "", ""],   @
         "Element 1:3" )
dump i_return_value
 
#---------------------------------------------------------------------
#  Display Material Name
s_prop_name     = "Material Name"
s_disp_type     = "Marker Plot"
sa_grp_names(1) = "default_group"
i_return_value =                                                @
   elementprops_show                                            @
      (  s_prop_name,                                           @
         s_disp_type,                                           @
         sa_grp_names )
dump i_return_value
 
#---------------------------------------------------------------------
#  Session file paused. Press "Resume" to continue..
sf_pause()
 
#---------------------------------------------------------------------
#  Display Property Set Name
s_prop_name     = "Property Set Name"
s_disp_type     = "Marker Plot"
sa_grp_names(1) = "default_group"
i_return_value =                                                @
   elementprops_show                                            @
      (  s_prop_name,                                           @
         s_disp_type,                                           @
         sa_grp_names )
dump i_return_value
 
#---------------------------------------------------------------------
#  Free allocated memory
sys_free_string( sv_create_hpat_xyz_created_ids)
sys_free_string( sv_create_mesh_s_nodes_created)
sys_free_string( sv_create_mesh_s_elems_created)
#---------------------------------------------------------------------