Tutorial Toolkit Code Examples > Materials > Introduction
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Introduction
This chapter provides code examples for the PCL function described in Volume 1. These examples are designed so that they can be cut and pasted into a file and, by following the instructions listed with each example, executed in MSC Patran.
 
db_bulk_get_possible_cond_opts1
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_bulk_get_possible_cond_opts1()
#
#                      This file opens a new database “new.db” and 
#                      gets the number of condense options and it’s
#                      code values for “Shell” element type with
#                      “Nastran” as analysis code and “Structural” as 
#                      the analysis type.
#
#                      For element type ID,and condense option codes,
#                      refer MSC Patran User Manual, Part 9, 
#                      Section 7.6. 
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_bulk_get_possible_cond_opts1()
#  has the following arguments:
#
#  db_bulk_get_possible_cond_opts1
#     (  etid,
#        atid,
#        acid,
#        nbr,
#        coc )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_etid
INTEGER  i_atid
INTEGER  i_acid
INTEGER  i_nbr
INTEGER  ia_coc(4)
INTEGER  i_return_value
STRING   s_atname[16]
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  The Element type ID for “Shell” is 51
i_etid = 51
#  Get the analysis code id for “MSC.Nastran”
i_return_value =                                 @
   db_get_anal_code_id                           @
      ( “MSC.Nastran”,i_acid )
dump i_return_value
#
#  Get the analysis type id for “Structural”
s_atname = “Structural”
i_return_value =                                 @
   db_get_anal_type_id                           @
      (  s_atname,                               @
         i_atid )
dump i_return_value
#
#  Get the number and ID’s of the condense options
i_return_value =                                 @
   db_bulk_get_possible_cond_opts1               @
      (  i_etid,                                 @
         i_atid,                                 @
         i_acid,                                 @
         i_nbr,                                  @
         ia_coc )
dump i_return_value
dump i_nbr
dump ia_coc
#---------------------------------------------------------------------
db_bulk_get_possible_cond_opts2
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_bulk_get_possible_cond_opts2()
#
#                      This file opens a new database “new.db” and 
#                      gets the number of condense options and it’s
#                      code values for “Shell” element type with
#                      “Nastran” as analysis code and “Structural” as 
#                      the analysis type.
#
#                      For element type ID,and condense option codes,
#                      and geometric option codes refer MSC Patran 
#                      User Manual, Part 9, Section 7.6. 
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_bulk_get_possible_cond_opts2()
#  has the following arguments:
#
#  db_bulk_get_possible_cond_opts2
#     (  etid,
#        atid,
#        acid,
#        goc,
#        nbr,
#        coc )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_etid
INTEGER  i_atid
INTEGER  i_acid
INTEGER  i_goc
INTEGER  i_nbr
INTEGER  ia_coc(4)
INTEGER  i_return_value
STRING   s_atname[32]
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                 @
   db_get_anal_code_id(“MSC.Nastran”,i_acid)
dump i_return_value
#
#  Get the analysis type id for “Structural”
s_atname = “Structural”
i_return_value =                                 @
   db_get_anal_type_id                           @
      (  s_atname,                               @
         i_atid )
dump i_return_value
#
#  The Element type id for ‘Shell’ is 51
i_etid = 51
#
#  The geometric option code is N/A .
i_goc = 25
#
#  Get the number and the ID’s of the condense options
i_return_value =                                 @
   db_bulk_get_possible_cond_opts2               @
      (  i_etid,                                 @
         i_atid,                                 @
         i_acid,                                 @
         i_goc,                                  @
         i_nbr,                                  @
         ia_coc )
dump i_return_value
dump i_nbr
dump ia_coc
#---------------------------------------------------------------------
db_bulk_get_possible_dof_sets
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_bulk_get_possible_dof_sets()
#
#                      This file opens a new database “new,db” and 
#                      gets the number of unique DOF set ID values
#                      for the given set of input values.
#
#                      For element type ID,and condense option codes,
#                      geometric, formulation, laminate, linearity,
#                      and directionality codes refer MSC Patran 
#                      User Manual, Part 9, Section 7.6, 7.7. 
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_bulk_get_possible_dof_sets()
#  has the following arguments:
#
#  db_bulk_get_possible_dof_sets
#     (  etid,
#        atid,
#        acid,
#        coc,
#        goc,
#        foc,
#        loc,
#        mlc,
#        mdc,
#        nbr,
#        dsid )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_etid
INTEGER  i_atid
INTEGER  i_acid
INTEGER  i_coc
INTEGER  i_goc
INTEGER  i_foc
INTEGER  i_loc
INTEGER  i_mlc
INTEGER  i_mdc
INTEGER  i_nbr
INTEGER  ia_dsid(4)
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  The element type ID for “Shell” is 51.
i_etid = 51
#  The analysis type ID for “Structural” is 1.
i_atid = 1
#  The analysis code ID for “MSC.Nastran” is 1.
i_acid = 1
#  The ID of the condense option is 0.
i_coc = 0
#  The geometric option code is 0.
i_goc = 0
#  The formulation option code is 0.
i_foc = 0
#  The laminate option code is 0.
i_loc = 0
#  The material linearity code is 0.
i_mlc = 0
#  The material directionality code is 0.
i_mdc = 0
i_return_value =                                 @
   db_bulk_get_possible_dof_sets                 @
      (  i_etid,                                 @
         i_atid,                                 @
         i_acid,                                 @
         i_coc,                                  @
         i_goc,                                  @
         i_foc,                                  @
         i_loc,                                  @
         i_mlc,                                  @
         i_mdc,                                  @
         i_nbr,                                  @
         ia_dsid )
dump i_return_value
dump i_nbr
dump ia_dsid
 
#---------------------------------------------------------------------
db_count_materials
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_count_materials()
#
#                      This file opens a new database “new.db” and 
#                      and creates a new material “New_Material”. 
#                      And gets the count of materials before and
#                      after the creation of the new material. 
#
#                      For material category,linearity,directionality,
#                      and material type IDs refer MSC Patran User 
#                      Manual, Part 9, Section 7.6, 7.7, 9.14.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#
#  The function db_count_materials()
#  has the following arguments:
#
#  db_count_materials
#     (  count )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_count
INTEGER  i_return_value
STRING   s_mat_name[32]
INTEGER  i_id
STRING   s_description[216]
INTEGER  i_cat
INTEGER  i_lin
INTEGER  i_dir
INTEGER  i_type
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the count of the material in the new database
#  which is 0. 
i_return_value =                                 @
   db_count_materials                            @
      (  i_count )
dump i_return_value
dump i_count
#
#  Create a new material
#  Assign the name of the material.
s_mat_name = “New_Material”
#  Assign the description.
s_description = “This material is created for an illustration”
#  Assign the the category as “Isotropic”
i_cat = 1
#  Linearity code is “Linear Elastic”.
i_lin = 1
#  The directionality code is “Isotropic”
i_dir = 1
#  The material type is “Homogeneous material”
i_type = 1
i_return_value =                                 @
   db_create_material                            @
      ( s_mat_name,                              @
        s_description,                           @
        i_cat,                                   @
        i_lin,                                   @
        i_dir,                                   @
        i_type,                                  @
        i_id  )
dump i_return_value
#
#  Get the latest count of the materials.
i_return_value =                                 @
   db_count_materials                            @
      (  i_count )
dump i_return_value
dump i_count
#------------------------------------------------------------
 
db_count_options
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_count_options()
#
#                      This file opens a new database “new.db” and
#                      gets the count of geometric, condense,
#                      formulation, laminate options  and 
#                      the count of degree of freedom sets and 
#                      element topologies. 
#
#                      All these codes, IDs and counts are available 
#                      in MSC Patran User Manual, Part 9,
#                      Section 7.6 and 7.7.  
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_count_options()
#  has the following arguments:
#
#  db_count_options
#     (  goc,
#        coc,
#        loc,
#        foc,
#        dsid,
#        etop )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_goc
INTEGER  i_coc
INTEGER  i_loc
INTEGER  i_foc
INTEGER  i_dsid
INTEGER  i_etop
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the count of the options.
i_return_value =                                 @
   db_count_options                              @
      (  i_goc,                                  @
         i_coc,                                  @
         i_loc,                                  @
         i_foc,                                  @
         i_dsid,                                 @
         i_etop )
dump i_return_value
dump i_goc
dump i_coc
dump i_loc
dump i_foc
dump i_dsid
dump i_etop
#---------------------------------------------------------------------
db_create_mtl_allowable_magics
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_create_mtl_allowable_magics()
#
#                      This file opens a new database “new.db”,and 
#                      1. Gets the count of magics for the magic
#                      category  “Hardening Rule”.
#                      2. Creates new allowable magics for 
#                      the magic category “Hardening Rule”. and
#                      3. Gets the latest count of the magics for
#                      the magic category “Hardening Rule”
#
#                      For material category IDs, magic category IDs,
#                      magic option IDs refer MSC Patran User Manual,
#                      Part 9, Section 7.6 and 7.7 .
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#
#  The function db_create_mtl_allowable_magics()
#  has the following arguments:
#
#  db_create_mtl_allowable_magics
#     (  cid,
#        mc_id,
#        magic_category_id,
#        magic_alias_id,
#        nbr )
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_code_id
INTEGER  i_matl_cat_id
INTEGER  i_magic_category_id
INTEGER  i_nbr
INTEGER  i_return_value
INTEGER  ia_magic_alias_id(3)
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                        @ 
   db_get_anal_code_id(“MSC.Nastran”,i_code_id)
dump i_return_value
#
#  The material category ID for “Isotropic” is 1.
i_matl_cat_id = 1
#  The magic category id for “Hardening Rule” is 5.
i_magic_category_id = 5
#
#  Get the count of the material allowable magics.
i_return_value =                                       @
   db_get_mtl_allowable_magic_cnt                      @
      (  i_code_id,                                    @
         i_matl_cat_id,                                @
         i_magic_category_id,                          @
         i_nbr )
dump i_return_value
dump i_nbr
#  Create three new valid magic options for the 
#  “Hardening Rule”
#  The magics option ids for VonMises, Tresca and Mohr_coulomb
#  yield functions are 10,11 and 12 respectively.
ia_magic_alias_id = [10,11,12]
i_nbr = 3
i_return_value =                                       @
   db_create_mtl_allowable_magics                      @
      (  i_code_id,                                    @
         i_matl_cat_id,                                @
         i_magic_category_id,                          @
         ia_magic_alias_id,                            @
         i_nbr )
dump i_return_value
#
#  Get the new count of the material allowable magics.
i_return_value =                                       @
   db_get_mtl_allowable_magic_cnt                      @
      (  i_code_id,                                    @
         i_matl_cat_id,                                @
         i_magic_category_id,                          @
         i_nbr )
dump i_return_value
dump i_nbr
#---------------------------------------------------------------------
db_delete_material
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_delete_material()
#
#                      This file opens a new database “new.db”, 
#                      creates a new material “New_Material” and 
#                      gets the count before and after the deletion
#                      of the newly created material.
#
#                      For material category,linearity,directionality,
#                      and material type IDs refer MSC Patran User 
#                      Manual, Part 9, Section 7.6, 7.7, 9.14.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_delete_material()
#  has the following arguments:
#
#  db_delete_material
#     (  name )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_name[32]
INTEGER  i_return_value
INTEGER  i_count
INTEGER  i_id
STRING   s_description[216]
INTEGER  i_cat
INTEGER  i_lin
INTEGER  i_dir
INTEGER  i_type
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Create a new material
#  Assign the name of the material.
s_name = “New_Material”
#  Assign the description.
s_description = “This material is created for an illustration”
#  Assign the the category as “Isotropic”
i_cat = 1
#  Linearity code is “Linear Elastic”.
i_lin = 1
#  The directionality code is “Isotropic”
i_dir = 1
#  The material type is “Homogeneous material”
i_type = 1
i_return_value =                                 @
   db_create_material                            @
      ( s_name,                                  @
        s_description,                           @
        i_cat,                                   @
        i_lin,                                   @
        i_dir,                                   @
        i_type,                                  @
        i_id  )
dump i_return_value
#
#  Get the count of the materials.
i_return_value =                                 @
   db_count_materials                            @
      (  i_count )
dump i_return_value
dump i_count
#
#  Delete the material “New_Material”
s_name = “New_Material”
i_return_value =                                 @
  db_delete_material                             @
      (  s_name )
dump i_return_value
#  Get the latest count of the materials which is 0.
i_return_value =                                 @
   db_count_materials                            @
      (  i_count )
dump i_return_value
dump i_count
#---------------------------------------------------------------------
db_delete_material_property
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_delete_material_property()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      add one defination of isotropic material.Then
#                      Reference Temperature property is deleted for 
#                      the material. Before deletion session file is 
#                      paused for user to see the created material. 
#                      Similarly after deletion user will have to see
#                      the change in MATERIAL SHOW form.
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.6 and 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function db_delete_material_property()
#  has the following arguments:
#
#  db_delete_material_property
#     (  mid,
#        mpid )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_mid
INTEGER  i_mpid
INTEGER  i_return_value
STRING   s_name[64]
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Creating material for Structural analysis on MSC.Nastran based on 
#  linear elastic theory. Material name is “Session_example_material”
s_name         = “Session_example_material”
i_return_value =                                                     @
   material.create( “Analysis code ID”, 1, “Analysis type ID”, 1,    @
   s_name, 0, “New Material”,”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”, “Reference Temperature”],   @
   [2, 5, 1, 0], “Property Values”,[“2e12”, “.35”, “40.5”, ““] )
dump i_return_value
 
#  Getting the id for the created material.
i_return_value = db_get_material_id_from_name(s_name,i_mid)
dump i_return_value
#---------------------------------------------------------------------
#  Session file paused. Press “Resume” to continue..
#  Session file execution is paused to see the material created.
#  Open MATERIAL SHOW form, select the only material and press 
#  ‘Show Properties’ button.
sf_pause()
#---------------------------------------------------------------------
#  Deleting the Reference Temperature property (property no.1)
i_mpid         = 1
#
i_return_value =                                 @
   db_delete_material_property                   @
      (  i_mid,                                  @
         i_mpid )
dump i_return_value
 
#---------------------------------------------------------------------
#  To see the updated material, open MATERIAL SHOW form, select the 
#  only material and press ‘Show Properties’ button.
#---------------------------------------------------------------------
 
db_delete_matl_const_model
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_delete_matl_const_model()
#
#                      This file 1. Opens a new data base “new.db”
#                      2. Creates a new material “New_Material”
#                      3. Gets the ID of the new material
#                      4. Gets the count and IDs of the constitutive
#                         models.
#                      5. Deletes one constitutive model and gets
#                         the latest count of constitutive models 
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_delete_matl_const_model()
#  has the following arguments:
#
#  db_delete_matl_const_model
#     (  mid,
#        cmid )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_mid
INTEGER  i_cmid
INTEGER  i_return_value
INTEGER  i_cmid
INTEGER  i_num_models
INTEGER  i_count
INTEGER  iv_cm_id(VIRTUAL)
STRING   s_mat_name[32]
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Create a new material “New_Material”
i_return_value =                                       @
   material.create                                     @
     ( “Analysis code ID”, 1, “Analysis type ID”, 1,   @
       “New_Material”, 0, “Date: 20-Aug-97             @
       Time: 17:47:10”, “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”], [2, 5, 0], @
       “Property Values”, [“3.6e6”, “.33”, ““] )
dump i_return_value
#
#  Get the material ID of the newly created material.
s_mat_name = “New_Material”
i_return_value =                                       @
   db_get_material_id_from_name                        @
      (  s_mat_name,                                   @
         i_mid )
dump i_return_value
dump i_mid
#---------------------------------------------------------------------
#  Get the count material constitutive models
i_return_value =                                       @
   db_get_matl_const_model_count                       @
      (  i_mid,                                        @
         i_count )
dump i_return_value
dump i_count
#
#  Get the IDs of all the constitutive models of the material.
SYS_ALLOCATE_ARRAY (iv_cm_id, 1, i_count)
i_return_value =                                       @
   db_get_matl_const_model                             @
      (  i_mid,                                        @
         iv_cm_id )
dump i_return_value
dump iv_cm_id
#
#  Delete the first constitutive model
i_cmid = iv_cm_id(1)
i_return_value =                                       @
   db_delete_matl_const_model                          @
      (  i_mid,                                        @
         i_cmid )
dump i_return_value
#
#  Get the latest count of constitutive models of the material
i_return_value =                                       @
   db_get_matl_const_model_count                       @
      (  i_mid,                                        @
         i_count )
dump i_return_value
dump i_count
sys_free_array (iv_cm_id)
#---------------------------------------------------------------------
db_get_all_allow_matl_prop_cnt
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_all_allow_matl_prop_cnt()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      display the ids for allowable material
#                      properties.
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function db_get_all_allow_matl_prop_cnt()
#  has the following arguments:
#
#  db_get_all_allow_matl_prop_cnt
#     (  cid,
#        atid,
#        mc_id,
#        cm_id,
#        nbr )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_cid
INTEGER  i_atid
INTEGER  i_mc_id
INTEGER  i_cm_id
INTEGER  i_nbr
INTEGER  iv_mp_id(VIRTUAL)
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Analysis code id for MSC.Nastran is 1.
i_cid=1
#  Analysis type id for Structural analysis is 1.
i_atid=1
#  Using Material Category for Isotropic Material, which is 1.
i_mc_id=1
#  For Linear Elastic Constitutive Model, id is 1.
i_cm_id=1
#  Finding out number of allowable properties in the database. And
#  allocating the space for the output array.
#
i_return_value =                                 @
   db_get_all_allow_matl_prop_cnt                @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         i_nbr )
dump i_return_value
#  The number of allowable material properties are
dump i_nbr
sys_allocate_array(iv_mp_id,1,i_nbr)
#---------------------------------------------------------------------
#  Calling function to read the property ids.
#
i_return_value =                                 @
   db_get_all_allowable_matl_prop                @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         iv_mp_id )
dump i_return_value
dump iv_mp_id
#---------------------------------------------------------------------
sys_free_array(iv_mp_id)
#---------------------------------------------------------------------
db_get_all_allowable_matl_prop
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_all_allowable_matl_prop()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      display the ids for allowable material
#                      properties.
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function db_get_all_allowable_matl_prop()
#  has the following arguments:
#
#  db_get_all_allowable_matl_prop
#     (  cid,
#        atid,
#        mc_id,
#        cm_id,
#        mp_id )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_cid
INTEGER  i_atid
INTEGER  i_mc_id
INTEGER  i_cm_id
INTEGER  i_nbr
INTEGER  iv_mp_id(VIRTUAL)
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Analysis code id for MSC.Nastran is 1.
i_cid=1
#  Analysis type id for Structural analysis is 1.
i_atid=1
#  Using Material Category for Isotropic Material, which is 1.
i_mc_id=1
#  For Linear Elastic Constitutive Model, id is 1.
i_cm_id=1
#  Finding out number of allowable properties in the database. And
#  allocating the space for the output array.
#
i_return_value =                                 @
   db_get_all_allow_matl_prop_cnt                @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         i_nbr )
dump i_return_value
sys_allocate_array(iv_mp_id,1,i_nbr)
#---------------------------------------------------------------------
#  Calling function to read the property ids.
#
i_return_value =                                 @
   db_get_all_allowable_matl_prop                @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         iv_mp_id )
dump i_return_value
dump iv_mp_id
#---------------------------------------------------------------------
sys_free_array(iv_mp_id)
#---------------------------------------------------------------------
 
db_get_all_cond_opt_code_names
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_all_cond_opt_code_names()
#
#                      This session file will open a new database 
#                      by name ‘new.db’ with default options and will
#                      display the available condense_options.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function db_get_all_cond_opt_code_names() has no arguments.
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_name[32]
INTEGER  i_id
INTEGER  all_status
INTEGER  next_status = 0
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Calling the ‘get_all’ function to read all the relation_names in
#  the relation ‘condense_option’.
#
all_status =                                     @
   db_get_all_cond_opt_code_names()
dump all_status
#---------------------------------------------------------------------
#  Calling ‘get_next’ function to read the relation_names one by one.
#
WHILE ( next_status == 0 )
   next_status =                                 @
      db_get_next_cond_opt_code_names            @
         (  s_name,                              @
            i_id )
   dump next_status
   IF( next_status == 0 ) THEN
#  The relation name and id are.
      dump s_name,i_id
   ENDIF
END WHILE
#---------------------------------------------------------------------
db_get_all_lam_opt_code_names
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_all_lam_opt_code_names()
#
#                      This session file will open a new database 
#                      by name ‘new.db’ with default options and will
#                      display the available laminate_options.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function db_get_all_lam_opt_code_names() has no arguments.
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_name[32]
INTEGER  i_id
INTEGER  all_status
INTEGER  next_status = 0
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Calling the ‘get_all’ function to read all the relation_names in
#  the relation ‘laminate_option’.
#
all_status =                                     @
   db_get_all_lam_opt_code_names()
dump all_status
#---------------------------------------------------------------------
#  Calling ‘get_next’ function to read the relation_names one by one.
#
WHILE ( next_status == 0 )
   next_status =                                 @
      db_get_next_lam_opt_code_names             @
         (  s_name,                              @
            i_id )
   dump next_status
   IF (next_status == 0 )THEN
#  The relation name and id are.
      dump s_name,i_id
   ENDIF
END WHILE
#---------------------------------------------------------------------
db_get_all_material_names
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_all_material_names()
#
#                      This file opens a new database “new.db” and
#                      creates two materials. Then gets all the
#                      material information in get all, get next
#                      method.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_all_material_names() has no arguments.
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_name[64]
INTEGER  i_id
INTEGER  i_cat
INTEGER  i_lin
INTEGER  i_dir
INTEGER  i_type
INTEGER  i_return_value
INTEGER  all_status
INTEGER  next_status = 0
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Create a new material “Material_1”.
i_return_value =                                       @
   material.create                                     @
     ( “Analysis code ID”, 1, “Analysis type ID”, 1,   @
       “Material_1”, 0, “Date:                         @
       Time:         “, “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”], [2, 5, 0], @
       “Property Values”, [“3.6e6”, “.33”, ““] )
dump i_return_value
#
#  Create one more material “Material_2”.
i_return_value =                                       @
   material.create                                     @
     ( “Analysis code ID”, 1, “Analysis type ID”, 1,   @
       “Material_2”, 0, “Date:                         @
       Time:         “, “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”], [2, 5, 0], @
       “Property Values”, [“3.6e6”, “.33”, ““] )
dump i_return_value
#
#  Get all the all the material names from the database
all_status = db_get_all_material_names ( )
dump all_status
#
#  Get all  material information from the database
WHILE ( next_status == 0 )
   next_status =                                       @
      db_get_next_material_name                        @
         (  s_name,                                    @ 
            i_id,                                      @
            i_cat,                                     @
            i_lin,                                     @
            i_dir,                                     @
            i_type )
   dump next_status
   IF ( next_status == 0 ) THEN
      dump s_name
      dump i_id
      dump i_cat
      dump i_lin
      dump i_dir
      dump i_type
   END IF
END WHILE
#
#---------------------------------------------------------------------
 
db_get_allowable_matl_prop
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_allowable_matl_prop()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      display the ids for allowable material 
#                      properties.
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function db_get_allowable_matl_prop()
#  has the following arguments:
#
#  db_get_allowable_matl_prop
#     (  cid,
#        atid,
#        mc_id,
#        cm_id,
#        magics,
#        mp_id )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_cid
INTEGER  i_atid
INTEGER  i_mc_id
INTEGER  i_cm_id
INTEGER  ia_magics(5)
INTEGER  iv_mp_id(VIRTUAL)
INTEGER  i_return_value
INTEGER  i_nbr
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Analysis code id for MSC.Nastran is 1.
i_cid          = 1
#  Analysis type id for Structural analysis is 1.
i_atid         = 1
#  Using Material Category for Isotropic Material, which is 1.
i_mc_id        = 1
#  For Linear Elastic Constitutive Model, id is 1.
i_cm_id        = 1
#  Getting the associated entry from the ‘matl_magic’ table.
i_return_value =                                 @
   db_get_mtl_magics                             @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         ia_magics  )
dump i_return_value
 
#  Finding out number of allowable properties in the database. And 
#  allocating the space for the output array.
i_return_value =                                 @
   db_get_allowable_matl_prop_cnt                @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         ia_magics,                              @
         i_nbr  )  
dump i_return_value
sys_allocate_array(iv_mp_id,1,i_nbr)
#---------------------------------------------------------------------
#  Calling function to read the property ids.
i_return_value =                                 @
   db_get_allowable_matl_prop                    @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         ia_magics,                              @
         iv_mp_id )
dump i_return_value
#  The ids are 
dump iv_mp_id
#---------------------------------------------------------------------
sys_free_array(iv_mp_id)
#---------------------------------------------------------------------
db_get_allowable_matl_prop_cnt
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_allowable_matl_prop_cnt()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      display the ids for allowable material 
#                      properties.
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function db_get_allowable_matl_prop_cnt()
#  has the following arguments:
#
#  db_get_allowable_matl_prop_cnt
#     (  cid,
#        atid,
#        mc_id,
#        cm_id,
#        magics,
#        nbr )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_cid
INTEGER  i_atid
INTEGER  i_mc_id
INTEGER  i_cm_id
INTEGER  ia_magics(5)
INTEGER  iv_mp_id(VIRTUAL)
INTEGER  i_return_value
INTEGER  i_nbr
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Analysis code id for MSC.Nastran is 1.
i_cid          = 1
#  Analysis type id for Structural analysis is 1.
i_atid         = 1
#  Using Material Category for Isotropic Material, which is 1.
i_mc_id        = 1
#  For Linear Elastic Constitutive Model, id is 1.
i_cm_id        = 1
#  Getting the associated entry from the ‘matl_magic’ table.
i_return_value =                                 @
   db_get_mtl_magics                             @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         ia_magics  )
dump i_return_value
 
#  Finding out number of allowable properties in the database. And 
#  allocating the space for the output array.
i_return_value =                                 @
   db_get_allowable_matl_prop_cnt                @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         ia_magics,                              @
         i_nbr  )  
dump i_return_value
#  The number of allowable material property ids are
dump i_nbr
sys_allocate_array(iv_mp_id,1,i_nbr)
#---------------------------------------------------------------------
#  Calling function to read the property ids.
i_return_value =                                 @
   db_get_allowable_matl_prop                    @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         ia_magics,                              @
         iv_mp_id )
dump i_return_value
#  The ids are 
dump iv_mp_id
#---------------------------------------------------------------------
sys_free_array(iv_mp_id)
#---------------------------------------------------------------------
db_get_comp_hal
()
#  Purpose          :  This file provides an example of two calls to 
#                      the function db_get_comp_hal()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      create four materials of type isotropic, 
#                      3d orthotropic, cont. fiber and disc. ribbon 
#                      composite. The construction data for the two 
#                      composite materials will be listed
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_comp_hal()
#  has the following arguments:
#
#  db_get_comp_hal
#     (  mat_name,
#        iopt,
#        fiber_name,
#        matrix_name,
#        fiber_vol_frac,
#        matrix_vol_frac,
#        theory,
#        override,
#        aspect_ratios,
#        emperical_factors )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_mat_name[32]
INTEGER  i_iopt
STRING   s_fiber_name[32]
STRING   s_matrix_name[32]
REAL     r_fiber_vol_frac
REAL     r_matrix_vol_frac
INTEGER  i_theory
LOGICAL  l_override
REAL     ra_aspect_ratios(2)
REAL     ra_emperical_factors(9)
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Creating isotropic material by name ‘matrix’.
i_return_value =                                                     @
   material.create(“Analysis code ID”,1,”Analysis type ID”,1,”matrix”@
      ,0, “New Material” , “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”], [2, 5, 0], @
      “Property Values”, [“2e5”, “.3”, ““] )
dump i_return_value
 
#  Creating 3d orthotropic material by name ‘fiber’.
i_return_value =                                                     @
   material.create(“Analysis code ID”,1,”Analysis type ID”,1,”fiber”,@
      0,”New Material”, “3d Orthotropic”,                            @
      2, “Directionality”,2,”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”,”Elastic Modulus 22”,        @
      “Elastic Modulus 33”,”Poisson Ratio”,”Poisson Ratio 23”,       @
      “Poisson Ratio 31”,”Shear Modulus”,”Shear Modulus 23”,         @
      “Shear Modulus 31”],[2, 3, 4, 5, 6, 7, 8, 9, 10, 0],           @
      “Property Values”,[“2e5”,”2e5”,”2e5”, “.33”, “.3”, “.37”, “2e6”@
      , “2e7”, “4e6”, ““] )
dump i_return_value
 
#  Creating continuous fiber composite material by name ‘cfc’.
i_return_value =                                                     @
   mat_hal_create( “cfc”, ““, 1, 0.2, 0.80000001, 1, [““, ““], TRUE, @
      [“1”, “2”, “3”, “4”, “5”, ““, ““], “fiber”, “matrix”, “Create” )
dump i_return_value
 
#  Creating discontinuous ribbon composite material by name ‘drc’.
i_return_value =                                                     @
   mat_hal_create(“drc”,””,4, 0.59899998, 0.40099999, 0,[“100”,”10”],@
      FALSE,[““,””,””,””,””,””,””], “fiber”, “matrix”, “Create” )
dump i_return_value
#---------------------------------------------------------------------
#  Retrieving data for continuous fiber composite named ‘cfc’.
s_mat_name=”cfc”
#
i_return_value =                                 @
   db_get_comp_hal                               @
      (  s_mat_name,                             @
         i_iopt,                                 @
         s_fiber_name,                           @
         s_matrix_name,                          @
         r_fiber_vol_frac,                       @
         r_matrix_vol_frac,                      @
         i_theory,                               @
         l_override,                             @
         ra_aspect_ratios,                       @
         ra_emperical_factors )
dump i_return_value
 
#  The construction data for continuous fiber composite ‘cfc’ is
dump i_iopt,s_fiber_name,s_matrix_name,i_theory,r_matrix_vol_frac
dump r_fiber_vol_frac,l_override,ra_aspect_ratios,ra_emperical_factors
#---------------------------------------------------------------------
#  Retrieving data for discontinuous ribbon composite named ‘drc’.
s_mat_name=”drc”
#
i_return_value =                                 @
   db_get_comp_hal                               @
      (  s_mat_name,                             @
         i_iopt,                                 @
         s_fiber_name,                           @
         s_matrix_name,                          @
         r_fiber_vol_frac,                       @
         r_matrix_vol_frac,                      @
         i_theory,                               @
         l_override,                             @
         ra_aspect_ratios,                       @
         ra_emperical_factors )
dump i_return_value
 
#  The construction data for discontinuous ribbon composite ‘drc’ is
dump i_iopt,s_fiber_name,s_matrix_name,i_theory,r_matrix_vol_frac
dump r_fiber_vol_frac,l_override,ra_aspect_ratios,ra_emperical_factors
#---------------------------------------------------------------------
db_get_comp_sfc
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_comp_sfc()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      create five materials of type isotropic, 
#                      3d orthotropic, disc. ribbon composite and 
#                      short fiber composites of both types. The 
#                      construction data for the two short fiber 
#                      composite materials will be listed
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_comp_sfc()
#  has the following arguments:
#
#  db_get_comp_sfc
#     (  mat_name,
#        uni_mat_name,
#        ndim,
#        niter,
#        theta_av,
#        sig_theta,
#        phi_av,
#        sig_phi,
#        rho )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_mat_name[32]
STRING   s_uni_mat_name[32]
INTEGER  i_ndim
INTEGER  i_niter
REAL     r_theta_av
REAL     r_sig_theta
REAL     r_phi_av
REAL     r_sig_phi
REAL     r_rho
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Creating isotropic material by name ‘matrix’.
i_return_value =                                                     @
   material.create(“Analysis code ID”,1,”Analysis type ID”,1,        @
      “matrix”,0, “New Material “, “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”], [2, 5, 0], @
      “Property Values”, [“2e5”, “.3”, ““] )
dump i_return_value
 
#  Creating 3d orthotropic material by name ‘fiber’.
i_return_value =                                                     @
   material.create(“Analysis code ID”,1,”Analysis type ID”,1,”fiber”,@
      0,”New Material”, “3d Orthotropic”, 2,”Directionality”,2,      @
      “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”,”Elastic Modulus 22”,       @
      “Elastic Modulus 33”, “Poisson Ratio”,”Poisson Ratio 23”,      @
      “Poisson Ratio 31”, “Shear Modulus”,”Shear Modulus 23”,        @
      “Shear Modulus 31”], [2, 3, 4, 5, 6, 7, 8, 9, 10, 0],          @
      “Property Values”, [“2e5”,”2e5”,”2e5”, “.33”, “.3”, “.37”,     @
      “2e6”, “2e7”, “4e6”, ““] )
dump i_return_value
 
#  Creating discontinuous ribbon composite material by name ‘drc’.
i_return_value =                                                     @
   mat_hal_create(“drc”,””,4, 0.59899998, 0.40099999, 0,[“100”,”10”],@
      FALSE,[““,””,””,””,””,””,””], “fiber”, “matrix”, “Create” )
dump i_return_value
 
#  Creating one dimensional short fiber composite material.
i_return_value =                                                     @
   mat_sfc_create( “sfc1d”, ““, 1, 0., 0., 10., 0., 0., 1000, “drc”, @
      “Create” )
dump i_return_value
 
#  Creating two dimensional short fiber composite material.
i_return_value =                                                     @
   mat_sfc_create( “sfc2d”, ““, 2, 0., 45., 7., 16., 0.2, 1000, “drc”@
      , “Create” )
dump i_return_value
#---------------------------------------------------------------------
#  Retrieving data for one dimensional short fiber composite.
s_mat_name     = “sfc1d”
#
i_return_value =                                 @
   db_get_comp_sfc                               @
      (  s_mat_name,                             @
         s_uni_mat_name,                         @
         i_ndim,                                 @
         i_niter,                                @
         r_theta_av,                             @
         r_sig_theta,                            @
         r_phi_av,                               @
         r_sig_phi,                              @
         r_rho )
dump i_return_value
#  The construction data for one dimensional short fiber composite is
dump s_uni_mat_name,i_ndim,i_niter,r_theta_av,r_sig_theta,r_phi_av
dump r_sig_phi,r_rho
#---------------------------------------------------------------------
#  Retrieving data for two dimensional short fiber composite.
s_mat_name     = “sfc2d”
#
i_return_value =                                 @
   db_get_comp_sfc                               @
      (  s_mat_name,                             @
         s_uni_mat_name,                         @
         i_ndim,                                 @
         i_niter,                                @
         r_theta_av,                             @
         r_sig_theta,                            @
         r_phi_av,                               @
         r_sig_phi,                              @
         r_rho )
dump i_return_value
#  The construction data for two dimensional short fiber composite is
dump s_uni_mat_name,i_ndim,i_niter,r_theta_av,r_sig_theta,r_phi_av
dump r_sig_phi,r_rho
#---------------------------------------------------------------------
 
db_get_constitutive_model
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_constitutive_model()
#
#                      This file opens a new database “new.db”, gets
#                      the constitutive model names and linearity 
#                      codes for the given analysis code.
#
#                      For the material category IDs refer MSC Patran 
#                      User Manual, Part 9, Section 7.7 .
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_constitutive_model()
#  has the following arguments:
#
#  db_get_constitutive_model
#     (  cid,
#        cm_id,
#        cm_name,
#        linearity_code )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_cid
INTEGER  i_cm_id
STRING   s_cm_name[32]
INTEGER  i_linearity_code
INTEGER  i_return_value
INTEGER  i_atid
INTEGER  i_mc_id
INTEGER  iv_cm_id(VIRTUAL)
INTEGER  i_nbr
INTEGER  i_count
STRING   s_atname[16]
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                 @
   db_get_anal_code_id(“MSC.Nastran”,i_cid)
dump i_return_value
#
#  Get the analysis type id for “Structural”
s_atname = “Structural”
i_return_value =                                 @
   db_get_anal_type_id                           @
      (  s_atname,                               @
         i_atid )
dump i_return_value
#
#  The material category ID for Isotropic is 1.
i_mc_id = 1
#
#  Get the count of valid constitutive models.
i_return_value =                                 @
   db_get_valid_const_models_count               @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_nbr )
dump i_return_value
dump i_nbr
#
SYS_ALLOCATE_ARRAY(iv_cm_id, 1, i_nbr)
#
#  Get the IDs of the constitutive models.
i_return_value =                                 @
   db_get_valid_const_models                     @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         iv_cm_id )
dump i_return_value
dump iv_cm_id
#
#  Get the names and the linearity code for  all the 
#  constitutive models
FOR (i_count = 1 to i_nbr )
   i_cm_id = iv_cm_id (i_count)
   i_return_value =                               @
      db_get_constitutive_model                   @
         (  i_cid,                                @
            i_cm_id,                              @
            s_cm_name,                            @
            i_linearity_code )
   dump i_return_value
   dump s_cm_name
   dump i_linearity_code
END FOR
sys_free_array(iv_cm_id)
#---------------------------------------------------------------------
db_get_material_id_from_name
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_material_id_from_name()
#
#                      This file opens a new database “new.db” and 
#                      and creates a new material “New_Material” 
#                      and gets the ID from its name.
#
#                      For material category,linearity,directionality,
#                      and material type IDs refer MSC Patran User 
#                      Manual, Part 9, Section 7.6, 7.7, 9.14.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_material_id_from_name()
#  has the following arguments:
#
#  db_get_material_id_from_name
#     (  mat_name,
#        id )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_mat_name[32]
INTEGER  i_id
INTEGER  i_id_c
INTEGER  i_return_value
STRING   s_description[216]
INTEGER  i_cat
INTEGER  i_lin
INTEGER  i_dir
INTEGER  i_type
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Create a new material
#  Assign the name of the material.
s_mat_name = “New_Material”
#  Assign the description.
s_description = “This material is created for an illustration”
#  Assign the the category as “Isotropic”
i_cat = 1
#  Linearity code is “Linear Elastic”.
i_lin = 1
#  The directionality code is “Isotropic”
i_dir = 1
#  The material type is “Homogeneous material”
i_type = 1
i_return_value =                                 @
   db_create_material                            @
      ( s_mat_name,                              @
        s_description,                           @
        i_cat,                                   @
        i_lin,                                   @
        i_dir,                                   @
        i_type,                                  @
        i_id_c  )
dump i_return_value
dump i_id_c
#
#  Get the ID of the newly created material.
i_return_value =                                 @
   db_get_material_id_from_name                  @
      (  s_mat_name,                             @
         i_id )
dump i_return_value
dump i_id
#---------------------------------------------------------------------
db_get_material_name_from_id
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_material_name_from_id()
#
#                      This file opens a new database “new.db” and 
#                      and creates a new material “New_Material” 
#                      and gets the name from its ID.
#
#                      For material category,linearity,directionality,
#                      and material type IDs refer MSC Patran User 
#                      Manual, Part 9, Section 7.6, 7.7, 9.14.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_material_name_from_id()
#  has the following arguments:
#
#  db_get_material_name_from_id
#     (  id,
#        mat_name )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_id
STRING   s_mat_name[32]
STRING   s_mat_name_c[32]
INTEGER  i_return_value
STRING   s_description[216]
INTEGER  i_cat
INTEGER  i_lin
INTEGER  i_dir
INTEGER  i_type
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Create a new material
#  Assign the name of the material.
s_mat_name_c = “New_Material”
#  Assign the description.
s_description = “This material is created for an illustration”
#  Assign the the category as “Isotropic”
i_cat = 1
#  Linearity code is “Linear Elastic”.
i_lin = 1
#  The directionality code is “Isotropic”
i_dir = 1
#  The material type is “Homogeneous material”
i_type = 1
i_return_value =                                 @
   db_create_material                            @
      ( s_mat_name_c,                            @
        s_description,                           @
        i_cat,                                   @
        i_lin,                                   @
        i_dir,                                   @
        i_type,                                  @
        i_id  )
dump i_return_value
dump i_id 
#  Get the name of the material from its ID.
i_return_value =                                 @
   db_get_material_name_from_id                  @
      (  i_id,                                   @
         s_mat_name )
dump i_return_value
dump s_mat_name
 
#---------------------------------------------------------------------
db_get_matl_category
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_matl_category()
#
#                      This file opens a new database “new.db” and 
#                      gets the count, IDs and the names of the 
#                      material category definition and the 
#                      directionality code in the database.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_matl_category()
#  has the following arguments:
#
#  db_get_matl_category
#     (  cid,
#        mc_id,
#        mc_name,
#        directionality )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_cid
INTEGER  i_mc_id
STRING   s_mc_name[32]
INTEGER  i_directionality
INTEGER  i_return_value
INTEGER  i_atid
INTEGER  iv_mc_id(VIRTUAL)
INTEGER  i_count
INTEGER  i_nbr
STRING   s_atname[32]
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                    @
   db_get_anal_code_id                              @
      (  “MSC.Nastran”,                             @
         i_cid )
dump i_return_value
#
#  Get the analysis type id for “Structural”
s_atname = “Structural”
i_return_value =                                    @
   db_get_anal_type_id                              @
      (  s_atname,                                  @
         i_atid )
dump i_return_value
#
#  Get the count of material category.
i_return_value =                                    @
   db_get_valid_mtl_category_cnt                    @
      (  i_cid,                                     @
         i_atid,                                    @
         i_nbr )
dump i_return_value
dump i_nbr
#
SYS_ALLOCATE_ARRAY(iv_mc_id, 1, i_nbr)
#
#  Get the valid material categories ID.
i_return_value =                                    @
   db_get_valid_mtl_categories                      @
      (  i_cid,                                     @
         i_atid,                                    @
         iv_mc_id )
dump i_return_value
dump iv_mc_id
#
#  Get the category definition and the directionality code.
FOR (i_count = 1 to i_nbr)
   i_mc_id = iv_mc_id(i_count)
   i_return_value =                                 @
      db_get_matl_category                          @
         (  i_cid,                                  @
            i_mc_id,                                @
            s_mc_name,                              @
            i_directionality )
   dump i_return_value
   dump s_mc_name
   dump i_directionality
END FOR
sys_free_array(iv_mc_id)
#---------------------------------------------------------------------
db_get_matl_prop_alias
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_matl_prop_alias()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      display the names of the allowable material
#                      properties.
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function db_get_matl_prop_alias()
#  has the following arguments:
#
#  db_get_matl_prop_alias
#     (  cid,
#        atid,
#        mc_id,
#        cm_id,
#        mp_id,
#        mp_alias,
#        field_ok )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_cid
INTEGER  i_atid
INTEGER  i_mc_id
INTEGER  i_cm_id
INTEGER  i_mp_id
STRING   s_mp_alias[32]
INTEGER  i_field_ok
INTEGER  i_return_value
INTEGER  i_nbr
INTEGER  iv_mp_id(VIRTUAL)
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Analysis code id for MSC.Nastran is 1.
i_cid=1
#  Analysis type id for Structural analysis is 1.
i_atid=1
#  Using Material Category for Isotropic Material, which is 1.
i_mc_id=1
#  For Linear Elastic Constitutive Model, id is 1.
i_cm_id=1
#  Finding out number of allowable properties in the database. And
#  allocating the space for the output array.
#
i_return_value =                                 @
   db_get_all_allow_matl_prop_cnt                @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         i_nbr )
dump i_return_value
sys_allocate_array(iv_mp_id,1,i_nbr)
#---------------------------------------------------------------------
#  Calling function to read the property ids.
#
i_return_value =                                 @
   db_get_all_allowable_matl_prop                @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         iv_mp_id )
dump i_return_value
dump iv_mp_id
#---------------------------------------------------------------------
#  Finding out material property names for the first material property
#  name id.
i_mp_id = iv_mp_id(1)
#
i_return_value =                                 @
   db_get_matl_prop_alias                        @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         i_mp_id,                                @
         s_mp_alias,                             @
         i_field_ok )
dump i_return_value
dump s_mp_alias,i_field_ok
#---------------------------------------------------------------------
sys_free_array(iv_mp_id)
#---------------------------------------------------------------------
db_get_matl_prop_defn
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_matl_prop_defn()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      get all the material property ids for Linear 
#                      Elastic Structural analysis on MSC.Nastran.
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function db_get_matl_prop_defn()
#  has the following arguments:
#
#  db_get_matl_prop_defn
#     (  mp_id,
#        mp_name )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_mp_id
STRING   s_mp_name[32]
INTEGER  i_return_value
INTEGER  i_cid
INTEGER  i_atid
INTEGER  i_mc_id
INTEGER  i_cm_id
INTEGER  i_nbr
INTEGER  iv_mp_id(VIRTUAL)
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Analysis code id for MSC.Nastran is 1.
i_cid=1
#  Analysis type id for Structural analysis is 1.
i_atid=1
#  Using Material Category for Isotropic Material, which is 1.
i_mc_id=1
#  For Linear Elastic Constitutive Model, id is 1.
i_cm_id=1
#  Finding out number of allowable properties in the database. And
#  allocating the space for the output array.
#
i_return_value =                                 @
   db_get_all_allow_matl_prop_cnt                @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         i_nbr )
dump i_return_value
sys_allocate_array(iv_mp_id,1,i_nbr)
#---------------------------------------------------------------------
#  Calling function to read the property ids.
#
i_return_value =                                 @
   db_get_all_allowable_matl_prop                @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_cm_id,                                @
         iv_mp_id )
dump i_return_value
dump iv_mp_id
#---------------------------------------------------------------------
#  Getting material property defination name for first property id.
i_mp_id = iv_mp_id(1)
#
i_return_value =                                 @
   db_get_matl_prop_defn                         @
      (  i_mp_id,                                @
         s_mp_name )
dump i_return_value
dump s_mp_name
#---------------------------------------------------------------------
sys_free_array(iv_mp_id)
#---------------------------------------------------------------------
db_get_mtl_allowable_magic_cnt
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_mtl_allowable_magic_cnt()
#
#                      This file opens a new database “new.db”,and 
#                      1. Gets the count of magics for the magic
#                      category  “Hardening Rule”.
#                      2. Creates new allowable magics for 
#                      the magic category “Hardening Rule”. and
#                      3. Gets the latest count of the magics for
#                      the magic category “Hardening Rule”
#
#                      For material category IDs, magic category IDs,
#                      magic option IDs refer MSC Patran User Manual,
#                      Part 9, Section 7.6 and 7.7 .
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_mtl_allowable_magic_cnt()
#  has the following arguments:
#
#  db_get_mtl_allowable_magic_cnt
#     (  code_id,
#        matl_cat_id,
#        magic_category_id,
#        nbr )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_code_id
INTEGER  i_matl_cat_id
INTEGER  i_magic_category_id
INTEGER  i_nbr
INTEGER  i_return_value
INTEGER  ia_magic_alias_id(3)
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                        @ 
   db_get_anal_code_id(“MSC.Nastran”,i_code_id)
dump i_return_value
#
#  The material category ID for “Isotropic” is 1.
i_matl_cat_id = 1
#  The magic category id for “Hardening Rule” is 5.
i_magic_category_id = 5
#
#  Get the count of the material allowable magics.
i_return_value =                                       @
   db_get_mtl_allowable_magic_cnt                      @
      (  i_code_id,                                    @
         i_matl_cat_id,                                @
         i_magic_category_id,                          @
         i_nbr )
dump i_return_value
dump i_nbr
#  Create three new valid magic options for the 
#  “Hardening Rule”
#  The magics option ids for VonMises, Tresca and Mohr_coulomb
#  yield functions are 10,11 and 12 respectively.
#  hardening are 10,11 and 12 respectively.
ia_magic_alias_id = [10,11,12]
i_nbr = 3
i_return_value =                                       @
   db_create_mtl_allowable_magics                      @
      (  i_code_id,                                    @
         i_matl_cat_id,                                @
         i_magic_category_id,                          @
         ia_magic_alias_id,                            @
         i_nbr )
dump i_return_value
#
#  Get the new count of the material allowable magics.
i_return_value =                                       @
   db_get_mtl_allowable_magic_cnt                      @
      (  i_code_id,                                    @
         i_matl_cat_id,                                @
         i_magic_category_id,                          @
         i_nbr )
dump i_return_value
dump i_nbr
#---------------------------------------------------------------------
db_get_mtl_allowable_magics
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_mtl_allowable_magics()
#
#                      This file opens a new database “new.db” and
#                      gets the count and IDs of the magics options 
#                      for the magics category “Hardening Rule”.
#
#                      For material category IDs, magic category IDs,
#                      magic option IDs refer MSC Patran User Manual,
#                      Part 9, Section 7.6 and 7.7 .
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_mtl_allowable_magics()
#  has the following arguments:
#
#  db_get_mtl_allowable_magics
#     (  code_id,
#        matl_cat_id,
#        magic_category_id,
#        magic_alias_id )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_code_id
INTEGER  i_matl_cat_id
INTEGER  i_magic_category_id
INTEGER  iv_magic_alias_id(VIRTUAL)
INTEGER  i_return_value
INTEGER  i_nbr
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                 @
   db_get_anal_code_id(“MSC.Nastran”,i_code_id)
dump i_return_value
#
#  Get the count of the allowable magics options.
#  The material category ID for “Isotropic” is 1.
i_matl_cat_id = 1
#  The magic category id for “Hardening Rule” is 5.
i_magic_category_id = 5
i_return_value =                                 @
   db_get_mtl_allowable_magic_cnt                @
      (  i_code_id,                              @
         i_matl_cat_id,                          @
         i_magic_category_id,                    @
         i_nbr )
dump i_return_value
dump i_nbr
#
SYS_ALLOCATE_ARRAY (iv_magic_alias_id, 1, i_nbr )
#
#  Get the IDs of the allowable magics options.
i_return_value =                                 @
   db_get_mtl_allowable_magics                   @
      (  i_code_id,                              @
         i_matl_cat_id,                          @
         i_magic_category_id,                    @
         iv_magic_alias_id )
dump i_return_value
dump iv_magic_alias_id
#
sys_free_array(iv_magic_alias_id)
#---------------------------------------------------------------------
db_get_mtl_magics
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_mtl_magics()
#
#                      This file opens a new database “new.db”, and
#                      gets the count and the IDs of the magic
#                      categories for the given set of input values.
#
#                      For material category IDs, constitutive model
#                      IDs refer MSC Patran User Manual,  Part 9, 
#                      Section 7.6 and 7.7 .
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_mtl_magics()
#  has the following arguments:
#
#  db_get_mtl_magics
#     (  analysis_code_id,
#        analysis_type_id,
#        matl_category_id,
#        constit_model_id,
#        magic_category_id )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_analysis_code_id
INTEGER  i_analysis_type_id
INTEGER  i_matl_category_id
INTEGER  i_constit_model_id
INTEGER  iv_magic_category_id(VIRTUAL)
INTEGER  i_return_value
STRING   s_atname[32]
INTEGER  i_nbr
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                 @ 
   db_get_anal_code_id(“MSC.Nastran”,i_analysis_code_id)
dump i_return_value
#
#  Get the analysis type id for “Structural”
s_atname = “Structural”
i_return_value =                                 @
   db_get_anal_type_id                           @
      (  s_atname,                               @
         i_analysis_type_id )
dump i_return_value
#
#  Get the count of the magic categories
#  The material category ID for ‘Isotropic’ is 1.
i_matl_category_id = 1
#  The constitutive model ID for ‘Elastoplastic’ is 3.
i_constit_model_id = 3
i_return_value =                                 @
   db_get_mtl_magics_count                       @
      (  i_analysis_code_id,                     @
         i_analysis_type_id,                     @
         i_matl_category_id,                     @
         i_constit_model_id,                     @
         i_nbr )
dump i_return_value
dump i_nbr
#---------------------------------------------------------------------
SYS_ALLOCATE_ARRAY(iv_magic_category_id, 1, i_nbr)
#
#  Get the magic category IDs.
i_return_value =                                 @
   db_get_mtl_magics                             @
      (  i_analysis_code_id,                     @
         i_analysis_type_id,                     @
         i_matl_category_id,                     @
         i_constit_model_id,                     @
         iv_magic_category_id )
dump i_return_value
dump iv_magic_category_id
sys_free_array(iv_magic_category_id)
#---------------------------------------------------------------------
db_get_mtl_magics_count
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_mtl_magics_count()
#
#                      This file opens a new database “new.db” and 
#                      gets the count of magic categories for the
#                      given set of input values.
#
#                      For material category IDs, constitutive model
#                      IDs,refer MSC Patran User Manual, Part 9, 
#                      Section 7.6 and 7.7 .
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_mtl_magics_count()
#  has the following arguments:
#
#  db_get_mtl_magics_count
#     (  analysis_code_id,
#        analysis_type_id,
#        matl_category_id,
#        constit_model_id,
#        nbr )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_analysis_code_id
INTEGER  i_analysis_type_id
INTEGER  i_matl_category_id
INTEGER  i_constit_model_id
INTEGER  i_nbr
INTEGER  i_return_value
STRING   s_atname[32]
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                 @
   db_get_anal_code_id(“MSC.Nastran”,i_analysis_code_id)
dump i_return_value
#
#  Get the analysis type id for “Structural”
s_atname = “Structural”
i_return_value =                                 @
   db_get_anal_type_id                           @
      (  s_atname,                               @
         i_analysis_type_id )
dump i_return_value
#  Get the count of the magic categories.
#  The material category ID for ‘Isotropic’ is 1.
i_matl_category_id = 1
#  The constitutive model ID for ‘Elastoplastic’ is 3.
i_constit_model_id = 3
i_return_value =                                 @
   db_get_mtl_magics_count                       @
      (  i_analysis_code_id,                     @
         i_analysis_type_id,                     @
         i_matl_category_id,                     @
         i_constit_model_id,                     @
         i_nbr )
dump i_return_value
dump i_nbr
#---------------------------------------------------------------------
db_get_mtl_magics_defn
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_mtl_magics_defn()
#
#                      This file opens a new database “new.db” and
#                      gets the count, IDs and the labels of the
#                      magic categories.
#
#                      For material category IDs, magic category IDs,
#                      magic option IDs  and the constitutive model
#                      IDs refer MSC Patran User Manual, Part 9, 
#                      Section 7.6 and 7.7 .
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_mtl_magics_defn()
#  has the following arguments:
#
#  db_get_mtl_magics_defn
#     (  analysis_code_id,
#        analysis_type_id,
#        magic_category_id,
#        magic_label )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_analysis_code_id
INTEGER  i_analysis_type_id
INTEGER  i_magic_category_id 
INTEGER  i_matl_category_id
STRING   s_magic_label[64]
INTEGER  i_return_value
INTEGER  i_constit_model_id
INTEGER  iv_magic_category_id(VIRTUAL)
INTEGER  i_count
STRING   s_atname[32]
INTEGER  i_nbr
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                    @     
   db_get_anal_code_id(“MSC.Nastran”,i_analysis_code_id)
dump i_return_value
#
#  Get the analysis type id for “Structural”
s_atname = “Structural”
i_return_value =                                    @
   db_get_anal_type_id                              @
      (  s_atname,                                  @
         i_analysis_type_id )
dump i_return_value
#
#  The material category ID for ‘Isotropic’ is 1.
i_matl_category_id = 1
#  The constitutive model ID for ‘Elastoplastic’ is 3.
i_constit_model_id = 3
#  Get the count of the magic categories.
i_return_value =                                    @
   db_get_mtl_magics_count                          @
      (  i_analysis_code_id,                        @
         i_analysis_type_id,                        @
         i_matl_category_id,                        @
         i_constit_model_id,                        @
         i_nbr )
dump i_return_value
dump i_nbr
#
SYS_ALLOCATE_ARRAY(iv_magic_category_id, 1, i_nbr)
#
#  Get the IDs of the magic categories.
i_return_value =                                    @
   db_get_mtl_magics                                @
      (  i_analysis_code_id,                        @
         i_analysis_type_id,                        @
         i_matl_category_id,                        @
         i_constit_model_id,                        @
         iv_magic_category_id )
dump i_return_value
dump iv_magic_category_id
#
#  Get the magic label for all the magic categories.
FOR (i_count = 1 to i_nbr)
   i_magic_category_id = iv_magic_category_id(i_count)
   i_return_value =                                 @
      db_get_mtl_magics_defn                        @
         (  i_analysis_code_id,                     @
            i_analysis_type_id,                     @
            i_magic_category_id,                    @
            s_magic_label )
   dump i_return_value
   dump s_magic_label
END FOR
sys_free_array(iv_magic_category_id)
#---------------------------------------------------------------------
db_get_mtl_magics_options
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_mtl_magics_options()
#
#                      This file opens a new database “new.db” and
#                      Gets the count, IDs and the names of magic 
#                      options for the magic category 
#                      “Hardening Rule”.
#
#                      For material category IDs, magic category IDs,
#                      magic option IDs  and the constitutive model
#                      IDs refer MSC Patran User Manual, Part 9, 
#                      Section 7.6 and 7.7 .
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_mtl_magics_options()
#  has the following arguments:
#
#  db_get_mtl_magics_options
#     (  analysis_code_id,
#        magic_alias_id,
#        magic_name )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_analysis_code_id
INTEGER  i_magic_alias_id
STRING   s_magic_name[64]
INTEGER  i_return_value
INTEGER  i_matl_cat_id
INTEGER  i_magic_category_id
INTEGER  iv_magic_alias_id(VIRTUAL)
INTEGER  i_nbr
INTEGER  i_count
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                          @
   db_get_anal_code_id(“MSC.Nastran”,i_analysis_code_id)
dump i_return_value
#
#  The material category ID for “Isotropic” is 1.
i_matl_cat_id = 1
#  The magic category id for “Hardening Rule” is 5.
i_magic_category_id = 5
#
#  Get the count of the magic options.
i_return_value =                                          @
   db_get_mtl_allowable_magic_cnt                         @
      (  i_analysis_code_id,                              @
         i_matl_cat_id,                                   @
         i_magic_category_id,                             @
         i_nbr )
dump i_return_value
dump i_nbr
#
SYS_ALLOCATE_ARRAY (iv_magic_alias_id, 1, i_nbr )
#
#  Get the IDs of the magic options.
i_return_value =                                          @
   db_get_mtl_allowable_magics                            @
      (  i_analysis_code_id,                              @
         i_matl_cat_id,                                   @
         i_magic_category_id,                             @
         iv_magic_alias_id )
dump i_return_value
dump iv_magic_alias_id
#
#  Get the names of all the magic options.
FOR ( i_count = 1 to i_nbr )
   i_magic_alias_id = iv_magic_alias_id(i_count)
   i_return_value =                                        @
      db_get_mtl_magics_options                            @
         (  i_analysis_code_id,                            @
            i_magic_alias_id,                              @
            s_magic_name )
   dump i_return_value
   dump s_magic_name
END FOR
sys_free_array(iv_magic_alias_id)
#---------------------------------------------------------------------
 
db_get_next_cond_opt_code_names
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_next_cond_opt_code_names()
#
#                      This session file will open a new database 
#                      by name ‘new.db’ with default options and will
#                      display the available condense_options.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function db_get_next_cond_opt_code_names() 
#  has following arguments
#  db_get_next_cond_opt_code_names
#     ( name,
#       id )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_name[32]
INTEGER  i_id
INTEGER  all_status
INTEGER  next_status = 0
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Calling the ‘get_all’ function to read all the relation_names in
#  the relation ‘condense_option’.
#
all_status =                                     @
   db_get_all_cond_opt_code_names()
dump all_status
#---------------------------------------------------------------------
#  Calling ‘get_next’ function to read the relation_names one by one.
#
WHILE ( next_status == 0 )
   next_status =                                 @
      db_get_next_cond_opt_code_names            @
         (  s_name,                              @
            i_id )
   dump next_status
   IF( next_status == 0 ) THEN
#  The relation name and id are.
      dump s_name,i_id
   ENDIF
END WHILE
#---------------------------------------------------------------------
db_get_next_lam_opt_code_names
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_next_lam_opt_code_names()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      display the available laminate_options.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function db_get_next_lam_opt_code_names()
#  has the following arguments:
#
#  db_get_next_lam_opt_code_names
#     (  name,
#        id )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_name[32]
INTEGER  i_id
INTEGER  all_status
INTEGER  next_status = 0
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Calling the ‘get_all’ function to read all the relation_names in
#  the relation ‘laminate_option’.
#
all_status =                                     @
   db_get_all_lam_opt_code_names()
dump all_status
#---------------------------------------------------------------------
#  Calling ‘get_next’ function to read the relation_names one by one.
#
WHILE ( next_status == 0 )
   next_status =                                 @
      db_get_next_lam_opt_code_names             @
         (  s_name,                              @
            i_id )
   dump next_status
   IF (next_status == 0 )THEN
#  The relation name and id are.
      dump s_name,i_id
   ENDIF
END WHILE
#---------------------------------------------------------------------
db_get_next_material_name
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_next_material_name()
#
#                      This file opens a new database “new.db” and
#                      creates two materials. Then gets all the
#                      material information in get all, get next
#                      method.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#
#  The function db_get_next_material_name() has the following 
#  arguments.
#  db_get_next_material_name
#     ( name,
#       id,
#       cat,
#       lin,
#       dir,
#       type )       
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_name[64]
INTEGER  i_id
INTEGER  i_cat
INTEGER  i_lin
INTEGER  i_dir
INTEGER  i_type
INTEGER  i_return_value
INTEGER  all_status
INTEGER  next_status = 0
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Create a new material “Material_1”.
i_return_value =                                       @
   material.create                                     @
     ( “Analysis code ID”, 1, “Analysis type ID”, 1,   @
       “Material_1”, 0, “Date:                         @
       Time:         “, “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”], [2, 5, 0], @
       “Property Values”, [“3.6e6”, “.33”, ““] )
dump i_return_value
#
#  Create one more material “Material_2”.
i_return_value =                                       @
   material.create                                     @
     ( “Analysis code ID”, 1, “Analysis type ID”, 1,   @
       “Material_2”, 0, “Date:                         @
       Time:         “, “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”], [2, 5, 0], @
       “Property Values”, [“3.6e6”, “.33”, ““] )
dump i_return_value
#
#  Get all the all the material names from the database
all_status = db_get_all_material_names ( )
dump all_status
#
#  Get all  material information from the database
WHILE ( next_status == 0 )
   next_status =                                       @
      db_get_next_material_name                        @
         (  s_name,                                    @ 
            i_id,                                      @
            i_cat,                                     @
            i_lin,                                     @
            i_dir,                                     @
            i_type )
   dump next_status
   IF ( next_status == 0 ) THEN
      dump s_name
      dump i_id
      dump i_cat
      dump i_lin
      dump i_dir
      dump i_type
   END IF 
END WHILE
#
#---------------------------------------------------------------------
db_get_valid_const_models
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_valid_const_models()
#
#                      This file opens a new database “new.db” and
#                      gets the number of valid constitutive models 
#                      and their IDs. 
#
#                      For material category IDs refer MSC Patran User
#                      Manual, Part 7, Section 7.7 .
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_valid_const_models()
#  has the following arguments:
#
#  db_get_valid_const_models
#     (  cid,
#        atid,
#        mc_id,
#        cm_id )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_cid
INTEGER  i_atid
INTEGER  i_mc_id
INTEGER  iv_cm_id(VIRTUAL)
INTEGER  i_return_value
INTEGER  i_nbr
STRING   s_atname[16]
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                 @
   db_get_anal_code_id(“MSC.Nastran”,i_cid)
dump i_return_value
#
#  Get the analysis type id for “Structural”
s_atname = “Structural”
i_return_value =                                 @
   db_get_anal_type_id                           @
      (  s_atname,                               @
         i_atid )
dump i_return_value
#
#  The material category ID for Isotropic is 1.
i_mc_id = 1
#  Get the count of valid constitutive models. 
i_return_value =                                 @
   db_get_valid_const_models_count               @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_nbr )
dump i_return_value
dump i_nbr
#
SYS_ALLOCATE_ARRAY(iv_cm_id, 1, i_nbr)
#
#  Get the IDs of the constitutive models.
i_return_value =                                 @
   db_get_valid_const_models                     @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         iv_cm_id )
dump i_return_value
dump iv_cm_id
sys_free_array(iv_cm_id)
#---------------------------------------------------------------------
db_get_valid_const_models_count
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_valid_const_models_count()
#                   
#                      This file opens a new database “new.db” and 
#                      gets the number of constitutive models.
#
#                      For material category IDs refer MSC Patran User
#                      Manual, Part 9, Section 7.6 . 
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_valid_const_models_count()
#  has the following arguments:
#
#  db_get_valid_const_models_count
#     (  cid,
#        atid,
#        mc_id,
#        nbr )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_cid
INTEGER  i_atid
INTEGER  i_mc_id
INTEGER  i_nbr
INTEGER  i_return_value
STRING   s_atname[16]
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                 @
   db_get_anal_code_id(“MSC.Nastran”,i_cid)
dump i_return_value
#
#  Get the analysis type id for “Structural”
s_atname = “Structural”
i_return_value =                                 @
   db_get_anal_type_id                           @
      (  s_atname,                               @
         i_atid )
dump i_return_value
#
#  The material category ID for Isotropic is 1.
i_mc_id = 1
#
#  Get the number of valid constitutive models.
i_return_value =                                 @
   db_get_valid_const_models_count               @
      (  i_cid,                                  @
         i_atid,                                 @
         i_mc_id,                                @
         i_nbr )
dump i_return_value
dump i_nbr
 
#---------------------------------------------------------------------
db_get_valid_mtl_categories
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_valid_mtl_categories()
#
#                      This file opens a new database “new.db”, gets
#                      the count and the ID of the valid material
#                      categories for the given analysis code 
#                      and type.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_valid_mtl_categories()
#  has the following arguments:
#
#  db_get_valid_mtl_categories
#     (  cid,
#        atid,
#        mc_id )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_cid
INTEGER  i_atid
INTEGER  iv_mc_id(VIRTUAL)
INTEGER  i_return_value
INTEGER  i_nbr
STRING   s_atname[32]
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Get the code id for “MSC.Nastran”
i_return_value =                                 @
   db_get_anal_code_id                           @
      (  “MSC.Nastran”,                          @
         i_cid )
dump i_return_value
#
#  Get the analysis type id for “Structural”
s_atname = “Structural”
i_return_value =                                 @
   db_get_anal_type_id                           @
      (  s_atname,                               @
         i_atid )
dump i_return_value
#
#  Get the count of the material category.
i_return_value =                                 @
   db_get_valid_mtl_category_cnt                 @
      (  i_cid,                                  @
         i_atid,                                 @
         i_nbr )
dump i_return_value
#
SYS_ALLOCATE_ARRAY(iv_mc_id, 1, i_nbr)
#
#  Get the ID of the material categories.
i_return_value =                                 @
   db_get_valid_mtl_categories                   @
      (  i_cid,                                  @
         i_atid,                                 @
         iv_mc_id )
dump i_return_value
dump iv_mc_id
#
sys_free_array(iv_mc_id)
#---------------------------------------------------------------------
db_get_valid_mtl_category_cnt
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_get_valid_mtl_category_cnt()
#
#                      This file opens a new database “new.db” and
#                      gets the number of valid material categories
#                      for the analysis code “MSC.Nastran” having
#                      “Structural” as the analysis type.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_get_valid_mtl_category_cnt()
#  has the following arguments:
#
#  db_get_valid_mtl_category_cnt
#     (  cid,
#        atid,
#        nbr )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_cid
INTEGER  i_atid
INTEGER  i_nbr
INTEGER  i_return_value
STRING   s_atname[32]
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
 
#  Get the code id for “MSC.Nastran”
i_return_value =                                 @
   db_get_anal_code_id                           @
      (  “MSC.Nastran”,                          @
         i_cid )
dump i_return_value
#
#  Get the analysis type id for “Structural”
s_atname = “Structural”
i_return_value =                                 @
   db_get_anal_type_id                           @
      (  s_atname,                               @
         i_atid )
dump i_return_value
#
#  Get the material category count.
i_return_value =                                 @
   db_get_valid_mtl_category_cnt                 @
      (  i_cid,                                  @
         i_atid,                                 @
         i_nbr )
dump i_return_value
dump i_nbr
#---------------------------------------------------------------------
db_mo_const_models_specified
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_mo_const_models_specified()
#
#                      1. This file opens a new database “new.db”
#                      2. Creates a new material
#                      3. Gets the ID of the newly created material
#                      4. Gets the magic numbers ID and active flag
#                      5. Changes the magic numbers ID and flag
#                      and
#                      6. Gets the new magic numbers ID and flag
#
#                      The constitutive model IDs, magic number IDs
#                      and active flag values are available in
#                      MSC Patran User Manual, Part 9, Section 7.7 
#                      & 9.14
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_mo_const_models_specified()
#  has the following arguments:
#
#  db_mo_const_models_specified
#     (  mid,
#        cm_id,
#        magics,
#        active )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_mid
INTEGER  i_cm_id
INTEGER  ia_magics(5)
INTEGER  i_active
INTEGER  i_return_value
STRING   s_mat_name[32]
#---------------------------------------------------------------------
#  Open a new data base “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Create a new material “New_Material” with “Linear Elastic”
#  constitutive model.
i_return_value =                                       @
   material.create                                     @
     ( “Analysis code ID”, 1, “Analysis type ID”, 1,   @
       “New_Material”, 0, “Date: 20-Aug-97             @
       Time: 17:47:10”, “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”], [2, 5, 0], @
       “Property Values”, [“3.6e6”, “.33”, ““] )
dump i_return_value
#
#  Get the ID of the newly created material.
s_mat_name = “New_Material”
i_return_value =                                       @
   db_get_material_id_from_name                        @
      (  s_mat_name,                                   @
         i_mid )
dump i_return_value
dump i_mid
#
#  Get the magics IDs and the active flag of the newly
#  created material.
#  The constitutive model code ID for “Linear Elastic” is 1.
i_cm_id = 1
i_return_value =                                       @
   db_get_active_flag                                  @
      (  i_mid,                                        @
         i_cm_id,                                      @
         ia_magics,                                    @
         i_active )
dump i_return_value
dump ia_magics
dump i_active
#
#  Modify the constitutive model magic numbers ID and
#  the active flag.
ia_magics = [11,12,13,0,0]
IF (i_active == 1) THEN
   i_active = 0
ELSE
   i_active = 1
END IF
i_return_value =                                       @
   db_mo_const_models_specified                        @
      (  i_mid,                                        @
         i_cm_id,                                      @
         ia_magics,                                    @
         i_active )
dump i_return_value
 
#  Get the magics IDs and the active flag of the modified
#  constitutive model.
i_return_value =                                       @
   db_get_active_flag                                  @
      (  i_mid,                                        @
         i_cm_id,                                      @
         ia_magics,                                    @
         i_active )
dump i_return_value
dump ia_magics
dump i_active
#---------------------------------------------------------------------
db_modify_material
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_modify_material()
#
#                      This file opens a new database “new.db” and 
#                      creates a new material “New_Material” with
#                      specific set of input values. It then
#                      modifies the input values and shows the
#                      modified values of the material.
#
#                      For material category,linearity,directionality,
#                      and material type IDs refer MSC Patran User 
#                      Manual, Part 9, Section 7.6, 7.7, 9.14.
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function db_modify_material()
#  has the following arguments:
#
#  db_modify_material
#     (  mid,
#        desc,
#        mc_id,
#        lin,
#        dir,
#        mat_type )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_mid
STRING   s_desc[128]
INTEGER  i_mc_id
INTEGER  i_lin
INTEGER  i_dir
INTEGER  i_mat_type
STRING   s_desc_c[128]
INTEGER  i_mc_id_c
INTEGER  i_lin_c
INTEGER  i_dir_c
INTEGER  i_mat_type_c
INTEGER  i_return_value
STRING   s_mat_name[32]
INTEGER  i_data_exists
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#
#  Create a new material
#  The name of the material is “New_Material”
s_mat_name = “New_Material”
#  Give the description to the material
s_desc = “This material is created for an illustration”
#  The material category ID for “Isotropic” is 1.
i_mc_id = 1
#  The linearity code ID for “Linear Elastic” is 1.
i_lin = 1
#  The directionality code for “Isotropic” is 1.
i_dir = 1
#  The material type ID for homogeneous material is 0
i_mat_type = 0
#
i_return_value =                                 @
   db_create_material                            @
      ( s_mat_name,                              @
        s_desc,                                  @
        i_mc_id,                                 @
        i_lin,                                   @
        i_dir,                                   @
        i_mat_type,                              @
        i_mid  )
dump i_return_value
#
#  Modify the description, category ID, linearity code ID
#  directionality code ID and the material type.
#
#  Give the new description
s_desc = “This is the modified Material”
#  The modified category is “3D Orthotropic”
i_mc_id = 2
#  The modified linearity code is “Nonlinear Elastic”
i_lin = 2
#  The modified material directionality code is “Orthotropic”
i_dir = 2
#  The new material type is “Standard laminate lay-up”.
i_mat_type =1
i_return_value =                                 @
   db_modify_material                            @
      (  i_mid,                                  @
         s_desc,                                 @
         i_mc_id,                                @
         i_lin,                                  @
         i_dir,                                  @
         i_mat_type )
dump i_return_value
#
#  Get the modified values of the material
i_return_value =                                 @
   db_get_material                               @
      (  i_mid,                                  @
         s_mat_name,                             @
         i_mc_id_c,                              @
         i_lin_c,                                @
         i_dir_c,                                @
         s_desc_c,                               @
         i_mat_type_c,                           @
         i_data_exists )
dump i_return_value
dump s_desc_c
dump i_mc_id_c
dump i_lin_c
dump i_dir_c
dump i_mat_type_c
 
#---------------------------------------------------------------------
 
db_modify_matl_prop_value
()
#  Purpose          :  This file provides an example of a call to the
#                      function db_modify_matl_prop_value()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      add one defination of isotropic material and
#                      field. The values for Elastic Modulus and 
#                      Poisson Ratio will be modified and Reference 
#                      Temperature added.
#                      Before modification session file is paused for
#                      user to see the created material. Similarly 
#                      after modification user will have to see the 
#                      change in MATERIAL SHOW form.
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.6 and 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function db_modify_matl_prop_value()
#  has the following arguments:
#
#  db_modify_matl_prop_value
#     (  mid,
#        mp_id,
#        fid,
#        real,
#        nbr )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  i_mid
INTEGER  ia_mp_id(4)
INTEGER  ia_fid(4)
REAL     ra_real(4)
INTEGER  i_nbr
INTEGER  i_return_value
INTEGER  i_id_field
STRING   s_name[64]
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Creating field for material with Temperature as single independent
#  variable. Name of the field is “Session_example_field”.
s_name         = “Session_example_field”
i_return_value =                                                     @
   fields_create( s_name, “Material”, 1, “Scalar”,                   @
      “Real”, ““,””, “Table”, 1, “T”, ““, ““, ““, ““, ““, FALSE,     @
      [10., 20., 30., 40., 50.], [0.], [0.],                         @
      [[[2E+11]][[1.7499999E+11]] [[1.4999999E+11]][[1.25E+11]]      @
      [[9.9999998E+10]]] )
dump i_return_value
 
#  Getting the id for the created field.
i_return_value = db_get_field_id(s_name,i_id_field)
dump i_return_value
 
#  Creating material for Structural analysis on MSC.Nastran based on 
#  linear elastic theory. Material name is “Session_example_material”
s_name         = “Session_example_material”
i_return_value =                                                     @
   material.create( “Analysis code ID”, 1, “Analysis type ID”, 1,    @
      s_name, 0, “New material”, “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”],         @
      [2, 5, 0], “Property Values”,[“2e12”, “.35”, ““] )
dump i_return_value
 
#  Getting the id for the created material.
i_return_value = db_get_material_id_from_name(s_name,i_mid)
dump i_return_value
#---------------------------------------------------------------------
#  Session file paused. Press “Resume” to continue..
#  Session file execution is paused to see the material created.
#  Open MATERIAL SHOW form, select the only material and press
#  ‘Show Properties’ button.
sf_pause()
#---------------------------------------------------------------------
#  Number of properties which need to be supplied are
i_nbr          = 4
#  The property id array is
ia_mp_id(1)    = 1
ia_mp_id(2)    = 2
ia_mp_id(3)    = 5
ia_mp_id(4)    = 8
 
#  The created field will be used for modifing the Elastic Modulus.
#  Which has property id as 2.
ia_fid(2)      = i_id_field
 
#  Reference Temperature (property id 1) and Poisson Ratio(property 
#  id 5) will be modified.
ra_real(1)     = 40
ra_real(3)     = .4
#---------------------------------------------------------------------
#  Modifying the property values.
#
i_return_value =                                 @
   db_modify_matl_prop_value                     @
      (  i_mid,                                  @
         ia_mp_id,                               @
         ia_fid,                                 @
         ra_real,                                @
         i_nbr )
dump i_return_value
 
#---------------------------------------------------------------------
#  The result of modification can be seen through MATERIAL SHOW option
#  on the main menu.
#---------------------------------------------------------------------
engin_cons_to_elastic_matrix
()
#  Purpose          :  This file provides an example of a call to the
#                      function engin_cons_to_elastic_matrix()
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function engin_cons_to_elastic_matrix()
#  has the following arguments:
#
#  engin_cons_to_elastic_matrix
#     (  e,
#        c,
#        status )
#
#---------------------------------------------------------------------
#  Variable Declarations
REAL     ra_e(9)
REAL     ra_c(21)
INTEGER  i_status
#---------------------------------------------------------------------
#  Assigning material properties for a 3d orthotropic material.
ra_e(1)=2e5
ra_e(2)=4e5
ra_e(3)=3e4
ra_e(4)=.3
ra_e(5)=.33
ra_e(6)=.36
ra_e(7)=2e11
ra_e(8)=3e12
ra_e(9)=4e9
#
#  Converting the engineering constants into 21 stress-strain 
#  coefficients.
engin_cons_to_elastic_matrix                  @
   (  ra_e,                                   @
      ra_c,                                   @
      i_status )
dump i_status
dump ra_c
#---------------------------------------------------------------------
get_qab_from_engin_cons
()
#  Purpose          :  This file provides an example of a call to the
#                      function get_qab_from_engin_cons()
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function get_qab_from_engin_cons()
#  has the following arguments:
#
#  get_qab_from_engin_cons
#     (  e,
#        qab,
#        ier )
#
#---------------------------------------------------------------------
#  Variable Declarations
REAL     ra_e(8)
REAL     ra_qab(3,3)
INTEGER  i_ier
#---------------------------------------------------------------------
#  Assigning values to the engineering constants.
ra_e(1)=2e6
ra_e(2)=3e4
ra_e(4)=.35
ra_e(7)=2e9
#
#  Converting engineering constants into an array of 9 elements.
get_qab_from_engin_cons                       @
   (  ra_e,                                   @
      ra_qab,                                 @
      i_ier )
dump i_ier
dump ra_qab
#---------------------------------------------------------------------
mat_2d_ani_to_2d_ort
()
#  Purpose          :  This file provides an example of a call to the
#                      function mat_2d_ani_to_2d_ort()
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function mat_2d_ani_to_2d_ort()
#  has the following arguments:
#
#  mat_2d_ani_to_2d_ort
#     (  s11,
#        s12,
#        s22,
#        div_tol,
#        e11,
#        e22,
#        v12 )
#
#---------------------------------------------------------------------
#  Variable Declarations
REAL     r_s11
REAL     r_s12
REAL     r_s22
REAL     r_div_tol
REAL     r_e11
REAL     r_e22
REAL     r_v12
#---------------------------------------------------------------------
#  Assigning values for stiffness matrix elements.
r_s11          =2.00437e11
r_s12          =1.32288e9
r_s22          =4.00873e9
r_div_tol      =1e-14
#
#  Calculating the corresponding engineering constants.
mat_2d_ani_to_2d_ort                          @
   (  r_s11,                                  @
      r_s12,                                  @
      r_s22,                                  @
      r_div_tol,                              @
      r_e11,                                  @
      r_e22,                                  @
      r_v12 )
dump r_e11,r_e22,r_v12
#---------------------------------------------------------------------
 
mat_3d_ani_to_3d_ort
()
#  Purpose          :  This file provides an example of a call to the
#                      function mat_3d_ani_to_3d_ort()
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function mat_3d_ani_to_3d_ort()
#  has the following arguments:
#
#  mat_3d_ani_to_3d_ort
#     (  s11,
#        s12,
#        s13,
#        s22,
#        s23,
#        s33,
#        div_tol,
#        e11,
#        e22,
#        e33,
#        v12,
#        v23,
#        v31 )
#
#---------------------------------------------------------------------
#  Variable Declarations
REAL     r_s11
REAL     r_s12
REAL     r_s13
REAL     r_s22
REAL     r_s23
REAL     r_s33
REAL     r_div_tol
REAL     r_e11
REAL     r_e22
REAL     r_e33
REAL     r_v12
REAL     r_v23
REAL     r_v31
#---------------------------------------------------------------------
#  Assigning the values to the elements of stiffness matrix.
r_s11      = 1.99e11
r_s12      = -2.34e8
r_s13      = -3.43e9
r_s22      = -2.75e7
r_s23      = -9.17e9
r_s33      = -2.77e10
r_div_tol  = 1e-14
#
#  Converting stiffness matrix values into engineering constants.
mat_3d_ani_to_3d_ort                          @
   (  r_s11,                                  @
      r_s12,                                  @
      r_s13,                                  @
      r_s22,                                  @
      r_s23,                                  @
      r_s33,                                  @
      r_div_tol,                              @
      r_e11,                                  @
      r_e22,                                  @
      r_e33,                                  @
      r_v12,                                  @
      r_v23,                                  @
      r_v31 )
 
dump r_e11,r_e22,r_e33,r_v12,r_v23,r_v31
#---------------------------------------------------------------------
mat_hal_load_defn_show
()
#  Purpose          :  This file provides an example of a call to the
#                      function mat_hal_load_defn_show()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      create four materials of type isotropic, 
#                      3d orthotropic, cont. fiber and disc. ribbon 
#                      composite. The construction data for the two 
#                      composite materials will be listed
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function mat_hal_load_defn_show()
#  has the following arguments:
#
#  mat_hal_load_defn_show
#     (  mat_name,
#        iopt,
#        fiber_name,
#        matrix_name,
#        fvf,
#        mvf,
#        aratio1,
#        aratio2,
#        theory,
#        override,
#        fudge_factor1,
#        fudge_factor2,
#        fudge_factor3,
#        fudge_factor4,
#        fudge_factor5,
#        fudge_factor6 )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_mat_name[32]
INTEGER  i_iopt
STRING   s_fiber_name[32]
STRING   s_matrix_name[32]
REAL     r_fvf
REAL     r_mvf
STRING   s_aratio1[32]
STRING   s_aratio2[32]
INTEGER  i_theory
LOGICAL  l_override
STRING   s_fudge_factor1[32]
STRING   s_fudge_factor2[32]
STRING   s_fudge_factor3[32]
STRING   s_fudge_factor4[32]
STRING   s_fudge_factor5[32]
STRING   s_fudge_factor6[32]
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Creating isotropic material by name ‘matrix’.
i_return_value =                                                     @
   material.create(“Analysis code ID”,1,”Analysis type ID”,1,        @
      “matrix”,0, “New Material “, “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”], [2, 5, 0], @
      “Property Values”, [“2e5”, “.3”, ““] )
dump i_return_value
 
#  Creating 3d orthotropic material by name ‘fiber’.
i_return_value =                                                     @
   material.create(“Analysis code ID”,1,”Analysis type ID”,1,”fiber”,@
      0,”New Material”, “3d Orthotropic”, 2, “Directionality”,2,     @
      “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”,”Elastic Modulus 22”,       @
      “Elastic Modulus 33”,”Poisson Ratio”,”Poisson Ratio 23”,       @
      “Poisson Ratio 31”, “Shear Modulus”,”Shear Modulus 23”,        @
      “Shear Modulus 31”], [2, 3, 4, 5, 6, 7, 8, 9, 10, 0],          @
      “Property Values”, [“2e5”,”2e5”,”2e5”, “.33”, “.3”, “.37”,     @
      “2e6”, “2e7”, “4e6”, ““] )
dump i_return_value
 
#  Creating continuous fiber composite material by name ‘cfc’.
i_return_value =                                                     @
   mat_hal_create( “cfc”, ““, 1, 0.2, 0.80000001, 1, [““, ““], TRUE, @
      [“1”, “2”, “3”, “4”, “5”, ““, ““], “fiber”, “matrix”, “Create” )
dump i_return_value
 
#  Creating discontinuous ribbon composite material by name ‘drc’.
i_return_value =                                                     @
   mat_hal_create(“drc”,””,4, 0.59899998, 0.40099999, 0,[“100”,”10”],@
      FALSE,[““,””,””,””,””,””,””], “fiber”, “matrix”, “Create” )
dump i_return_value
#---------------------------------------------------------------------
#  Retrieving data for continuous fiber composite named ‘cfc’.
s_mat_name     = “cfc”
#  The option flag for the continuous fiber composite is 1
i_iopt         = 1
#
i_return_value =                                 @
   mat_hal_load_defn_show                        @
      (  s_mat_name,                             @
         i_iopt,                                 @
         s_fiber_name,                           @
         s_matrix_name,                          @
         r_fvf,                                  @
         r_mvf,                                  @
         s_aratio1,                              @
         s_aratio2,                              @
         i_theory,                               @
         l_override,                             @
         s_fudge_factor1,                        @
         s_fudge_factor2,                        @
         s_fudge_factor3,                        @
         s_fudge_factor4,                        @
         s_fudge_factor5,                        @
         s_fudge_factor6 )
dump i_return_value
#  The material defination data into the string format is
dump i_iopt,s_fiber_name,s_matrix_name,r_fvf,r_mvf
dump s_aratio1,s_aratio2,i_theory,l_override
dump s_fudge_factor1,s_fudge_factor2,s_fudge_factor3
dump s_fudge_factor4,s_fudge_factor5,s_fudge_factor6
#---------------------------------------------------------------------
#  Retrieving data for discontinuous ribbon composite named ‘drc’.
s_mat_name=”drc”
#  The option flag for the discontinuous ribbon composite is 4
i_iopt         = 4
#
i_return_value =                                 @
   mat_hal_load_defn_show                        @
      (  s_mat_name,                             @
         i_iopt,                                 @
         s_fiber_name,                           @
         s_matrix_name,                          @
         r_fvf,                                  @
         r_mvf,                                  @
         s_aratio1,                              @
         s_aratio2,                              @
         i_theory,                               @
         l_override,                             @
         s_fudge_factor1,                        @
         s_fudge_factor2,                        @
         s_fudge_factor3,                        @
         s_fudge_factor4,                        @
         s_fudge_factor5,                        @
         s_fudge_factor6 )
dump i_return_value
#  The material defination data into the string format is
dump i_iopt,s_fiber_name,s_matrix_name,r_fvf,r_mvf
dump s_aratio1,s_aratio2,i_theory,l_override
dump s_fudge_factor1,s_fudge_factor2,s_fudge_factor3
dump s_fudge_factor4,s_fudge_factor5,s_fudge_factor6
#---------------------------------------------------------------------
mat_lam_load_defn_show
()
#  Purpose          :  This file provides an example of two calls to 
#                      the function mat_lam_load_defn_show()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      add two definations of 2d orthotropic material
#                      and two definations of composite laminate.
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function mat_lam_load_defn_show()
#  has the following arguments:
#
#  mat_lam_load_defn_show
#     (  mat_name,
#        num_plies,
#        ply_names,
#        thicks,
#        orients,
#        num_def,
#        iconv,
#        offset_string )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_mat_name[32]
INTEGER  i_num_plies
INTEGER  iv_ply_names(VIRTUAL)
REAL     rv_thicks(VIRTUAL)
REAL     rv_orients(VIRTUAL)
INTEGER  i_num_def
INTEGER  i_iconv
STRING   s_offset_string[32]
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Creating 2d orthotropic materials for laminate plies. The material
#  names are “2dort1” and “2dort2”.
 
i_return_value =                                                     @
   material.create( “Analysis code ID”, 1, “Analysis type ID”, 1,    @
      “2dort1”, 0, “New Material”,                                   @
      “2d Orthotropic”, 5, “Directionality”, 4, “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”,@
      “Elastic Modulus 22”, “Poisson Ratio”, “Shear Modulus”,        @
      “Shear Modulus 23”, “Shear Modulus 31”], [2, 3, 5, 8, 9, 10,0],@
      “Property Values”, [“2e6”, “2e6”, “.33”, “2e7”, “3e7”,”4e6”,””])
dump i_return_value
 
i_return_value =                                                     @
   material.create( “Analysis code ID”, 1, “Analysis type ID”, 1,    @
      “2dort2”, 0, “New Material”,                                   @
      “2d Orthotropic”, 5, “Directionality”, 4, “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”,@
      “Elastic Modulus 22”, “Poisson Ratio”, “Shear Modulus”,        @
      “Shear Modulus 23”, “Shear Modulus 31”], [2, 3, 5, 8, 9, 10,0],@
      “Property Values”,[“2e6”,”2e5”,”.4”,”2e8”,”2.7e7”,”3.7e6”,””] )
dump i_return_value
 
#  Creating laminate composite lam1, with ‘Total’ as 
#  stacking sequence.
i_return_value =                                                     @
   mat_create_lam( “lam1”, ““, 1, [“2dort1”, “2dort2”, “2dort1”,     @
      “2dort2”, “2dort1”], [0.1, 0.12, 0.1, 0.12, 0.1],              @
      [0., 30., 60., 90., 120.], 5, “10”, “Create” )
dump i_return_value
 
#  Creating laminate composite lam2, with ‘Symmetry/Mid ply’ as 
#  stacking sequence.
i_return_value =                                                     @
   mat_create_lam( “lam2”, ““, 3, [“2dort2”, “2dort1”, “2dort2”],    @
     [0.079999998, 0.15000001, 0.079999998], [30., 60., 90.], 3,”25”,@
     “Create” )
dump i_return_value
#---------------------------------------------------------------------
#  Loading the laminate defination data for ‘lam1’
s_mat_name     = “lam1”
#  Number of plies are 5
i_num_plies    = 5
#
i_return_value =                                 @
   mat_lam_load_defn_show                        @
      (  s_mat_name,                             @
         i_num_plies,                            @
         iv_ply_names,                           @
         rv_thicks,                              @
         rv_orients,                             @
         i_num_def,                              @
         i_iconv,                                @
         s_offset_string )
dump i_return_value
#  The laminate defination data is
dump iv_ply_names,rv_thicks,rv_orients,i_num_def,i_iconv
dump s_offset_string 
#---------------------------------------------------------------------
#  Loading the laminate defination data for ‘lam2’
s_mat_name     = “lam2”
#  Number of plies are 5
i_num_plies    = 5
#
i_return_value =                                 @
   mat_lam_load_defn_show                        @
      (  s_mat_name,                             @
         i_num_plies,                            @
         iv_ply_names,                           @
         rv_thicks,                              @
         rv_orients,                             @
         i_num_def,                              @
         i_iconv,                                @
         s_offset_string )
dump i_return_value
#  The laminate defination data is
dump iv_ply_names,rv_thicks,rv_orients,i_num_def,i_iconv
dump s_offset_string
#---------------------------------------------------------------------
sys_free_array(iv_ply_names)
sys_free_array(rv_thicks)
sys_free_array(rv_orients)
#---------------------------------------------------------------------
mat_load_show
()
#  Purpose          :  This file provides an example of two calls to 
#                      the function mat_load_show()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      create four materials of type isotropic, 
#                      3d orthotropic, disc. ribbon composite and 
#                      short fiber composite. The construction data 
#                      for the short fiber and disc. ribbon composite
#                      materials will be listed
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function mat_load_show()
#  has the following arguments:
#
#  mat_load_show
#     (  mat_name,
#        itype,
#        iopt,
#        desc,
#        rvals,
#        num_phases )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_mat_name[32]
INTEGER  i_itype
INTEGER  i_iopt
STRING   s_desc[32]
REAL     ra_rvals(32)
INTEGER  i_num_phases
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Creating isotropic material by name ‘matrix’.
i_return_value =                                                     @
   material.create(“Analysis code ID”,1,”Analysis type ID”,1,        @
      “matrix”,0, “New Material” , “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”], [2, 5, 0], @
      “Property Values”, [“2e5”, “.3”, ““] )
dump i_return_value
 
#  Creating 3d orthotropic material by name ‘fiber’.
i_return_value =                                                     @
   material.create(“Analysis code ID”,1,”Analysis type ID”,1,”fiber”,@
      0,”New Material”, “3d Orthotropic”, 2,                         @
      “Directionality”,2,”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”,”Elastic Modulus 22”,       @
      “Elastic Modulus 33”, “Poisson Ratio”,”Poisson Ratio 23”,      @
      “Poisson Ratio 31”, “Shear Modulus”,”Shear Modulus 23”,        @
      “Shear Modulus 31”], [2, 3, 4, 5, 6, 7, 8, 9, 10, 0],          @
      “Property Values”, [“2e5”,”2e5”,”2e5”, “.33”, “.3”, “.37”,     @
      “2e6”, “2e7”, “4e6”, ““] )
dump i_return_value
 
#  Creating discontinuous ribbon composite material by name ‘drc’.
i_return_value =                                                     @
   mat_hal_create(“drc”,””,4, 0.59899998, 0.40099999, 0,[“100”,”10”],@
      FALSE,[““,””,””,””,””,””,””], “fiber”, “matrix”, “Create” )
dump i_return_value
 
#  Creating one dimensional short fiber composite material.
i_return_value =                                                     @
   mat_sfc_create( “sfc1d”, ““, 1, 0., 0., 10., 0., 0., 1000, “drc”, @
      “Create” )
dump i_return_value
#---------------------------------------------------------------------
#  Retrieving data for discontinuous ribbon composite material is
s_mat_name     = “drc”
#  The composite material type for Halpine-Tsai material is 3
i_itype        = 3
#  The composite option number for the material is 4
i_iopt         = 4
#
i_return_value =                                 @
   mat_load_show                                 @
      (  s_mat_name,                             @
         i_itype,                                @
         i_iopt,                                 @
         s_desc,                                 @
         ra_rvals,                               @
         i_num_phases )
dump i_return_value
#  The construction data for one dimensional short fiber composite is
dump i_iopt,s_desc,ra_rvals,i_num_phases
#---------------------------------------------------------------------
#  Retrieving data for one dimensional short fiber composite.
s_mat_name     = “sfc1d”
#  The material type for short fiber composite of one dimension is 1
i_itype        = 4
#  The composite option number for the material is 1.
i_iopt         = 1
#
i_return_value =                                 @
   mat_load_show                                 @
      (  s_mat_name,                             @
         i_itype,                                @
         i_iopt,                                 @
         s_desc,                                 @
         ra_rvals,                               @
         i_num_phases )
dump i_return_value
#  The construction data for two dimensional short fiber composite is
dump i_iopt,s_desc,ra_rvals,i_num_phases
#---------------------------------------------------------------------
mat_mix_load_defn_show
()
#  Purpose          :  This file provides an example of a call to the
#                      function mat_mix_load_defn_show()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      add one defination of 3d anisotropic material
#                      and two definations of isotropic material. 
#                      Using the three materials one Rule Of Mixture
#                      material will be defined.
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function mat_mix_load_defn_show()
#  has the following arguments:
#
#  mat_mix_load_defn_show
#     (  mat_name,
#        num_phases,
#        name_string2,
#        name_string3,
#        name_string4,
#        phase_string,
#        v_f_string,
#        orient_string,
#        ncn,
#        ncv,
#        nco )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_mat_name[32]
INTEGER  i_num_phases
STRING   s_name_string2[32]
STRING   s_name_string3[32]
STRING   s_name_string4[32]
STRING   s_phase_string[32]
STRING   s_v_f_string[32]
STRING   s_orient_string[32]
INTEGER  i_ncn
INTEGER  i_ncv
INTEGER  i_nco
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Creating two isotropic materials as ‘iso1’ and ‘iso2’.
 
i_return_value =                                 @
   material.create( “Analysis code ID”, 1, “Analysis type ID”, 1,    @
      “iso1”, 0, “New Material”, “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”],   @
      [2, 5, 0], “Property Values”, [“2e11”, “.35”, ““] )
dump i_return_value
 
i_return_value =                                 @
   material.create( “Analysis code ID”, 1, “Analysis type ID”, 1,    @
      “iso2”, 0, “New Material”, “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”],   @
      [2, 5, 0], “Property Values”, [“2E+11”, “0.34999999”, ““] )
dump i_return_value
 
#  Defining 3d anisotropic material as ‘3dani’
i_return_value =                                 @
   material.create( “Analysis code ID”, 1, “Analysis type ID”, 1,    @
      “3dani”, 0, “New Material”,                                    @
      “3d Anisotropic”, 3, “Directionality”, 3, “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”, [“Stiffness 11”,       @
      “Stiffness 12”, “Stiffness 13”, “Stiffness 14”, “Stiffness 15”,@
      “Stiffness 16”, “Stiffness 22”, “Stiffness 23”, “Stiffness 24”,@
      “Stiffness 25”, “Stiffness 26”, “Stiffness 33”, “Stiffness 34”,@
      “Stiffness 35”, “Stiffness 36”, “Stiffness 44”, “Stiffness 45”,@
      “Stiffness 46”, “Stiffness 55”,”Stiffness 56”, “Stiffness 66”],@
      [54, 55, 56, 66, 67, 68, 57, 58, 69, 70, 71, 59, 72, 73, 74,60,@
      61, 62, 63, 64, 65, 0], “Property Values”,[“2e9”, “2e7”, “3e6”,@
      “4e5”, “5e5”, “4e3”, “5e8”, “4e5”, “3e6”, “2e5”, “3e3”, “4e6”, @
      “3e3”, “5e4”, “4e4”, “6e7”, “4e5”, “5e4”,”5e5”,”5e3”,”6e6”,””])
dump i_return_value
 
#  Creating rule of mixture material by using ‘iso1’, ‘iso2’ and 
#  ‘3dani’ as constituent phases.
i_return_value =                                 @
   mat_create_mix( “rom”, ““, “iso1 iso2 3dani”, “.5 .25 .25”, “0 0 @
      0 45 45 45 30 45 30”, “Create” )
dump i_return_value
#---------------------------------------------------------------------
#  Calling function to load the material defination data for Rule of
#  Mixture material ‘rom’.
s_mat_name= “rom”
i_num_phases=3
#
i_return_value =                                 @
   mat_mix_load_defn_show                        @
      (  s_mat_name,                             @
         i_num_phases,                           @
         s_name_string2,                         @
         s_name_string3,                         @
         s_name_string4,                         @
         s_phase_string,                         @
         s_v_f_string,                           @
         s_orient_string,                        @
         i_ncn,                                  @
         i_ncv,                                  @
         i_nco )
dump i_return_value
#  Material defination data for the material is
dump s_name_string2,s_name_string3,s_name_string4,s_phase_string
dump s_v_f_string,s_orient_string,i_ncn,i_ncv,i_nco
#---------------------------------------------------------------------
mat_sfc_load_defn_show
()
#  Purpose          :  This file provides an example of a call to the
#                      function mat_sfc_load_defn_show()
#
#                      This session file will open a new database
#                      by name ‘new.db’ with default options and will
#                      create five materials of type isotropic, 
#                      3d orthotropic, disc. ribbon composite and 
#                      short fiber composites of both types. The 
#                      construction data for the two short fiber 
#                      composite materials will be listed
#
#                      For material property ids refer User’s Manual
#                      Part 9, Section 7.5 to 7.7
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the “File”,”Session”,”Play” pulldown 
#                      menus on the menu bar.
#
#  The function mat_sfc_load_defn_show()
#  has the following arguments:
#
#  mat_sfc_load_defn_show
#     (  mat_name,
#        iopt,
#        uni_mat_name,
#        fmo,
#        smo,
#        fsd,
#        ssd,
#        cor,
#        niter )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_mat_name[32]
INTEGER  i_iopt
STRING   s_uni_mat_name[32]
REAL     r_fmo
REAL     r_smo
REAL     r_fsd
REAL     r_ssd
REAL     r_cor
INTEGER  i_niter
INTEGER  i_return_value
#---------------------------------------------------------------------
#  Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
#---------------------------------------------------------------------
#  Creating isotropic material by name ‘matrix’.
i_return_value =                                                     @
   material.create(“Analysis code ID”,1,”Analysis type ID”,1,        @
      “matrix”,0, “New Material”, “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”], [2, 5, 0], @
      “Property Values”, [“2e5”, “.3”, ““] )
dump i_return_value
 
#  Creating 3d orthotropic material by name ‘fiber’.
i_return_value =                                                     @
   material.create(“Analysis code ID”,1,”Analysis type ID”,1,”fiber”,@
      0,”New Material”, “3d Orthotropic”, 2,                         @
      “Directionality”,2,”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”,”Elastic Modulus 22”,       @
      “Elastic Modulus 33”, “Poisson Ratio”,”Poisson Ratio 23”,      @
      “Poisson Ratio 31”, “Shear Modulus”,”Shear Modulus 23”,        @
      “Shear Modulus 31”], [2, 3, 4, 5, 6, 7, 8, 9, 10, 0],          @
      “Property Values”, [“2e5”,”2e5”,”2e5”, “.33”, “.3”, “.37”,     @
      “2e6”, “2e7”, “4e6”, ““] )
dump i_return_value
 
#  Creating discontinuous ribbon composite material by name ‘drc’.
i_return_value =                                                     @
   mat_hal_create(“drc”,””,4, 0.59899998, 0.40099999, 0,[“100”,”10”],@
      FALSE, [““,””,””,””,””,””,””], “fiber”, “matrix”, “Create” )
dump i_return_value
 
#  Creating one dimensional short fiber composite material.
i_return_value =                                                     @
   mat_sfc_create( “sfc1d”, ““, 1, 0., 0., 10., 0., 0., 1000, “drc”, @
      “Create” )
dump i_return_value
 
#  Creating two dimensional short fiber composite material.
i_return_value =                                                     @
   mat_sfc_create( “sfc2d”, ““, 2, 0., 45., 7., 16., 0.2, 1000, “drc”@
      , “Create” )
dump i_return_value
#---------------------------------------------------------------------
#  Retrieving data for one dimensional short fiber composite.
s_mat_name     = “sfc1d”
#  Material option is 1 for one dimensional short fiber composite.
i_iopt         = 1
#
i_return_value =                                 @
   mat_sfc_load_defn_show                        @
      (  s_mat_name,                             @
         i_iopt,                                 @
         s_uni_mat_name,                         @
         r_fmo,                                  @
         r_smo,                                  @
         r_fsd,                                  @
         r_ssd,                                  @
         r_cor,                                  @
         i_niter )
dump i_return_value
#  The construction data for one dimensional short fiber composite is
dump s_uni_mat_name,r_fmo,r_smo,r_fsd,r_ssd,r_cor,i_niter
#---------------------------------------------------------------------
#  Retrieving data for two dimensional short fiber composite.
s_mat_name     = “sfc2d”
#  Material option is 2 for two dimensional short fiber composite.
i_iopt         = 2
#
i_return_value =                                 @
   mat_sfc_load_defn_show                        @
      (  s_mat_name,                             @
         i_iopt,                                 @
         s_uni_mat_name,                         @
         r_fmo,                                  @
         r_smo,                                  @
         r_fsd,                                  @
         r_ssd,                                  @
         r_cor,                                  @
         i_niter )
dump i_return_value
#  The construction data for two dimensional short fiber composite is
dump s_uni_mat_name,r_fmo,r_smo,r_fsd,r_ssd,r_cor,i_niter
#---------------------------------------------------------------------
 
material.namedelete
()
#  Purpose          :  This file provides an example of a call to the
#                      function material.namedelete()
#
#                      This function deletes the material from
#                      a database. It requires the number of materials 
#                      and the names of the material entered by the 
#                      material.create() function.  The function returns a
#                      status 0 after successful completion 
#                      and the error code in case of failure. 
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file 
#                      through the "File","Session","Play" pulldown 
#                      menus on the menu bar.
#
#  The function material.namedelete()
#  has the following arguments:
#
#   material.namedelete
#     (  material_name,
#        descrip,
#        num_materials  )
#
#---------------------------------------------------------------------
#  Variable Declarations
 
     INTEGER num_materials = 2
     STRING descrip[32] = ""
     STRING material_name[32](VIRTUAL)
     INTEGER status
     STRING message[32]    
#----------------------------------------------------------------------
#  Open a new database
     if(!db_is_open())THEN
     uil_file_new.go("","new.db")
$? YES 36000002
     endif
#----------------------------------------------------------------------
#  Setting the preference to MSC.Nastran.
 
       uil_pref_analysis.set_analysis_pref( "MSC.Nastran",    @
                                   "Structural",              @
                                   "",                        @
                                   ".op2" )
#---------------------------------------------------------------------
#  Creating 1st  material database for the material "Steel_1"
 
              status = material.create(                       @
                            "Analysis code ID",               @
                            1,                                @
                            "Analysis type ID",               @
                            1,                                @
                            "Steel_1",                        @
                            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"],                 @
                            [2, 5, 0],                        @
                            "Property Values",                @
                            ["29E6", "0.3", ""])
 
dump status
 
#---------------------------------------------------------------------
#  Creating a 2nd material database for the material "Steel_2"
 
              status = material.create(                       @
                            "Analysis code ID",               @
                            1,                                @
                            "Analysis type ID",               @
                            1,                                @
                            "Steel_2",                        @
                            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"],                 @
                            [2, 5, 0],                        @
                            "Property Values",                @
                            ["29E6", "0.3", ""])
 
dump status
#---------------------------------------------------------------------
#  Assigning the array size to material_name
 
      sys_allocate_array(material_name,1,num_materials)
 
#---------------------------------------------------------------------
#  Defining the names for the materials
 
material_name(1)  =  "Steel_1"
material_name(2)  =  "Steel_2"
 
      status = material.namedelete(                            @
                            material_name,                     @
                            descrip,                           @
                            num_materials        )
 
dump status
#---------------------------------------------------------------------
#  Getting the status output for the function execution
 
      msg_get_string(status,message)
 
 
      dump message
#---------------------------------------------------------------------
#  Closing the file
 
#     uil_file_close.goquit()
 
#---------------------------------------------------------------------
#  End of file
n21_cons_to_sym_6x6_matrix
()
#  Purpose          :  This file provides an example of a call to the
#                      function n21_cons_to_sym_6x6_matrix()
#
#                      This file can be run by starting a session of
#                      MSC Patran, and running this session file
#                      through the “File”,”Session”,”Play” pulldown
#                      menus on the menu bar.
#
#  The function n21_cons_to_sym_6x6_matrix()
#  has the following arguments:
#
#  n21_cons_to_sym_6x6_matrix
#     (  cm,
#        cb,
#        status )
#
#---------------------------------------------------------------------
#  Variable Declarations
REAL     ra_cb(21)
REAL     ra_cm(6,6)
REAL     ra_e(9)
INTEGER  i_status
#---------------------------------------------------------------------
#  Assigning material properties for a 3d orthotropic material.
ra_e(1)=2e5
ra_e(2)=4e5
ra_e(3)=3e4
ra_e(4)=.3
ra_e(5)=.33
ra_e(6)=.36
ra_e(7)=2e11
ra_e(8)=3e12
ra_e(9)=4e9
#
#  Converting the engineering constants into 21 stress-strain 
#  coefficients.
engin_cons_to_elastic_matrix                  @
   (  ra_e,                                   @
      ra_cb,                                   @
      i_status )
dump i_status
dump ra_cb
#---------------------------------------------------------------------
#  Calling function to convert 21 engineering constants to 6x6 matrix.
#
n21_cons_to_sym_6x6_matrix                    @
   (  ra_cm,                                  @
      ra_cb )
dump ra_cm
 
#---------------------------------------------------------------------
 
p3cm.close_2
()
#  Purpose          :  This file provides an example of a call to the
#                      function p3cm.close_2() 
#
#                      This session file closes the Layup file. 
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#  The function p3cm.close_2() 
#  has the following arguments:
#
#  p3cm.close_2 (detail)
#
#---------------------------------------------------------------------
# Variable Decleration
 
INTEGER detail
INTEGER i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Argument Initialization.
 
detail = 0
 
#---------------------------------------------------------------------
# Close the Layup file. 
 
i_return_value = p3cm.close_2( detail )
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.create_book_layup2
()
#  Purpose          :  This file provides an example of a call to the
#                      function p3cm.create_book_layup2() 
#
#                      This session file creates a book report for 
#                      layups in the database.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function p3cm.create_book_layup2() 
#  has the following arguments:
#
#  P3CM.create_book_layup2(  num_plies_in,                           @
#                            index_in,                               @
#                            report_it,                              @
#                            state,                                  @
#                            rep_togs,                               @
#                            display_it,                             @
#                            material,                               @
#                            view_arrow,                             @
#                            init_vector,                            @
#                            disp_area,                              @
#                            max_strn,                               @
#                            angles,                                 @
#                            pattern,                                @
#                            cutout,                                 @
#                            offval,                                 @
#                            pat_igs,                                @
#                            pat_dxf,                                @
#                            cut_igs,                                @
#                            cut_dxf,                                @
#                            curve_str,                              @
#                            layer_str,                              @
#                            hardcopy_it,                            @
#                            options)
#
#---------------------------------------------------------------------
# Variable Decleration
 
INTEGER num_plies_in
INTEGER index_in(1)
LOGICAL report_it
STRING  state[80]
LOGICAL rep_togs(6)
LOGICAL display_it
LOGICAL material
LOGICAL view_arrow
LOGICAL init_vector
LOGICAL max_strn
LOGICAL disp_area
LOGICAL cutout
LOGICAL pattern
LOGICAL surface
LOGICAL angles
REAL    offval
LOGICAL pat_igs,pat_dxf,cut_igs,cut_dxf
STRING  curve_str[80],layer_str[80]
LOGICAL hardcopy_it
STRING  options[1024]
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Add the created ply in the database. 
 
p3cm.create_ply_add_2( "Paint", "Mat_1", "Ply_1",                    @
                       [-0.58138198, 7.9241023, -1.5620499],         @
                       [0.75, -0.5, -0.433], [0., 0., 0.],           @
                       0., -1., -1., -1., 0, "", "", 1, 0,           @
                       [0., 0., 0., 0.], 1,                          @
                       ["Surface 5"], "" )
 
$? YES 59200001 
 
#---------------------------------------------------------------------
# Add the created layup in the database. 
 
p3cm.create_layup_add_2( "spool",                                    @
              "LM_Layup created from : ./spool by LAMINATE MODELER", @ 
              1, ["Ply_1", ""], ["Paint", ""], [1, 0],               @
              ["Top", ""], [0., 0.], 0, [0.], [""], [0.], [0.],      @
              [""], 1, [5., 0.], [5., 0.] , ["", ""], FALSE,         @
              "Stan. Lam. Plate (CQUAD4/PCOMP)",                     @
              FALSE, FALSE )
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
num_plies_in     =   1
index_in(1)      =   1
report_it        =   TRUE
state            =   "Expand"
rep_togs         =   [TRUE, TRUE, TRUE, TRUE, TRUE, TRUE]
display_it       =   TRUE
material         =   FALSE
view_arrow       =   TRUE
init_vector      =   TRUE
disp_area        =   TRUE
max_strn         =   TRUE
angles           =   FALSE
pattern          =   TRUE
cutout           =   TRUE
offval           =   0.
pat_igs          =   FALSE
pat_dxf          =   FALSE
cut_igs          =   TRUE
cut_dxf          =   TRUE
curve_str        =   "SPLINE"
layer_str        =   "POLYLINE"
hardcopy_it      =   TRUE
 
options          =   "printer=Postscript Default," //                @ 
                     "driver=Postscript, destination=Unknown," //    @
                     "window=Current Viewport, save=YES," //         @ 
                     "output_file=, paper=Letter, left_margin=0.5"// @
                     " in, right_margin=0.5 in, top_margin=0.5 in,"//@
                     "bottom_margin=0.5 in, default_units=Inches,"// @
                     "orientation=Landscape, copies=1," //           @
                     "format=Black to White, background=White, " //  @
                     "lines_&_text=Black, line_weight=0.5 pts,"//    @
                     "text_scale=100%, image_size=Fit on Page,"//    @
                     "scale_factor=1.0, center=Yes," //              @ 
                     "draw_borders=Yes, quality=Normal, "//          @
                     "color_model=RGB, gcr=75 %" 
 
#---------------------------------------------------------------------
# Create a book report for layups in the database. 
 
P3CM.create_book_layup2( num_plies_in,                               @
                         index_in,                                   @
                         report_it,                                  @
                         state,                                      @
                         rep_togs,                                   @
                         display_it,                                 @
                         material,                                   @
                         view_arrow,                                 @
                         init_vector,                                @
                         disp_area,                                  @
                         max_strn,                                   @
                         angles,                                     @
                         pattern,                                    @
                         cutout,                                     @
                         offval,                                     @
                         pat_igs,                                    @
                         pat_dxf,                                    @
                         cut_igs,                                    @
                         cut_dxf,                                    @
                         curve_str,                                  @
                         layer_str,                                  @
                         hardcopy_it,                                @
                         options)
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
P3cm.create_laminates_layup_2
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.create_laminates_layup_2() 
#
#                      This session file creates a laminate in the database.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#  The function P3CM.create_laminates_layup_2() 
#  has the following arguments:
#
#  P3CM.create_laminates_layup_2( areaspec,          @
#                                 an_code_name,      @
#                                 an_type_name,      @
#                                 orientation,       @
#                                 prim_entity,       @
#                                 switch_angle_in,   @
#                                 sec_entity,        @
#                                 num_tols,          @
#                                 ang_tols,          @
#                                 thick_tols,        @
#                                 tol_areas,         @
#                                 element_type,      @
#                                 prefix,            @
#                                 first_laminate_id, @
#                                 first_property_id, @
#                                 preview )                            
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING    areaspec[80]
STRING    an_code_name[80]
STRING    an_type_name[80]
STRING    orientation[80]
STRING    prim_entity[80]
REAL      switch_angle_in
STRING    sec_entity[80]
INTEGER   num_tols
REAL      ang_tols(2)
REAL      thick_tols(2)
STRING    tol_areas[80](2)
STRING    element_type[512]
STRING    prefix[80]
INTEGER   first_laminate_id
INTEGER   first_property_id
LOGICAL   preview
 
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Add the created ply in the database. 
 
p3cm.create_ply_add_2( "Paint", "Mat_1", "Ply_1",                    @
                       [-0.99995601, 8., 4.], [0.75, -0.5, -0.433],  @
                       [0., 0., 0.], 0., -1., -1., -1., 0, "", "",   @
                       1, 0, [0., 0., 0., 0.], 1,                    @
                       ["Surface 4"], "" )
 
$? YES 59200001 
 
#---------------------------------------------------------------------
# Add the created layup in the database. 
 
p3cm.create_layup_add_2( "spool",                                    @
                   "LM_Layup created from : /user2/manishj/" //      @
                   "laminate/temp/spool by LAMINATE MODELER", 1,     @
                   ["Ply_1", ""], ["Paint", ""], [1, 0], ["Top", ""],@
                   [0., 0.], 0, [0.], [""], [0.], [0.],              @
                   [""], 1, [5., 0.], [5., 0.], ["", ""],            @
                   TRUE, "Stan. Lam. Plate (CQUAD4/PCOMP)",          @
                   FALSE, FALSE )
 
$? YESFORALL 29002020 
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
AREASPEC             =  "ALL"
AN_CODE_NAME         =  "MSC/NASTRAN"
an_type_name         =  "Structural"
orientation          =  "angle"
prim_entity          =  ""
switch_angle_in      =  0.
sec_entity           =  ""
num_tols             =   1
ang_tols             =  [5., 0.]
thick_tols           =  [5., 0.]
tol_areas(1)         =  ""
tol_areas(2)         =  ""
element_type         =  "Rev. Lam. Plate (CQUADR/PCOMP)"
prefix               =  "LM_Layup."
first_laminate_id    =  1
first_property_id    =  1
preview              =  FALSE
                               
#--------------------------------------------------------------------
# Create the laminate  in the database. 
 
i_return_value = P3CM.create_laminates_layup_2( areaspec,           @
                                                an_code_name,       @
                                                an_type_name,       @
                                                orientation,        @
                                                prim_entity,        @
                                                switch_angle_in,    @
                                                sec_entity,         @
                                                num_tols,           @
                                                ang_tols,           @
                                                thick_tols,         @
                                                tol_areas,          @
                                                element_type,       @
                                                prefix,             @
                                                first_laminate_id,  @
                                                first_property_id,  @
                                                preview )
 
$? YESFORALL 29002020 
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.create_layup_add_2
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.create_layup_add_2() 
#
#                      This session file adds the new layup in the database.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.create_layup_add_2() 
#  has the following arguments:
#
#  P3CM.create_layup_add_2( layup_name,        @
#                           layup_description, @
#                           num_plies,         @
#                           ply_names,         @
#                           type_names,        @
#                           instances,         @
#                           sides,             @
#                           offsets,           @
#                           num_offs,          @
#                           off_values,        @
#                           off_flags,         @
#                           off_starts,        @
#                           off_views,         @
#                           off_areas,         @
#                           num_tols,          @
#                           ang_tols,          @
#                           thick_tols,        @
#                           tol_areas,         @
#                           model_flag,        @
#                           element_type,      @
#                           solid_flag,        @
#                           bacon_flag )
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING  LAYUP_NAME[212]
STRING  LAYUP_DESCRIPTION[212]
INTEGER num_plies
STRING  ply_names[80](2)
STRING  type_names[80](2)
INTEGER instances(2)
STRING  sides[80](2)
REAL    offsets(2)
INTEGER num_offs
REAL    off_values(1)
STRING  off_flags[80](1)
REAL    off_starts(1)
REAL    off_views(1)
STRING  off_areas[80](1)
INTEGER num_tols
REAL    ang_tols(2)
REAL    thick_tols(2)
STRING  tol_areas[80](2)
LOGICAL model_flag
STRING  element_type[212]
LOGICAL solid_flag
LOGICAL bacon_flag
 
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------        
# Add the created ply in the database. 
 
p3cm.create_ply_add_2( "Paint", "Mat_1", "Ply_1",                    @
                       [-2.0353413, 8., 3.8636858],                  @
                       [0.75, -0.5, -0.433], [0., 0., 0.],           @
                       0., -1., -1., -1., 0, "", "", 1, 0,           @
                       [0., 0., 0., 0.], 1,                          @
                       ["Surface 4"], "" )
 
$? YES 59200001 
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
LAYUP_NAME          =   "spool"
LAYUP_DESCRIPTION   =   "LM_Layup created from : ./spool by LAMINATE MODELER"
num_plies           =    1
 
ply_names(1)        =    "Ply_1"
ply_names(2)        =    ""
type_names(1)       =    "Paint"
type_names(2)       =    ""
 
instances           =    [1, 0]
 
sides(1)            =    "Top"
sides(2)            =    ""
 
offsets             =    [0., 0.]
num_offs            =    0
off_values          =    0.
off_flags(1)        =    ""
off_starts(1)       =    0.
off_views(1)        =    0.
off_areas(1)        =    ""
num_tols            =    1
ang_tols            =    [5., 0.]
thick_tols          =    [5., 0.] 
 
tol_areas(1)        =    ""
tol_areas(2)        =    ""
 
model_flag          =    FALSE
element_type        =    "Stan. Lam. Plate (CQUAD4/PCOMP)"
solid_flag          =    FALSE
bacon_flag          =    FALSE
 
#---------------------------------------------------------------------
# Add the created layup in the database. 
 
i_return_value = P3CM.create_layup_add_2( layup_name,                @
                                          layup_description,         @
                                          num_plies,                 @
                                          ply_names,                 @
                                          type_names,                @
                                          instances,                 @
                                          sides,                     @
                                          offsets,                   @
                                          num_offs,                  @
                                          off_values,                @
                                          off_flags,                 @
                                          off_starts,                @
                                          off_views,                 @
                                          off_areas,                 @
                                          num_tols,                  @
                                          ang_tols,                  @
                                          thick_tols,                @
                                          tol_areas,                 @
                                          model_flag,                @
                                          element_type,              @
                                          solid_flag,                @
                                          bacon_flag)
                                          
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.create_material_add
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.create_material_add() 
#
#                      This session file adds the new material in the database.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.create_material_add() 
#  has the following arguments:
#
#  P3CM.create_material_add (type_name,                              @
#                            material_name,                          @
#                            analysis_material_name,                 @
#                            thichness,                              @
#                            max_strain,                             @
#                            warp_weft_angle)
#
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING   type_name[80]  
STRING   material_name[80]         
STRING   analysis_material_name[80]
REAL     thichness            
REAL     max_strain           
REAL     warp_weft_angle
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
type_name               =  "Paint" 
material_name           =  "Add_Material"
analysis_material_name  =  "aluminum" 
thichness               =   0.1 
max_strain              =   0. 
warp_weft_angle         =   0. 
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
i_return_value = P3CM.create_material_add (type_name,                @
                                           material_name,            @
                                           analysis_material_name,   @
                                           thichness,                @
                                           max_strain,               @
                                           warp_weft_angle)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.create_ply_add_2
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.create_ply_add_2() 
#
#                      This session file adds the new ply in the database.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.create_ply_add_2() 
#  has the following arguments:
#
#  p3cm.create_ply_add_2(type_name,                                 @
#                        material_name,                             @
#                        ply_name,                                  @
#                        start_pt,                                  @
#                        view_dirn,                                 @
#                        ref_dirn,                                  @
#                        ref_ang,                                   @
#                        warp_weft_angle,                           @
#                        max_strain,                                @
#                        step_length,                               @
#                        axis_type,                                 @
#                        warpaxis_str,                              @
#                        weftaxis_str,                              @
#                        extn_type,                                 @
#                        max_sweeps,                                @
#                        bounds,                                    @
#                        num_areas,                                 @
#                        area_strs,                                 @
#                        split_str)
#
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING  type_name[80]
STRING  material_name[80]
STRING  ply_name[80]
REAL    start_pt(3)
REAL    view_dirn(3)
REAL    ref_dirn(3)
REAL    ref_ang
REAL    warp_weft_angle
REAL    max_strain
REAL    step_length
INTEGER axis_type
STRING  warpaxis_str[80]
STRING  weftaxis_str[80]
INTEGER extn_type
INTEGER max_sweeps
REAL    bounds(4)
INTEGER num_areas
STRING  area_strs[80](1)
STRING  split_str[80]
 
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
type_name          =  "Paint" 
material_name      =  "Mat_1"
ply_name           =  "Ply_1"
start_pt           =  [-2.99985, 8., -3.4641883]
view_dirn          =  [0.75, -0.5, -0.433]
ref_dirn           =  [0., 0., 0.]
ref_ang            =  0.
warp_weft_angle    =  -1.0
max_strain         =  -1.0
step_length        =  -1.0
axis_type          =  0
warpaxis_str       =  ""
weftaxis_str       =  ""
extn_type          =  1
max_sweeps         =  0
bounds             =  [0., 0., 0., 0.]
num_areas          =  1
area_strs(1)       =  "Surface 4"
split_str          =  ""
 
#---------------------------------------------------------------------
# Add the created ply in the database. 
 
i_return_value = p3cm.create_ply_add_2 ( type_name,                  @
                                         material_name,              @
                                         ply_name,                   @
                                         start_pt,                   @
                                         view_dirn,                  @
                                         ref_dirn,                   @
                                         ref_ang,                    @
                                         warp_weft_angle,            @
                                         max_strain,                 @
                                         step_length,                @
                                         axis_type,                  @
                                         warpaxis_str,               @
                                         weftaxis_str,               @
                                         extn_type,                  @
                                         max_sweeps,                 @
                                         bounds,                     @
                                         num_areas,                  @
                                         area_strs,                  @
                                         split_str)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.create_results_failure
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.create_results_failure() 
#
#                      This session file creates the Laminate Modeler 
#                      results by using the Failure Calculation method. 
#                      
#                      Before running this session file, run the session 
#                      file plate_matid.ses and create result file
#                      plate_matid_res.op2 as per the instructions given in it. 
#                      Import this result file plate_matid_res.op2 into 
#                      plate_matid.db and open the plate_matib.Layup file. 
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.create_results_failure() 
#  has the following arguments:
#
#  P3CM.create_results_failure ( res_name,                          @
#                                area,                              @
#                                criterion,                         @
#                                basis,                             @
#                                num_mats,                          @
#                                mat_names,                         @
#                                mat_allows,                        @
#                                name,                              @
#                                ply_sort,                          @
#                                ply_results,                       @
#                                failure_index,                     @
#                                reserve_factor,                    @
#                                margin_safety,                     @
#                                critical_component,                @
#                                critical_ply)
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING  res_name[80](5)
STRING  area[80]
STRING  criterion[80]
STRING  basis[80]
INTEGER num_mats
STRING  mat_names[80](virtual)
REAL    mat_allows(virtual)
STRING  name[80]
LOGICAL ply_sort
LOGICAL ply_results
LOGICAL failure_index
LOGICAL reserve_factor
LOGICAL margin_safety
LOGICAL critical_component
LOGICAL critical_ply
 
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file plate_matid.db
 
uil_file_open.go( "./plate_matid.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a Layup file. 
 
P3CM.open( "./plate_matid.Layup" )
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
res_name(1)           =    "Default"
res_name(2)           =    "Static Subcase"
res_name(3)           =    "Stress Tensor" 
res_name(4)           =    ""
res_name(5)           =    "none"
area                  =    "Elm 7"
criterion             =    "Maximum"
basis                 =    "STRESS"
num_mats              =    8
 
sys_allocate_array(mat_names, 1, num_mats)
 
mat_names(1)          =    "mat.03"
mat_names(2)          =    "mat.04"
mat_names(3)          =    "mat.08"
mat_names(4)          =    "mat.09"
mat_names(5)          =    "mat.13"
mat_names(6)          =    "mat.14"
mat_names(7)          =    "mat.18"
mat_names(8)          =    "mat.19" 
 
sys_allocate_array(mat_allows, 1, num_mats, 1, num_mats )
 
mat_allows            =    [[200.,200.,200.,200.,50.,50.,50.,0.]    @
                            [200.,200.,200.,200.,50.,50.,50.,0.]    @
                            [200.,200.,200.,200.,50.,50.,50.,0.]    @
                            [200.,200.,200.,200.,50.,50.,50.,0.]    @
                            [200.,200.,200.,200.,50.,50.,50.,0.]    @
                            [200.,200.,200.,200.,50.,50.,50.,0.]    @
                            [200.,200.,200.,200.,50.,50.,50.,0.]    @
                            [200.,200.,200.,200.,50.,50.,50.,0.]]
                            
name                  =    ""
ply_sort              =    FALSE
ply_results           =    TRUE
failure_index         =    TRUE 
reserve_factor        =    FALSE
margin_safety         =    TRUE
critical_component    =    TRUE
critical_ply          =    TRUE
 
#---------------------------------------------------------------------
# Create the LM results by using the Failure Calc method. 
 
i_return_value = P3CM.create_results_failure ( res_name,             @
                                               area,                 @
                                               criterion,            @
                                               basis,                @
                                               num_mats,             @
                                               mat_names,            @
                                               mat_allows,           @
                                               name,                 @
                                               ply_sort,             @
                                               ply_results,          @
                                               failure_index,        @
                                               reserve_factor,       @
                                               margin_safety,        @
                                               critical_component,   @
                                               critical_ply)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.create_results_mid_sort
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.create_results_mid_sort() 
#
#                      This session file creates the LM results by 
#                      using the material ids calculation  method. 
#                      
#                      
#                      Before running this session file, run the session 
#                      file plate_matid.ses and create result file
#                      plate_matid_res.op2 as per the instructions given in it. 
#                      Import this result file plate_matid_res.op2 into 
#                      plate_matid.db and open the plate_matib.Layup file. 
#                       
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.create_results_mid_sort() 
#  has the following arguments:
#
#  P3CM.create_results_mid_sort (res_name,                          @
#                                area,                              @ 
#                                num_mats,                          @
#                                mat_names)
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING  res_name[80](5)
STRING  area[80]
INTEGER num_mats
STRING  mat_names[80](virtual)
 
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file plate_matid.db
 
uil_file_open.go( "./plate_matid.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a Layup file. 
 
P3CM.open( "./plate_matid.Layup" )
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
res_name(1)           =    "Default"
res_name(2)           =    "Static Subcase"
res_name(3)           =    "Stress Tensor" 
res_name(4)           =    ""
res_name(5)           =    "none"
area                  =    "Elm 6"
num_mats              =    1
 
sys_allocate_array(mat_names, 1, num_mats)
 
mat_names(1)          =    "mat.07"
 
#---------------------------------------------------------------------
# Create the LM results by using the mid_sort Calc method. 
 
i_return_value = P3CM.create_results_mid_sort ( res_name,            @
                                                area,                @
                                                num_mats,            @
                                                mat_names)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.create_results_sort
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.create_results_sort() 
#
#                      This session file creates the Laminate Modeler 
#                      results by using the LM_Ply Sorting method. 
#                      
#                      
#                      Before running this session file, run the session 
#                      file plate_matid.ses and create result file
#                      plate_matid_res.op2 as per the instructions given in it. 
#                      Import this result file plate_matid_res.op2 into 
#                      plate_matid.db and open the plate_matib.Layup file. 
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#  The function P3CM.create_results_sort() 
#  has the following arguments:
#
#  P3CM.create_results_sort ( res_name )
#
#---------------------------------------------------------------------
# Variable Decleration
 
string  res_name[256](5)
integer i_return_value
 
#---------------------------------------------------------------------
#  Opening the file plate_matid.db
 
uil_file_open.go( "./plate_matid.db" )
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a Layup file.
 
p3cm.open( "./plate_matid.Layup" )
 
#---------------------------------------------------------------------
# Argumant Initialization
 
res_name(1) = "Default"
res_name(2) = "Static Subcase"
res_name(3) = "Stress Tensor" 
res_name(4) = ""
res_name(5) = "none"
 
#---------------------------------------------------------------------
# Create the LM results by using the LM_Ply Sort method. 
 
i_return_value = p3cm.create_results_sort ( res_name)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.delete_laminates
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.delete_laminates () 
#
#                      This session file deletes a laminate from the database.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.delete_laminates () 
#  has the following arguments:
#
#  P3CM.delete_laminates (num_laminates, laminates)
#
#---------------------------------------------------------------------
# Variable Decleration
 
INTEGER  num_laminates
STRING   laminates[80](virtual)
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Add the created ply in the database. 
 
p3cm.create_ply_add_2( "Paint", "Mat_1", "Ply_1",                    @
                       [-0.99995601, 8., 4.],                        @
                       [ 0.75, -0.5, -0.433], [0., 0., 0.],          @
                       0., -1., -1., -1., 0, "", "",                 @
                       1, 0, [0., 0., 0., 0.], 1,                    @
                       ["Surface 4"], "" )
 
$? YES 59200001 
 
#---------------------------------------------------------------------
# Add the created layup in the database. 
 
p3cm.create_layup_add_2( "spool",                                    @
                         "LM_Layup created from : /user2/manishj/"// @
                         "laminate/temp/spool by LAMINATE MODELER",  @
                         1, ["Ply_1", ""], ["Paint", ""],            @
                         [1, 0], ["Top", ""], [0., 0.], 0, [0.],     @
                         [""], [0.], [0.], [""], 1, [5., 0.],        @
                         [ 5., 0.], ["", ""], TRUE,                  @
                         "Stan. Lam. Plate (CQUAD4/PCOMP)",          @
                         FALSE, FALSE )
 
$? YES 59000040
$? YESFORALL 29002020 
                               
#---------------------------------------------------------------------
# Create the laminate  in the database. 
 
p3cm.create_laminates_layup( "ALL", "MSC/NASTRAN",                   @
                             "Structural", "angle", "",              @
                             0., "", 1, [5., 0.], [5., 0.],          @
                             ["", ""],                               @
                             "Rev. Lam. Plate (CQUADR/PCOMP)",       @
                             "LM_Layup.", 1, 1, FALSE )
 
$? YES 59000040
$? YESFORALL 29002020 
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
num_laminates   =  1
sys_allocate_array(laminates, 1, num_laminates)
laminates(1)    =  "spool_1"
 
#--------------------------------------------------
# Delete the laminate from the database. 
 
i_return_value = P3CM.delete_laminates (num_laminates, laminates)
 
$? YES 59000001
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.delete_material_name
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.delete_material_name() 
#
#                      This session file deletes the existing material.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.delete_material_name() 
#  has the following arguments:
#
#  P3CM.delete_material_name (type_name,  @
#                             material_name)
#
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING   type_name[80]
STRING   material_name[80]
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Add_Material",                   @
                              "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
type_name        =  "Paint" 
material_name    =  "Add_Material"
 
#---------------------------------------------------------------------
# Delete the existing material. 
 
i_return_value = P3CM.delete_material_name ( type_name,              @
                                             material_name)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.delete_ply_name
()
 
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.delete_ply_name() 
#
#                      This session file deletes the ply name from the database.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.delete_ply_name() 
#  has the following arguments:
#
#  P3CM.delete_ply_name (type_name, ply_name)
# 
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING   type_name[80]
STRING   ply_name[80]
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Add the created ply in the database. 
 
P3CM.create_ply_add_2 ( "Paint", "Mat_1", "Ply_1",                   @
                        [-2.99985, 8., -3.4641883],                  @
                        [0.75, -0.5, -0.433],                        @
                        [0., 0., 0.],0., -1., -1.,                   @
                        -1., 0, "", "", 1, 0,                        @
                        [0., 0., 0., 0.], 1,                         @
                        ["Surface 4"], "" )
$? YES 59200001 
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
type_name  =  "Paint"
ply_name   =  "Ply_1"
 
#---------------------------------------------------------------------
# Delete the created ply. 
 
i_return_value = P3CM.delete_ply_name (type_name, ply_name)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.delete_propsets
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.delete_propsets () 
#
#                      This session file deletes the properties sets 
#                      from the database.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#  The function P3CM.delete_propsets () 
#  has the following arguments:
#
#  P3CM.delete_propsets (num_propsets, propsets)
#
#---------------------------------------------------------------------
# Variable Decleration
 
INTEGER   num_propsets
STRING    propsets[80](virtual)
INTEGER   i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Add the created ply in the database. 
 
p3cm.create_ply_add_2( "Paint", "Mat_1", "Ply_1",                    @
                       [-0.99995601, 8., 4.],                        @
                       [0.75, -0.5, -0.433],                         @
                       [0., 0., 0.], 0., -1.,                        @
                       -1., -1., 0, "", "", 1, 0,                    @
                       [0., 0., 0., 0.], 1,                          @
                       ["Surface 4"], "" )
 
$? YES 59200001 
 
#---------------------------------------------------------------------
# Add the created layup in the database. 
 
p3cm.create_layup_add_2( "spool",                                    @
                         "LM_Layup created from : /user2/manishj/"// @
                         "laminate/temp/spool by LAMINATE MODELER",  @
                         1, ["Ply_1", ""], ["Paint", ""],            @
                         [1, 0], ["Top", ""], [0., 0.], 0,           @
                         [0.], [""], [0.], [0.], [""],               @
                         1, [5., 0.], [ 5., 0.], ["", ""], TRUE,     @
                         "Stan. Lam. Plate (CQUAD4/PCOMP)",          @
                         FALSE, FALSE )
 
$? YES 59000040
$? YESFORALL 29002020 
                               
#---------------------------------------------------------------------
# Create the laminate  in the database. 
 
p3cm.create_laminates_layup( "ALL", "MSC/NASTRAN",                   @
                             "Structural", "angle",                  @
                             "", 0., "", 1, [5., 0.],                @
                             [5., 0.], ["", ""],                     @
                             "Rev. Lam. Plate (CQUADR/PCOMP)",       @
                             "LM_Layup.", 1, 1, FALSE )
 
$? YES 59000040
$? YESFORALL 29002020 
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
num_propsets   =  1
sys_allocate_array(propsets, 1, num_propsets)
propsets(1)    =  "LM_Layup.1"
 
#---------------------------------------------------------------------
# Delete the properties sets from the database. 
 
i_return_value = P3CM.delete_propsets (num_propsets, propsets)
 
$? YES 59000001
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.import_model_file_2
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.import_model_file_2() 
#
#                      This session file imports the model file which
#                      includes mesh & material status. 
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.import_model_file_2() 
#  has the following arguments:
#
#  P3CM.import_model_file_2 (mesh,                                   @ 
#                            materials,                              @
#                            node_id_offsets,                        @
#                            elem_id_offset,                         @
#                            create_group,                           @
#                            group_name) 
#
#---------------------------------------------------------------------
# Variable Decleration
 
LOGICAL    mesh
LOGICAL    materials
INTEGER    node_id_offsets
INTEGER    elem_id_offset
LOGICAL    create_group
STRING     group_name[80]
INTEGER    i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
mesh               =  TRUE
materials          =  TRUE
node_id_offsets    =  1200
elem_id_offset     =  1152
create_group       =  TRUE
group_name         =  "spool"
 
#---------------------------------------------------------------------
# Set all export options. 
 
i_return_value = P3CM.import_model_file_2 ( mesh,                    @
                                            materials,               @
                                            node_id_offsets,         @
                                            elem_id_offset,          @
                                            create_group,            @
                                            group_name)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.import_plies_file_2
()
#  Purpose          :  This file provides an example of a call to the
#                      function p3cm.import_plies_file_2 () 
#
#                      This session file imports the plies file from the database.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function p3cm.import_plies_file_2 () 
#  has the following arguments:
#
#  p3cm.import_plies_file_2 ( num_files,                             @
#                             files,                                 @
#                             angle_tolerance,                       @
#                             distance_tolerance,                    @
#                             create_layup,                          @
#                             preview,                               @
#                             merge_nodes)
#
#---------------------------------------------------------------------
# Variable Decleration
 
INTEGER num_files 
STRING  files[80](virtual)
REAL    angle_tolerance, distance_tolerance
LOGICAL create_layup,preview,merge_nodes
 
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.5, 0., 0. )
 
#---------------------------------------------------------------------
# Add the created ply in the database. 
 
p3cm.create_ply_add_2( "Paint", "Mat_1", "Ply_1",                    @
                       [-0.99995601, 8., 4.],                        @
                       [0.75, -0.5, -0.433],                         @
                       [0., 0., 0.], 0., -1.,                        @
                       -1., -1., 0, "", "", 1,                       @
                       0, [0., 0., 0., 0.], 1,                       @
                       ["Surface 4"], "" )
 
$? YES 59200001 
 
p3cm.create_ply_add_2( "Paint", "Mat_1", "Ply_2",                    @
                       [-0.99995601, 8., 4.],                        @
                       [0.75, -0.5, -0.433],                         @
                       [1., 0., 0.], 0., -1.,                        @
                       -1., -1., 0, "", "", 1,                       @
                       0, [0., 0., 0., 0.], 1,                       @
                       ["Surface 4"], "" )
 
$? YES 59200001 
 
#---------------------------------------------------------------------
# Save the database. 
 
p3cm.save_as_2("./spool.Layup", 0)
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
num_files           =   1
 
sys_allocate_array(files, 1, num_files)
 
files(1)            =   "./spool.Layup"
angle_tolerance     =   25.
distance_tolerance  =   5.
create_layup        =   TRUE
preview             =   TRUE  
merge_nodes         =   TRUE
 
#---------------------------------------------------------------------
# Import the plies file from the database.
 
i_return_value = p3cm.import_plies_file_2 ( num_files,               @
                                            files,                   @
                                            angle_tolerance,         @
                                            distance_tolerance,      @
                                            create_layup,            @
                                            preview,                 @
                                            merge_nodes)
$? YESFORALL 59200001 
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.modify_material
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.modify_material() 
#
#                      This session file modifies the existing material.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.modify_material() 
#  has the following arguments:
#
#  P3CM.modify_material (type_name,                                  @
#                        Add_material_name,                          @
#                        Modified_material_name,                     @
#                        analysis_material_name,                     @
#                        thickness,                                  @
#                        max_strain,                                 @
#                        warp_weft_angle)
#
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING   type_name[80]
STRING   Add_material_name[80]
STRING   Modified_material_name[80]
STRING   analysis_material_name[80]
REAL     thickness
REAL     max_strain
REAL     warp_weft_angle
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Add_Material",                   @
                          "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
type_name               =  "Paint" 
Add_material_name       =  "Add_Material" 
Modified_material_name  =  "Modified_Material"
analysis_material_name  =  "aluminum" 
thichness               =   0.1 
max_strain              =   0. 
warp_weft_angle         =   0. 
 
#---------------------------------------------------------------------
# Modified the existing material. 
 
i_return_value = P3CM.modify_material ( type_name,                   @
                                        Add_material_name,           @
                                        Modified_material_name,      @
                                        analysis_material_name,      @
                                        thickness,                   @
                                        max_strain,                  @
                                        warp_weft_angle)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.modify_ply
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.modify_ply() 
#
#                      This session file modifies the old ply in the database.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.modify_ply() 
#  has the following arguments:
#
#      P3CM.modify_ply ( type_name,                                    @
#                        material_name,                                @
#                        old_ply_name,                                 @
#                        modified_ply_name,                            @
#                        start_pt,                                     @
#                        view_dirn,                                    @
#                        ref_dirn,                                     @
#                        ref_ang,                                      @
#                        warp_weft_angle,                              @
#                        max_strain,                                   @
#                        step_length,                                  @
#                        axis_type,                                    @
#                        warpaxis_str,                                 @
#                        weftaxis_str,                                 @
#                        extn_type,                                    @
#                        max_sweeps,                                   @
#                        bounds,                                       @
#                        num_areas,                                    @
#                        area_strs,                                    @
#                        split_str)
#
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING  type_name[80]
STRING  material_name[80]
STRING  old_ply_name[80]
STRING  modified_ply_name[80]
REAL    start_pt(3)
REAL    view_dirn(3)
REAL    ref_dirn(3)
REAL    ref_ang
REAL    warp_weft_angle
REAL    max_strain
REAL    step_length
INTEGER axis_type
STRING  warpaxis_str[80]
STRING  weftaxis_str[80]
INTEGER extn_type
INTEGER max_sweeps
REAL    bounds(4)
INTEGER num_areas
STRING  area_strs[80](1)
STRING  split_str[80]
 
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
 
#---------------------------------------------------------------------
# Add the created ply in the database. 
 
P3CM.create_ply_add_2 ( "Paint", "Mat_1", "Ply_1",                   @
                        [-2.99985, 8., -3.4641883],                  @
                        [0.75, -0.5, -0.433],                        @
                        [0., 0., 0.],0., -1., -1., -1., 0,           @
                        "", "", 1, 0, [0., 0., 0., 0.], 1,           @
                        ["Surface 4"], "" )
                      
$? YES  59200001
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
type_name          =  "Paint" 
material_name      =  "Mat_1"
old_ply_name       =  "Ply_1"
modified_ply_name  =  "Ply_1"
start_pt           =  [-2.4004319, 7.9241023, -0.8087222]
view_dirn          =  [0., 1., 0.]
ref_dirn           =  [0., 0., 0.]
ref_ang            =  0.
warp_weft_angle    =  -1.0
max_strain         =  -1.0
step_length        =  -1.0
axis_type          =  0
warpaxis_str       =  ""
weftaxis_str       =  ""
extn_type          =  1
max_sweeps         =  0
bounds             =  [0., 0., 0., 0.]
num_areas          =  1
area_strs(1)       =  "Surface 5"
split_str          =  ""
 
#---------------------------------------------------------------------
# Modify the ply in the database. 
 
i_return_value = P3CM.modify_ply ( type_name,                        @
                                   material_name,                    @
                                   old_ply_name,                     @
                                   modified_ply_name,                @
                                   start_pt,                         @
                                   view_dirn,                        @
                                   ref_dirn,                         @
                                   ref_ang,                          @
                                   warp_weft_angle,                  @
                                   max_strain,                       @
                                   step_length,                      @
                                   axis_type,                        @
                                   warpaxis_str,                     @
                                   weftaxis_str,                     @
                                   extn_type,                        @
                                   max_sweeps,                       @
                                   bounds,                           @
                                   num_areas,                        @
                                   area_strs,                        @
                                   split_str)
 
$? YES  59200001
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.new
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.new() 
#
#                      This session file opens a new Layup file for
#                      begining the LAMINATE MODELER session. 
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.new() 
#  has the following arguments:
#
#  P3CM.new ( value )
#
#---------------------------------------------------------------------
# Variable Decleration
 
String  value[256]
integer i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#--------------------------------------------------------------
# Argument Initialization
 
value = "./spool.Layup"
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
i_return_value = P3CM.new ( value )
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.set_offsets
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.set_offsets() 
#
#                      This session file sets the offsets data for layup. 
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.set_offsets() 
#  has the following arguments:
#
#  P3CM.set_offsets( num_offs,          @
#                    off_values,        @
#                    off_flags,         @
#                    off_starts,        @
#                    off_views,         @
#                    off_areas )
#
#---------------------------------------------------------------------
# Variable Decleration
 
INTEGER  num_offs
REAL     off_values(2)
STRING   off_flags[80](2)
REAL     off_starts(4)
REAL     off_views(4)
STRING   off_areas[80](2)
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------        
# Add the created ply in the database. 
 
p3cm.create_ply_add_2( "Paint", "Mat_1", "Ply_1",                    @
                       [-2.0353413, 8., 3.8636858],                  @
                       [0.75, -0.5, -0.433], [0., 0., 0.],           @
                       0., -1., -1., -1., 0, "", "", 1, 0,           @
                       [0., 0., 0., 0.], 1,                          @
                       ["Surface 4"], "" )
		       
$? YES 59200001
#---------------------------------------------------------------------
# Argument Initialization. 
 
num_offs            =    1
off_values          =    [10., 0.]
off_starts          =    [0.76763952, 8., 1.7678945, 0.]
off_views           =    [0.75, -0.5, -0.433, 0.]
off_flags(1)        =    "1"
off_flags(2)        =    ""
off_areas(1)        =    "Surface 4"
off_areas(2)        =    ""
 
#---------------------------------------------------------------------
# Set the offsets data for layup. 
 
i_return_value = P3CM.set_offsets( num_offs,                         @
                                   off_values,                       @
                                   off_flags,                        @
                                   off_starts,                       @
                                   off_views,                        @
                                   off_areas)
                                          
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.open
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.open() 
#
#                      This session file opens a existing Layup file. 
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.open() 
#  has the following arguments:
#
#  P3CM.open ( value )
#
#---------------------------------------------------------------------
# Variable Decleration
 
string  value[256]
integer i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Close the Layup file. 
 
p3cm.close_2( 0 )
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
value =  "./spool.Layup" 
 
#---------------------------------------------------------------------
# Open the existing Layup file spool.Layup. 
 
i_return_value = p3cm.open( value )
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.save_as_2
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.save_as_2() 
#
#                      This session file saves the existing Layup file
#                      into the given file. 
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.save_as_2() 
#  has the following arguments:
#
#  P3CM.save_as_2 ( value , detail )
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING  value[256] 
INTEGER detail
INTEGER i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Argument Initialization.
 
value  =  "./spool_bak.Layup"
detail = 0
 
#---------------------------------------------------------------------
# Save as the Spool_bak.Layup file. 
 
i_return_value = p3cm.save_as_2(value , detail)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.set_export_options_2
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.set_export_options_2() 
#
#                      This session file sets all export options. 
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.set_export_options_2() 
#  has the following arguments:
#
#  P3CM.set_export_options_2 (draped_pattern_iges,                  @
#                             draped_pattern_dxf,                   @
#                             flat_pattern_iges,                    @
#                             flat_pattern_dxf,                     @
#                             mold_surface_iges,                    @
#                             curve,                                @
#                             layer)
#
#
#---------------------------------------------------------------------
# Variable Decleration
 
LOGICAL    draped_pattern_iges
LOGICAL    draped_pattern_dxf
LOGICAL    flat_pattern_iges
LOGICAL    flat_pattern_dxf
LOGICAL    mold_surface_iges
STRING     curve[80]
STRING     layer[80]
INTEGER    i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
draped_pattern_iges =  TRUE
draped_pattern_dxf  =  TRUE
flat_pattern_iges   =  TRUE
flat_pattern_dxf    =  TRUE
mold_surface_iges   =  TRUE
curve               =  "SPLINE"
layer               =  "POLYLINE"
 
#---------------------------------------------------------------------
# Set all export options. 
 
i_return_value = P3CM.set_export_options_2 ( draped_pattern_iges,   @
                                             draped_pattern_dxf,    @
                                             flat_pattern_iges,     @
                                             flat_pattern_dxf,      @
                                             mold_surface_iges,     @
                                             curve,                 @   
                                             layer)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.set_graphics_options_2
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.set_graphics_options_2() 
#
#                      This session file sets all display options using 
#                      laminate modeler ply graphics options also. 
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.set_graphics_options_2() 
#  has the following arguments:
#
#  P3CM.set_graphics_options_2 (message,         @
#                               ply_graphics,    @
#                               layup_graphics,  @
#                               material,        @                             
#                               app_direction,   @
#                               ref_direction,   @
#                               max_strain,      @
#                               selected_area,   @
#                               flat_pattern,    @
#                               draped_pattern,  @
#                               surface_offset,  @
#                               angles,          @
#                               offset_val,      @
#                               scale)
#
#
#---------------------------------------------------------------------
# Variable Decleration
 
LOGICAL      message
LOGICAL      ply_graphics
LOGICAL      layup_graphics
LOGICAL      material
LOGICAL      app_direction
LOGICAL      ref_direction
LOGICAL      max_strain
LOGICAL      selected_area
LOGICAL      flat_pattern
LOGICAL      draped_pattern
LOGICAL      surface_offset
LOGICAL      angles
REAL         offset_val
REAL         scale
INTEGER      i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
message             =  FALSE
ply_graphics        =  TRUE
layup_graphics      =  TRUE
material            =  FALSE
app_direction       =  TRUE
ref_direction       =  TRUE
max_strain          =  TRUE
selected_area       =  TRUE
flat_pattern        =  TRUE
draped_pattern      =  TRUE
surface_offset      =  TRUE
angles              =  FALSE
offset_val          =  2.0
scale               =  1.8
 
#---------------------------------------------------------------------
# Set all display options using LM ply graphics options also. 
 
i_return_value = P3CM.set_graphics_options_2 ( message,              @
                                               ply_graphics,         @
                                               layup_graphics,       @
                                               material,             @                             
                                               app_direction,        @
                                               ref_direction,        @
                                               max_strain,           @
                                               selected_area,        @
                                               flat_pattern,         @
                                               draped_pattern,       @
                                               surface_offset,       @
                                               angles,               @
                                               offset_val,           @
                                               scale)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.set_tolerance
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.set_tolerance() 
#
#                      This session file sets the tolerance data for Laminate
#                      modeler layup. 
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.set_tolerance() 
#  has the following arguments:
#
#  P3CM.set_tolerance ( num_tols,                                   @
#                       ang_tols,                                   @
#                       thick_tols,                                 @
#                       tol_areas)                             
#
#---------------------------------------------------------------------
# Variable Decleration
 
INTEGER   num_tols
REAL      ang_tols(virtual)
REAL      thick_tols(virtual)
STRING    tol_areas[80](virtual)
 
INTEGER   row
INTEGER   i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Add the created ply in the database. 
 
p3cm.create_ply_add_2( "Paint", "Mat_1", "Ply_1",                    @
                       [-0.99995601, 8., 4.],                        @
                       [0.75, -0.5, -0.433],                         @
                       [0., 0., 0.], 0., -1.,                        @
                       -1., -1., 0, "", "",                          @
                       1, 0, [0., 0., 0., 0.],                       @
                       1, ["Surface 4"], "" )
 
$? YES 59200001 
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
 
num_tols             =   1
row                  =   num_tols +1
 
sys_allocate_array(ang_tols, 1, row)
sys_allocate_array(thick_tols, 1, row)
sys_allocate_array(tol_areas, 1, row)
 
ang_tols             =  [5., 0.]
thick_tols           =  [5., 0.]
tol_areas(1)         =  ""
tol_areas(2)         =  ""
                               
#--------------------------------------------------------------------
# Set the tolerance data for the layup.
 
i_return_value = P3CM.set_tolerance ( num_tols,                     @
                                      ang_tols,                     @
                                      thick_tols,                   @
                                      tol_areas)
 
$? YESFORALL 29002020 
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.show_laminate
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.show_laminate () 
#
#                      This session file shows the laminate.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.show_laminate () 
#  has the following arguments:
#
#  P3CM.show_laminate ( elem_vstr,       @
#                       nprop,           @
#                       prop,            @
#			nlam,            @ 
#			lam,             @
#			property,        @
#                       display_method,  @
#			scale,           @
#			nlay,            @
#			lay)
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING  elem_vstr[512]
INTEGER nprop 
STRING  prop[80](1)
INTEGER nlam
INTEGER lam(1)
STRING  property[80]
STRING  display_method[80]
REAL    scale
INTEGER nlay
INTEGER lay(1)
 
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Add the created ply in the database. 
 
p3cm.create_ply_add_2( "Paint", "Mat_1", "Ply_1",                    @
                       [1.0000571, 8., 3.4640687],                   @
                       [0.75, -0.5, -0.433], [0., 0., 0.],           @
		       0., -1., -1., -1., 0, "", "", 1, 0,           @
		       [0., 0., 0., 0.], 1, ["Surface 4"], "" )
 
$? YES 59200001 
 
#---------------------------------------------------------------------
# Add the created layup in the database. 
 
p3cm.create_layup_add_2( "spool",                                    @
       "LM_Layup created from : ./spool by LAMINATE MODELER",        @
       1, ["Ply_1", ""], ["Paint", ""], [1, 0], ["Top", ""],         @
       [0., 0.], 0, [0.], [""], [ 0.], [0.], [""], 1, [5., 0.],      @
       [5., 0.], ["", ""], FALSE,                                    @
        "Stan. Lam. Plate (CQUAD4/PCOMP)", FALSE, FALSE )
 
$? YES 59000040
$? YESFORALL 29002020 
			       
#---------------------------------------------------------------------
# Create the laminate  in the database. 
 
p3cm.create_laminates_layup( "ALL", "MSC/NASTRAN", "Structural",     @
                             "laminate_only", "", 0., "", 1,         @
			     [5., 0.], [5., 0.], ["", ""],           @
                             "Stan. Lam. Plate (CQUAD4/PCOMP)",      @
			     "LM_Layup.", 1, 1, FALSE )
 
 
$? YES 59000040
$? YESFORALL 29002020
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
elem_vstr       =  "Elm 332"
nprop           =   1
prop(1)         =  "LM_Layup.20"
nlam            =  1
lam(1)          =  21
property        =  "Orientation"
display_method  =  "Vector"
scale           =  1.
nlay            =  1
lay(1)          =  1 
 
#---------------------------------------------------------------------
# Show the laminate. 
 
i_return_value = P3CM.show_laminate ( elem_vstr,                     @
                                      nprop,                         @
                                      prop,                          @
                                      nlam,                          @ 
                                      lam,                           @
                                      property,                      @
                                      display_method,                @
                                      scale,                         @
                                      nlay,                          @
                                      lay)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.show_layup_exploded
()
#  Purpose          :  This file provides an example of a call to the
#                      function p3cm.show_layup_exploded() 
#
#                      This session file shows the exploded layup. 
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function p3cm.show_layup_exploded() 
#  has the following arguments:
#
#  p3cm.show_layup_exploded ( num_selected,     @
#                             index,            @
#                             offset_mult)                                        
#
#---------------------------------------------------------------------
# Variable Decleration
 
INTEGER   num_selected   
INTEGER   index(1)
REAL      offset_mult   
INTEGER   i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Add the created ply in the database. 
 
p3cm.create_ply_add_2( "Paint", "Mat_1", "Ply_1",                    @
                       [0.035210636, 8., 3.8637209] ,                @
                       [0.75, -0.5, -0.433], [0., 0., 0.],           @
                       0., -1., -1., -1., 0, "", "", 1, 0,           @
                       [0., 0., 0., 0.], 1, ["Surface 4"], "" )
 
$? YES 59200001 
 
#---------------------------------------------------------------------
# Add the created layup in the database. 
 
p3cm.create_layup_add_2( "spool",                                    @
                         "LM_Layup created from : /user2/manishj/"// @
                         "laminate/spool by LAMINATE MODELER", 1,    @
                         ["Ply_1", ""], ["Paint", ""], [1, 0],       @
                         ["Top", ""], [0., 0.], 0, [0.], [""],       @
                         [0.], [0.], [""], 1, [5., 0.], [5., 0.],    @
                         ["", ""], FALSE,                            @
                         "Stan. Lam. Plate (CQUAD4/PCOMP)",          @
                         TRUE, TRUE )
 
 
#---------------------------------------------------------------------
# Argument Initialization. 
 
num_selected   =  1
index(1)       =  1
offset_mult    =  1.
 
#---------------------------------------------------------------------      
# Shows the exploded layup.
 
i_return_value = p3cm.show_layup_exploded( num_selected,             @
                                           index,                    @
                                           offset_mult)
                                          
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.
 
p3cm.show_ply
()
#  Purpose          :  This file provides an example of a call to the
#                      function P3CM.show_ply() 
#
#                      This session file shows the new ply in the database.
#                      
#                      Before running this session file run spool.ses and
#                      create spool.db.  
#                       
#                      This file can be run by starting a session of
#                      MSC/PATRAN, and running this session file through
#                      the "File","Session","Play" pulldown menus
#                      on the menu bar.
#
#
#  The function P3CM.show_ply() 
#  has the following arguments:
#
#  P3CM.show_ply ( type_id_name,     @
#                  ply_name,         @
#                  plot_flag)
#
#
#---------------------------------------------------------------------
# Variable Decleration
 
STRING  type_id_name[80]
STRING  ply_name[80]
LOGICAL plot_flag
 
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Opening the file spool.db
 
uil_file_open.go( "./spool.db") 
 
#---------------------------------------------------------------------
# Add the system library for Laminate Modeler. 
 
sys_library( "add", "laminate_modeler.plb" )
 
#---------------------------------------------------------------------
# Opening a new Layup file for begining the LAMINATE MODELER session. 
 
P3CM.new ( "./spool.Layup" )
 
#---------------------------------------------------------------------
# Add the new material in the database. 
 
p3cm.create_material_add( "Paint", "Mat_1", "aluminum", 0.1, 0., 0. )
 
#---------------------------------------------------------------------
# Add the created ply in the database. 
 
P3CM.create_ply_add_2 ( "Paint", "Mat_1", "Ply_1",                   @
                        [-2.99985, 8., -3.4641883],                  @
                        [0.75, -0.5, -0.433],                        @
                        [0., 0., 0.],0., -1., -1., -1., 0,           @
                        "", "", 1, 0, [0., 0., 0., 0.], 1,           @
                        ["Surface 4"], "" )
 
$? YES 59200001
      
#---------------------------------------------------------------------
# Argument Initialization. 
 
type_id_name  =  "1"
ply_name      =  "Ply_1"
plot_flag     =  TRUE
 
#---------------------------------------------------------------------
# Show the created ply. 
 
i_return_value = P3CM.show_ply (type_id_name, ply_name, plot_flag)
 
#---------------------------------------------------------------------
# Dump the status of the function. 
 
dump i_return_value
 
#---------------------------------------------------------------------
#  Closing the patran environment.
 
uil_file_close.goquit(  )
 
#---------------------------------------------------------------------
#  End of File.