() |
## Purpose : This file provides an example of a call to the# function list_create_boolean_list()## This function creates a list of entities by# combining the contents of the global string# "lista" and "listb" using the type of operation# specified by the input string "boolean" and# placing the the results in the global string# "listc"## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. The string for # list "s_blist_a" and "s_blist_b" are then# defined. The boolean operation carried out in# this example is "and". The return list is# verified after the boolean operation.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_boolean_list()# has the following arguments:## list_create_boolean_list# ( blist_a,# blist_b,# btype,# bret_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_blist_a[32]STRING s_blist_b[32]STRING s_btype[7]STRING sv_bret_list[VIRTUAL]INTEGER i_return_valueSTRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", @ sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create boolean lists_blist_a = "Point 1:4"s_blist_b = "Point 1 2"s_btype = "and"i_return_value = @ list_create_boolean_list @ ( s_blist_a, @ s_blist_b, @ s_btype, @ sv_bret_list )dump i_return_valuedump sv_bret_list#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_bret_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_curve_ass_geo()## This function creates a list of all curves# associated with a list of geometric entities.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. The list of# curves associated with "Surface 1" is obtained# using this function in "lista" and# "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_curve_ass_geo()# has the following arguments:## list_create_curve_ass_geo# ( entity_list,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_entity_list[32]STRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", @ sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create list of all curves associated with "Surface 1 "s_entity_list = "Surface 1"s_target = "lista"i_return_value = @ list_create_curve_ass_geo @ ( s_entity_list, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_curve_ass_group()## This function creates a list of all curves# associated with specified group.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. The list of# curves associated with "default_group" is# obtained using this function in "lista"# and "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_curve_ass_group()# has the following arguments:## list_create_curve_ass_group# ( group_list,# number_of_groups,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING sa_group_list[32](1)INTEGER i_number_of_groupsSTRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", @ sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create list of all curves present in "default_group "sa_group_list(1) = "default_group"i_number_of_groups = 1s_target = "lista"i_return_value = @ list_create_curve_ass_group @ ( sa_group_list, @ i_number_of_groups, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_elem_ass_geo()## This function creates a list of all elements# associated with a list of geomeric entities.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. 2 "quad"# elements are created using "Surface 1". Then# the list of elements associated with# "Surface 1" is obtained using this function in# "lista" and "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_elem_ass_geo() # has the following arguments:## list_create_elem_ass_geo# ( element_shape_code,# entity_list,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_element_shape_codeSTRING s_entity_list[32]STRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_mesh_s_nodes[VIRTUAL]STRING sv_mesh_s_elems[VIRTUAL]STRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", @ "Curve 1 ", sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create FEM entitiesi_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems )dump i_return_value#---------------------------------------------------------------------# Create list of all elements associated with "Surface 1"i_element_shape_code = 4s_entity_list = "Surface 1"s_target = "lista"i_return_value = @ list_create_elem_ass_geo @ ( i_element_shape_code, @ s_entity_list, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_mesh_s_nodes)sys_free_string( sv_mesh_s_elems)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_elem_ass_group()# "sv_return_list".## This function creates a list of all elements# associated with specified group.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. 2 "quad"# elements are created using "Surface 1". Then# the list of elements associated with# "default_group" is obtained using this function# in "lista" and "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_elem_ass_group()# has the following arguments:## list_create_elem_ass_group# ( element_shape_code,# group_list,# number_of_groups,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_element_shape_codeSTRING sa_group_list[32](1)INTEGER i_number_of_groupsSTRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_mesh_s_nodes[VIRTUAL]STRING sv_mesh_s_elems[VIRTUAL]STRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", @ "Curve 1 ", sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create FEM entitiesi_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems )dump i_return_value#---------------------------------------------------------------------# Create list of all elements present in "default_group"i_element_shape_code = 4sa_group_list(1) = "default_group"i_number_of_groups = 1s_target = "lista"i_return_value = @ list_create_elem_ass_group @ ( i_element_shape_code, @ sa_group_list, @ i_number_of_groups, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_mesh_s_nodes)sys_free_string( sv_mesh_s_elems)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_elem_ass_node()## This function creates a list of all elements# associated with a list of nodes.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. 2 "quad"# elements are created using "Surface 1". Then# the list of elements associated with "Node 3"# is obtained using this function in "lista" and# and "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_elem_ass_node()# has the following arguments:## list_create_elem_ass_node# ( element_shape_code,# node_list,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_element_shape_codeSTRING s_node_list[64]STRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_mesh_s_nodes[VIRTUAL]STRING sv_mesh_s_elems[VIRTUAL]STRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", @ "Curve 1 ", sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create FEM entitiesi_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems )dump i_return_value#---------------------------------------------------------------------# Create list of all elements associated with "Node 3".i_element_shape_code = 4s_node_list = "Node 3"s_target = "lista"i_return_value = @ list_create_elem_ass_node @ ( i_element_shape_code, @ s_node_list, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_mesh_s_nodes)sys_free_string( sv_mesh_s_elems)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_elem_att_fringe()## This function creates a list of all finite# element model shape with specified fringe value# in a single group of geometric entities.## In this example a field.db is opened and the# fringe plots for displacement and translation# are created. Then this function is called to# create a list of elements between specified# fringe values in "lista" and "sv_return_list".## Before running this session file run field.ses# to create field.db. Follow the instruction in# the field.ses file for analysis.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.### The function list_create_elem_att_fringe()# has the following arguments:## list_create_elem_att_fringe# ( element_shape_code,# fringe_limits,# fringe_comparison_type,# tolerance,# group_name,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_element_shape_codeREAL ra_fringe_limits(2)STRING s_fringe_comparison_type[7]REAL r_toleranceSTRING s_group_name[32]STRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_value#---------------------------------------------------------------------# Open the database "field.db"uil_file_open.go("field.db")# Set ISO-1 viewingi_return_value = @ ga_view_aa_set @ ( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Initialize parameters for fringe ploti_return_value = @ res_init_fringe_plot( )dump i_return_value# Create plot record for fringe ploti_return_value = @ res_create_fringe_plot_rec3 @ ( 1,2,1,1,1,1,0,0,1.,"",1,2,3,23,1,1,0.,30,0,1 )dump i_return_value# Create a fringe ploti_return_value = @ res_make_fringe_plot @ ( 1, [1], [1], [""], [0.], ["Default, Static Subcase:"// @ " Displacements, Translational (VEC-MAG) -MSC.Nastran"])dump i_return_value# Clear memory used in fringe plot and exit fringe plot modulei_return_value = @ res_deinit_fringe_plot( )dump i_return_value#---------------------------------------------------------------------# Create a list of all elements for a specified range of fringe valuei_element_shape_code = 0ra_fringe_limits(1) = 4.762E-05ra_fringe_limits(2) = 8.844E-05s_fringe_comparison_type = "range"r_tolerance = 4.9999999E-10s_group_name = "default_group"s_target = "lista"i_return_value = @ list_create_elem_att_fringe @ ( i_element_shape_code, @ ra_fringe_limits, @ s_fringe_comparison_type, @ r_tolerance, @ s_group_name, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_elem_att_mat()## This function creates a list of elements of a# particular finite element model shape from a# list of material names.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. 2 "quad"# elements are created using "Surface 1".# Material named "Aluminium" and element property# set "prop_set" are created and associated with# the finite elements. Then the list of elements# associated with material "Aluminium" is# obtained using this function in "lista" and# "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_elem_att_mat()# has the following arguments:## list_create_elem_att_mat# ( element_shape_code,# material_list,# num_materials,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_element_shape_codeSTRING sa_material_list[32](1)INTEGER i_num_materialsSTRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_mesh_s_nodes[VIRTUAL]STRING sv_mesh_s_elems[VIRTUAL]STRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", @ "Curve 1 ", sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create FEM entitiesi_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems )dump i_return_value#---------------------------------------------------------------------# Create material - "Aluminium"i_return_value = @ material.create @ ( "Analysis code ID",1,"Analysis type ID",1,"Aluminium", @ 0,"", "Isotropic", 1, "Directionality", 1, "Linearity",@ 1, "Homogeneous", 0, "Linear Elastic", 1,"Model Opt"// @ "ions & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0], @ "Active Flag", 1, "Create", 10, "External Flag", FALSE,@ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0],"Property Values",["10.1E6", @ "0.33", "0.1", ""] )dump i_return_value# Create element property set - "prop_set"i_return_value = @ elementprops_create @ ( "prop_set", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, @ 4111,4118,4119],[5, 9, 1, 1, 1, 1, 1],["m:Aluminium", @ "", "0.2", "", "","", ""], "Surface 1" )dump i_return_value#---------------------------------------------------------------------# Create list of all elements with material attribute "Aluminium"i_element_shape_code = 4sa_material_list(1) = "Aluminium"i_num_materials = 1s_target = "lista"i_return_value = @ list_create_elem_att_mat @ ( i_element_shape_code, @ sa_material_list, @ i_num_materials, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_mesh_s_nodes)sys_free_string( sv_mesh_s_elems)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_elem_att_prop()## This function creates a list of elements of a# particular finite element model shape from a# list of property names.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. 2 "quad"# elements are created using "Surface 1".# Material named "Aluminium" and element property# set "prop_set" are created and associated with# the finite elements. Then the list of elements# associated with property "prop_set" is# obtained using this function in "lista" and# "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_elem_att_prop()# has the following arguments:## list_create_elem_att_prop# ( element_shape_code,# properties_list,# num_properties,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_element_shape_codeSTRING sa_properties_list[32](1)INTEGER i_num_propertiesSTRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_mesh_s_nodes[VIRTUAL]STRING sv_mesh_s_elems[VIRTUAL]STRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", @ "Curve 1 ", sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create FEM entitiesi_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems )dump i_return_value#---------------------------------------------------------------------# Create material in the databasei_return_value = @ material.create @ ( "Analysis code ID",1,"Analysis type ID",1,"Aluminium", @ 0,"", "Isotropic", 1, "Directionality", 1, "Linearity",@ 1, "Homogeneous", 0, "Linear Elastic", 1,"Model Opt"// @ "ions & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0], @ "Active Flag", 1, "Create", 10, "External Flag", FALSE,@ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0],"Property Values",["10.1E6", @ "0.33", "0.1", ""] )dump i_return_value# Create element property set - "prop_set"i_return_value = @ elementprops_create @ ( "prop_set", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, @ 4111,4118,4119],[5, 9, 1, 1, 1, 1, 1],["m:Aluminium", @ "", "0.2", "", "","", ""], "Surface 1" )dump i_return_value#---------------------------------------------------------------------# Create list of all elements with property set "prop_set"i_element_shape_code = 4sa_properties_list(1) = "prop_set"i_num_properties = 1s_target = "lista"i_return_value = @ list_create_elem_att_prop @ ( i_element_shape_code, @ sa_properties_list, @ i_num_properties, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_mesh_s_nodes)sys_free_string( sv_mesh_s_elems)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_ent_ass_group()## In this example a new database is opened and# group named "NEW_GROUP" is created. Entities# are created in each group. Then this function# is called to obtain the entities present in# the "default_group".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_ent_ass_group()# has the following arguments:## list_create_ent_ass_group# ( group_count,# group_name,# entity_count,# entity_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_group_countSTRING sa_group_name[32](1)INTEGER i_entity_countSTRING sa_entity_name[32](1)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value# Label Curves and solidcurve_label(TRUE)solid_label(TRUE)#---------------------------------------------------------------------# Create Entities in "default_group"i_return_value = @ asm_const_line_2point( "1", "[0 0 0]", "[2 0 0][0 0 2]", 0, @ "", 50., 1, sv_ids_of_created_entities )dump i_return_valuei_return_value = @ asm_const_hpat_xyz( "1", "<0.5 0.5 0.5>", "[0 0 0]", @ "Coord 0", sv_ids_of_created_entities )dump i_return_value#---------------------------------------------------------------------# Create "NEW_GROUP" and make it as current group.i_return_value = ga_group_create( "NEW_GROUP" )dump i_return_valuei_return_value = ga_group_current_set( "NEW_GROUP" )dump i_return_value# Create Entities in "default_group"i_return_value = @ asm_const_line_2point( "3", "[-1 0 -1]", "[-1 2 -1]", 0, "", @ 50., 1, sv_ids_of_created_entities )dump i_return_valuei_return_value = @ sgm_const_curve_2d_circle_v1( "4", 1, 0.5, "Coord 0.3", "", @ "[1 1 0]", TRUE, sv_ids_of_created_entities )dump i_return_value#---------------------------------------------------------------------# Get the entities present in the "default_group".i_group_count = 1sa_group_name (1) = "default_group"i_entity_count = 1sa_entity_name(1) = "Curve"i_return_value = @ list_create_ent_ass_group @ ( i_group_count, @ sa_group_name, @ i_entity_count, @ sa_entity_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_ids_of_created_entities)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_ent_ass_vp()## In this example a new database is opened and# few entities are created. Then this function# is called to get the entities available in# the default_viewport.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_ent_ass_vp()# has the following arguments:## list_create_ent_ass_vp# ( viewport_count,# viewport_name,# entity_count,# entity_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_viewport_countSTRING sa_viewport_name[32](1)INTEGER i_entity_countSTRING sa_entity_name[32](1)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value# Label Curves and solidcurve_label(TRUE)solid_label(TRUE)#---------------------------------------------------------------------# Create Entitiesi_return_value = @ asm_const_line_2point( "1", "[0 0 0]", "[2 0 0][0 0 2]", 0, @ "", 50., 1, sv_ids_of_created_entities )dump i_return_valuei_return_value = @ asm_const_hpat_xyz( "1", "<0.5 0.5 0.5>", "[0 0 0]", @ "Coord 0", sv_ids_of_created_entities )dump i_return_value#---------------------------------------------------------------------# Get the entities present in "default_viewport"i_viewport_count = 1sa_viewport_name(1) = "default_viewport"i_entity_count = 1sa_entity_name(1) = "Curve" i_return_value = @ list_create_ent_ass_vp @ ( i_viewport_count, @ sa_viewport_name, @ i_entity_count, @ sa_entity_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_ids_of_created_entities)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_ent_att_ep_name()## In this example a new database is opened and a# surface is created. The surface is meshed# into 5 quad elements. A material(ALUMINIUM)# and an element property(NEW_EP) is created# and associated with Elements 1 to 3. Then# this function is called to get the entities# having NEW_EP as the element.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_ent_att_ep_name()# has the following arguments:## list_create_ent_att_ep_name# ( ep_count,# ep_name,# entity_count,# entity_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_ep_countSTRING sa_ep_name[32](1)INTEGER i_entity_countSTRING sa_entity_name[32](1)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]INTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuequad_elem_label( TRUE )#---------------------------------------------------------------------# Create a surface and mesh it.i_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_value#---------------------------------------------------------------------# Create Material and Element propertyi_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] )dump i_return_valuei_return_value = @ elementprops_create( "NEW_EP", 51, 25, 35, 1, 1, 20, [13, 20,@ 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:Aluminium", "", "0.2", "", "", "", ""] , "Element 1:3" )dump i_return_value#---------------------------------------------------------------------# Get entities associated with element properties.i_ep_count = 1sa_ep_name(1) = "NEW_EP"i_entity_count = 1sa_entity_name(1) = "Element"i_return_value = @ list_create_ent_att_ep_name @ ( i_ep_count, @ sa_ep_name, @ i_entity_count, @ sa_entity_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_created_nodes)sys_free_string( sv_created_elems)sys_free_string( sv_ids_of_created_entities)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_ent_att_ep_type()## In this example a new database is opened and# a cuboid & a surface are created. They are# meshed and 2 EP are created and associated# with the solid and few of the finite elements.# Then this function is called to get the list# of entities having generic element type# "Solid" & "Shell".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_ent_att_ep_type()# has the following arguments:## list_create_ent_att_ep_type# ( general_count,# general_name,# entity_count,# entity_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_general_countSTRING sa_general_name[32](2)INTEGER i_entity_countSTRING sa_entity_name[32](2)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]INTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuequad_elem_label( TRUE )hex_elem_label( TRUE )#---------------------------------------------------------------------# Create a solid, a surface and mesh them.i_return_value = @ asm_const_hpat_xyz( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 1]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [1.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_valuefem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "25", "6", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_value#---------------------------------------------------------------------# Create Material and Element property.i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] )dump i_return_valuei_return_value = @ elementprops_create( "NEW_EP_1", 71, 25, 30, 1, 1, 20, [13, @ 21, 4124, 4126, 4125], [5, 4, 4, 4, 4], ["m:Aluminium", "", @ "", "", ""], "Solid 1")dump i_return_valuei_return_value = @ elementprops_create( "NEW_EP_2", 51, 25, 35, 1, 1, 20, [13, @ 20, 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:Aluminium", "", "0.2", "", "", "", ""] , "Elm 9:10")dump i_return_value#---------------------------------------------------------------------# Get List of entities having generic element type "Solid" & "Shell"i_general_count = 2sa_general_name(1) = "Solid"sa_general_name(2) = "Shell"i_entity_count = 2sa_entity_name(1) = "Element"sa_entity_name(2) = "Solid"i_return_value = @ list_create_ent_att_ep_type @ ( i_general_count, @ sa_general_name, @ i_entity_count, @ sa_entity_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_created_nodes)sys_free_string( sv_created_elems)sys_free_string( sv_ids_of_created_entities)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_ent_att_lbc_name()## In this example a new database is opened and a# surface is created. The surface is meshed# into 5 quad elements. An LBC ("NEW_DISP") is# created with Point 1 & 4 as application region.# Then this function is called to get the# entities associated with "NEW_DISP".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_ent_att_lbc_name()# has the following arguments:## list_create_ent_att_lbc_name# ( lbc_count,# lbc_name,# entity_count,# entity_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_lbc_countSTRING sa_lbc_name[32](1)INTEGER i_entity_countSTRING sa_entity_name[32](2)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]INTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuenode_label (TRUE )quad_elem_label( TRUE )#---------------------------------------------------------------------# Create surface and FEM meshi_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_value#---------------------------------------------------------------------# Create LBC "NEW_DISP"i_return_value = @ loadsbcs_create( "NEW_DISP", "Displacement", "Nodal", "", @ "Static", [ "Point 1 4"], "Geometry", "Coord 0", 1., @ ["< 0 0 0 >", "< 0 0 0 >"], ["" , ""] )dump i_return_value#---------------------------------------------------------------------# Get list of entities associated with LBC "NEW_DISP"i_lbc_count = 1sa_lbc_name(1) = "NEW_DISP"i_entity_count = 2sa_entity_name(1) = "Point"sa_entity_name(2) = "Node"i_return_value = @ list_create_ent_att_lbc_name @ ( i_lbc_count, @ sa_lbc_name, @ i_entity_count, @ sa_entity_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_created_nodes)sys_free_string( sv_created_elems)sys_free_string( sv_ids_of_created_entities)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_ent_att_lbc_type()## In this example a new database is opened and a# surface is created. The surface is meshed# into 5 quad elements. 2 LBCs "NEW_DISP" and# "NEW_PRESS" are created. Then this function is# called to get the entities associated with# lbc type "Displacement" and "Pressure".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_ent_att_lbc_type()# has the following arguments:## list_create_ent_att_lbc_type# ( lbc_type_count,# lbc_type_name,# entity_count,# entity_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_lbc_type_countSTRING sa_lbc_type_name[32](2)INTEGER i_entity_countSTRING sa_entity_name[32](2)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]INTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuenode_label (TRUE )quad_elem_label( TRUE )#---------------------------------------------------------------------# Create Surface and FEM meshi_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_value#---------------------------------------------------------------------# Create LBCsi_return_value = @ loadsbcs_create( "NEW_DISP", "Displacement", "Nodal", "", @ "Static", [ "Point 1 4"], "Geometry", "Coord 0", 1., @ ["< 0 0 0 >", "< 0 0 0 >"], ["" , ""] )dump i_return_valuei_return_value = @ loadsbcs_create( "NEW_PRESS", "Pressure", "Element Uniform", @ "2D", "Static", ["Element 4 5"], "FEM", "", 1., [" 500", @ "", ""], ["", "", ""] )dump i_return_value#---------------------------------------------------------------------# Get the list of entities associated with load type Displacement# and Pressure.i_lbc_type_count = 2sa_lbc_type_name(1) = "Displacement"sa_lbc_type_name(2) = "Pressure"i_entity_count = 2sa_entity_name(1) = "Node"sa_entity_name(2) = "Element"i_return_value = @ list_create_ent_att_lbc_type @ ( i_lbc_type_count, @ sa_lbc_type_name, @ i_entity_count, @ sa_entity_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_created_nodes)sys_free_string( sv_created_elems)sys_free_string( sv_ids_of_created_entities)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_ent_att_mat_name()## In this example a new database is opened and 2# surfaces are created. A material("Aluminium")# is created and associated with Surface 1.# Then this function is called to get the# entities associated with material "Aluminium"# from the database.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_ent_att_mat_name()# has the following arguments:## list_create_ent_att_mat_name# ( material_count,# material_name,# entity_count,# entity_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_material_countSTRING sa_material_name[32](1)INTEGER i_entity_countSTRING sa_entity_name[32](1)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuesurface_label(TRUE)#---------------------------------------------------------------------# Create surfacei_return_value = @ asm_const_patch_xyz( "#", "<5 1 0>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ asm_const_patch_xyz( "#", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_value#---------------------------------------------------------------------# Create Material and Element propertyi_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] )dump i_return_valuei_return_value = @ elementprops_create( "NEW_EP", 51, 25, 35, 1, 1, 20, [13, 20,@ 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:Aluminium", "", "0.2", "", "", "", ""] , "Surface 1" )dump i_return_value#---------------------------------------------------------------------# Get list of entities associated with material name "Aluminium"i_material_count = 1sa_material_name(1) = "Aluminium"i_entity_count = 1sa_entity_name(1) = "Surface"i_return_value = @ list_create_ent_att_mat_name @ ( i_material_count, @ sa_material_name, @ i_entity_count, @ sa_entity_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_ids_of_created_entities)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_ent_att_mat_type()## In this example a new database is opened and 2# surfaces are created. A material("Aluminium")# is created and associated with Surface 1.# Then this function is called to get the# entities having "isotropic" as the# material-type.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_ent_att_mat_type()# has the following arguments:## list_create_ent_att_mat_type# ( mat_type_count,# mat_type_name,# entity_count,# entity_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_mat_type_countSTRING sa_mat_type_name[32](1)INTEGER i_entity_countSTRING sa_entity_name[32](1)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuesurface_label(TRUE)#---------------------------------------------------------------------# Create Surfacei_return_value = @ asm_const_patch_xyz( "#", "<5 1 0>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ asm_const_patch_xyz( "#", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_value#---------------------------------------------------------------------# Create Material and Element properties.i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] )dump i_return_valuei_return_value = @ elementprops_create( "NEW_EP", 51, 25, 35, 1, 1, 20, [13, 20,@ 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:Aluminium", "", "0.2", "", "", "", ""] , "Surface 1" )dump i_return_value#---------------------------------------------------------------------# Get the entities with "Isotropic" material type.i_mat_type_count = 1sa_mat_type_name(1) = "Isotropic"i_entity_count = 1sa_entity_name(1) = "Surface"i_return_value = @ list_create_ent_att_mat_type @ ( i_mat_type_count, @ sa_mat_type_name, @ i_entity_count, @ sa_entity_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string(sv_return_list)sys_free_string( sv_ids_of_created_entities)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_ent_att_mat_value()## In this example a new database is opened and 5# surfaces are created with different Material# properties. Then this function is called to# get the list of entities whose poisson-ratio# lie within a range of 0.05 to 0.25## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_ent_att_mat_value()# has the following arguments:## list_create_ent_att_mat_value# ( entity_count,# entity_name,# mat_prop_name,# minimum,# maximum,# eval_at_temperature,# evaluation_strain,# evaluation_rate,# evaluation_time,# evaluation_frequency,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_entity_countSTRING sa_entity_name[32](1)STRING s_mat_prop_name[32]REAL r_minimumREAL r_maximumREAL r_eval_at_temperatureREAL r_evaluation_strainREAL r_evaluation_rateREAL r_evaluation_timeREAL r_evaluation_frequencySTRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuesurface_label(TRUE)#---------------------------------------------------------------------# Create Surfaces with different Material propertiesi_return_value = @ asm_const_line_2point( "#", "[0 0 0][0 1 -1][0 1 -1]"// @ "[0 2 -2][0 2 -2][5 0 0][5 1 -1][5 1 -1][5 2 -2][5 2 -2]", @ "[0 0 -1][0 0 -1][0 1 -2][0 1 -2][0 2 -3][5 0 -1][5 0 -1]"// @ "[5 1 -2][5 1 -2][5 2 -3]", 0, "", 50., 1, @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ sgm_const_surface_2curve( "#", "Curve 1:5 ", "Curve 6:10", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_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","Density"],@ [2, 5, 16, 0], "Property Values", ["10E6", "0.11", "0.1", ""])dump i_return_valuei_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_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","Density"],@ [2, 5, 16, 0], "Property Values", ["20E6", "0.22", "0.2", ""])dump i_return_valuei_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_3", 0, "", "Isotropic", 1, "Directionality", 1, @ "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs",["Elastic Modulus","Poisson Ratio","Density"],@ [2, 5, 16, 0], "Property Values", ["30E6", "0.33", "0.3", ""])dump i_return_valuei_return_value = @ elementprops_create( "EP_1", 51, 25, 35, 1, 1, 20, [13, 20, @ 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_1", @ "", "0.1", "", "", "", ""], "Surface 1" )dump i_return_valuei_return_value = @ elementprops_create( "EP_2", 51, 25, 35, 1, 1, 20, [13, 20, @ 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_2", @ "", "0.2", "", "", "", ""], "Surface 2 3" )dump i_return_valuei_return_value = @ elementprops_create( "EP_3", 51, 25, 35, 1, 1, 20, [13, 20, @ 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_3", @ "", "0.3", "", "", "", ""], "Surface 4 5" )dump i_return_value#---------------------------------------------------------------------# Get the list of entities whose poisson ration lie within the range# 0.05 and 0.25i_entity_count = 1sa_entity_name(1) = "Surface"s_mat_prop_name = "Poisson Ratio"r_minimum = 0.05r_maximum = 0.25r_eval_at_temperature = 0.0r_evaluation_strain = 0.0r_evaluation_rate = 0.0r_evaluation_time = 0.0r_evaluation_frequency = 0.0i_return_value = @ list_create_ent_att_mat_value @ ( i_entity_count, @ sa_entity_name, @ s_mat_prop_name, @ r_minimum, @ r_maximum, @ r_eval_at_temperature, @ r_evaluation_strain, @ r_evaluation_rate, @ r_evaluation_time, @ r_evaluation_frequency, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string(sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_ent_att_vp_vis()## In this example a new database is opened and# few entities are created. After a pause one# of the curve is erased and this function is# called to get the list of entities available# in "default_viewport".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_ent_att_vp_vis()# has the following arguments:## list_create_ent_att_vp_vis# ( viewport_count,# viewport_name,# entity_count,# entity_name,# pick_type,# pick_erased,# return_list )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_viewport_countSTRING sa_viewport_name[32](1)INTEGER i_entity_countSTRING sa_entity_name[32](1)INTEGER i_pick_typeINTEGER i_pick_erasedSTRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value# Label Curves and solidcurve_label(TRUE)solid_label(TRUE)#---------------------------------------------------------------------# Create 2 curves and a solidi_return_value = @ asm_const_line_2point( "1", "[0 0 0]", "[2 0 0][0 0 2]", 0, @ "", 50., 1, sv_ids_of_created_entities )dump i_return_valuei_return_value = @ asm_const_hpat_xyz( "1", "<0.5 0.5 0.5>", "[0 0 0]", @ "Coord 0", sv_ids_of_created_entities )dump i_return_value#---------------------------------------------------------------------# Session file paused. Press "Resume" to continue..sf_pause()# Erase Curve 1gm_visibility_widget( "Curve 1 ", FALSE )#---------------------------------------------------------------------# Get the list of entities in "default_viewport"i_return_value = @ list_create_ent_ass_vp( 1, ["default_viewport"], 1, @ ["Curve"], sv_return_list )dump i_return_valuedump sv_return_list#---------------------------------------------------------------------# Get the list of all entities in "default_viewport" even if it# is erased.i_viewport_count = 1sa_viewport_name(1) = "default_viewport"i_entity_count = 1sa_entity_name(1) = "Curve"i_pick_type = 1i_pick_erased = 1 /* Also get erased entities */i_return_value = @ list_create_ent_att_vp_vis @ ( i_viewport_count, @ sa_viewport_name, @ i_entity_count, @ sa_entity_name, @ i_pick_type, @ i_pick_erased, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_ids_of_created_entities)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_fem_con_fem()## In this example a new database is opened and# a surface with 5 quad elements is created.# Then this function is called to get the list# of elements associated with Node 1 and# element adjacent to Element 3.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_fem_con_fem()# has the following arguments:## list_create_fem_con_fem# ( in_list,# get_node_con_to_node_by_elem,# get_node_con_to_node_by_mpc,# get_node_used_by_elem,# get_node_used_by_mpc,# get_elem_using_node,# get_elem_adj_to_elem,# get_elem_adj_to_mpc,# get_mpc_using_node,# get_mpc_adj_to_elem,# get_mpc_adj_to_mpc,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_in_list[128]INTEGER i_get_node_con_to_node_by_elemINTEGER i_get_node_con_to_node_by_mpcINTEGER i_get_node_used_by_elemINTEGER i_get_node_used_by_mpcINTEGER i_get_elem_using_nodeINTEGER i_get_elem_adj_to_elemINTEGER i_get_elem_adj_to_mpcINTEGER i_get_mpc_using_nodeINTEGER i_get_mpc_adj_to_elemINTEGER i_get_mpc_adj_to_mpcSTRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]INTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuenode_label (TRUE )quad_elem_label( TRUE )#---------------------------------------------------------------------# Create Surface with 5 elementsi_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_value#---------------------------------------------------------------------# Get the element associated with Node 1 and Elements adjacent# to Elm 3.s_in_list = "Node 1 Elm 3"i_get_node_con_to_node_by_elem = 0i_get_node_con_to_node_by_mpc = 0i_get_node_used_by_elem = 0i_get_node_used_by_mpc = 0i_get_elem_using_node = 1i_get_elem_adj_to_elem = 1i_get_elem_adj_to_mpc = 0i_get_mpc_using_node = 0i_get_mpc_adj_to_elem = 0i_get_mpc_adj_to_mpc = 0i_return_value = @ list_create_fem_con_fem @ ( s_in_list, @ i_get_node_con_to_node_by_elem, @ i_get_node_con_to_node_by_mpc, @ i_get_node_used_by_elem, @ i_get_node_used_by_mpc, @ i_get_elem_using_node, @ i_get_elem_adj_to_elem, @ i_get_elem_adj_to_mpc, @ i_get_mpc_using_node, @ i_get_mpc_adj_to_elem, @ i_get_mpc_adj_to_mpc, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_created_nodes)sys_free_string( sv_created_elems)sys_free_string( sv_ids_of_created_entities)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_node_ass_elem()## This function creates a list of all nodes# associated with a list of elements.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. 2 "quad"# elements are created using "Surface 1". Then# the list of nodes associated with "Element 1"# is obtained using this function in "lista" and# and "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_node_ass_elem()# has the following arguments:## list_create_node_ass_elem# ( element_list,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_element_list[64]STRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_mesh_s_nodes[VIRTUAL]STRING sv_mesh_s_elems[VIRTUAL]STRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", @ "Curve 1 ", sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create FEM entitiesi_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems )dump i_return_value#---------------------------------------------------------------------# Create list of all nodes associated with "Element 1"s_element_list = "Element 1"s_target = "lista"i_return_value = @ list_create_node_ass_elem @ ( s_element_list, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_mesh_s_nodes)sys_free_string( sv_mesh_s_elems)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_node_ass_geo()## This function creates a list of all nodes# associated with a list of geometric entities.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. 2 "quad"# elements are created using "Surface 1". Then# the list of nodes associated with "Curve 1"# is obtained using this function in "lista" and# and "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_node_ass_geo()# has the following arguments:## list_create_node_ass_geo# ( geometry_list,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_geometry_list[64]STRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_mesh_s_nodes[VIRTUAL]STRING sv_mesh_s_elems[VIRTUAL]STRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", @ "Curve 1 ", sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create FEM entitiesi_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems )dump i_return_value#---------------------------------------------------------------------# Create list of all nodes associated with "Curve 1"s_geometry_list = "Curve 1"s_target = "lista"i_return_value = @ list_create_node_ass_geo @ ( s_geometry_list, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_mesh_s_nodes)sys_free_string( sv_mesh_s_elems)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_node_ass_group()## This function creates a list of all nodes# associated with a list of specified groups.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. 2 "quad"# elements are created using "Surface 1". Then# the list of nodes present in "default_group"# is obtained using this function in "lista" and# and "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_node_ass_group()# has the following arguments:## list_create_node_ass_group# ( group_list,# number_of_groups,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING sa_group_list[32](1)INTEGER i_number_of_groupsSTRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_mesh_s_nodes[VIRTUAL]STRING sv_mesh_s_elems[VIRTUAL]STRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", @ "Curve 1 ", sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create FEM entitiesi_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems )dump i_return_value#---------------------------------------------------------------------# Create list of all nodes present in "default_group".sa_group_list(1) = "default_group"i_number_of_groups = 1s_target = "lista"i_return_value = @ list_create_node_ass_group @ ( sa_group_list, @ i_number_of_groups, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_mesh_s_nodes)sys_free_string( sv_mesh_s_elems)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_node_att_fringe()## This function creates a list of all nodes with# specified fringe value in a single group of # geometric entities.## In this example a field.db is opened and the# fringe plots for displacement and translation# are created. Then this function is called to# create a list of elements between specified# fringe values in "lista" and "sv_return_list".## Before running this session file run field.ses# to create field.db. Follow the instruction in# the field.ses file for analysis.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_node_att_fringe()# has the following arguments:## list_create_node_att_fringe# ( fringe_limits,# fringe_comparison_type,# tolerance,# group_name,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsREAL ra_fringe_limits(2)STRING s_fringe_comparison_type[7]REAL r_toleranceSTRING s_group_name[32]STRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_value#---------------------------------------------------------------------# Open the database "field.db"uil_file_open.go("field.db")# Set ISO-1 viewingi_return_value = @ ga_view_aa_set @ ( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Initialize parameters for fringe ploti_return_value = @ res_init_fringe_plot( )dump i_return_value# Create plot record for fringe ploti_return_value = @ res_create_fringe_plot_rec3 @ ( 1,2,1,1,1,1,0,0,1.,"",1,2,3,23,1,1,0.,30,0,1 )dump i_return_value# Create a fringe ploti_return_value = @ res_make_fringe_plot @ ( 1, [1], [1], [""], [0.], ["Default, Static Subcase:"// @ " Displacements, Translational (VEC-MAG) -MSC.Nastran"])dump i_return_value# Clear memory used in fringe plot and exit fringe plot modulei_return_value = @ res_deinit_fringe_plot( )dump i_return_value#---------------------------------------------------------------------# Create a list of all nodes for a specified range of fringe valuera_fringe_limits(1) = 1.361E-05ra_fringe_limits(2) = 7.4839998E-05 s_fringe_comparison_type = "range"r_tolerance = 5.0000002E-19s_group_name = "default_group"s_target = "lista"i_return_value = @ list_create_node_att_fringe @ ( ra_fringe_limits, @ s_fringe_comparison_type, @ r_tolerance, @ s_group_name, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_node_att_value()## This function creates a list of all nodes# within a given coordinate range.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. 2 "quad"# elements are created using "Surface 1". Then# the list of nodes with X coordinate value = 0# is obtained using this function in "lista" and# and "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_node_att_value()# has the following arguments:## list_create_node_att_value# ( coord_values,# coord_values_active,# coord_comparison_type,# tolerance,# coord_name,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsREAL ra_coord_values(6)LOGICAL la_coord_values_active(3)STRING sa_coord_comparison_type[7](3)REAL ra_tolerance(3)STRING s_coord_name[32]STRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_mesh_s_nodes[VIRTUAL]STRING sv_mesh_s_elems[VIRTUAL]STRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", @ "Curve 1 ", sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create FEM entitiesi_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems )dump i_return_value#---------------------------------------------------------------------# Create list of all nodes with X = 0ra_coord_values(1) = 0.0la_coord_values_active(1) = TRUEsa_coord_comparison_type(1) = "equal"ra_tolerance(1) = 0.05s_coord_name = "Coord 0"s_target = "lista"i_return_value = @ list_create_node_att_value @ ( ra_coord_values, @ la_coord_values_active, @ sa_coord_comparison_type, @ ra_tolerance, @ s_coord_name, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_mesh_s_nodes)sys_free_string( sv_mesh_s_elems)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_point_ass_geo()## This function creates a list of all points from# a list of geometric entities.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. The list of# points associated with "Curve 1" is obtained# using this function in "lista" and# "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_point_ass_geo()# has the following arguments:## list_create_point_ass_geo# ( entity_list,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_entity_list[8]STRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", @ sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create list of all points associated with "Curve 1".s_entity_list = "Curve 1"s_target = "lista"i_return_value = @ list_create_point_ass_geo @ ( s_entity_list, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_point_ass_group()## This function creates a list of all points# associated with specified group.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. The list of# points associated with "default_group" is# obtained using this function in "lista"# and "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_point_ass_group()# has the following arguments:## list_create_point_ass_group# ( group_list,# number_of_groups,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING sa_group_list[32](1)INTEGER i_number_of_groupsSTRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", @ sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create list of all points present in "default_group "sa_group_list(1) = "default_group"i_number_of_groups = 1s_target = "lista"i_return_value = @ list_create_point_ass_group @ ( sa_group_list, @ i_number_of_groups, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_surface_ass_geo()## This function creates a list of all surfaces# from a list of geometric entities.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. The list of# surfaces associated with "Curve 1" is obtained# using this function in "lista" and# "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_surface_ass_geo()# has the following arguments:## list_create_surface_ass_geo# ( entity_list,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_entity_list[64]STRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", @ sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create list of all surfaces from "Curve 1 "s_entity_list = "Curve 1"s_target = "lista"i_return_value = @ list_create_surface_ass_geo @ ( s_entity_list, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_create_surface_ass_group()## This function creates a list of all surfaces# associated with specified group.## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. The list of# surfaces associated with "default_group" is# obtained using this function in "lista"# and "sv_return_list".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_surface_ass_group()# has the following arguments:## list_create_surface_ass_group# ( group_list,# number_of_groups,# target,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING sa_group_list[32](1)INTEGER i_number_of_groupsSTRING s_target[6]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", @ sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# Create list of all surfaces present in "default_group "sa_group_list(1) = "default_group"i_number_of_groups = 1s_target = "lista"i_return_value = @ list_create_surface_ass_group @ ( sa_group_list, @ i_number_of_groups, @ s_target, @ sv_return_list )dump i_return_valuedump sv_return_listdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)sys_free_string( sv_return_list)#--------------------------------------------------------------------- () |
## Purpose : This file provides an example of 2 calls to the# function list_create_target_list()## This function allocates space for a string,# sets the value of the allocated string using an# input string and assigns the allocated string# to one of two global string variables named# "lista" or "listb" based on the settings of the# two matching internal global variables named# "lista_nomerge" and "listb_nomerge".## In this example a new database is opened and# a cube of dimension 1 X 1 X 1 is created. Then# the input string "s_entity_list" is assigned a# value. The string is then targeted to global# string "lista" using this function. The value# of the global string "lista" is checked before# and after the calling of this function. Once# again the string "s_entity_list" is assigned# and targeted to "lista" for appending. The# global variable "lista_nomerge" is assigned# TRUE for not sorting the new "lista".## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_create_target_list()# has the following arguments:## list_create_target_list# ( target,# entity_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_target[6]STRING s_entity_list[64]INTEGER i_return_valueSTRING sv_hpat_ids[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set IS0-1 Viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Cube of dimension 1 X 1 X 1i_return_value = @ asm_const_hpat_xyz @ ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_ids )dump i_return_value#---------------------------------------------------------------------# Value of global string "lista" before targetingdump lista# Target input string to "lista"s_target = "lista"s_entity_list = "Point 1 4 3"i_return_value = @ list_create_target_list @ ( s_target, @ s_entity_list )dump i_return_valuedump s_entity_list# Value of global string "lista" after targetingdump lista#---------------------------------------------------------------------# Dot not sort the boolean listlista_nomerge = TRUE# Target input string to "lista" again.s_target = "lista"s_entity_list = "Point 2 5 7 8 6"i_return_value = @ list_create_target_list @ ( s_target, @ s_entity_list )dump i_return_valuedump s_entity_list# Value of global string "lista" after targetingdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_hpat_ids)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_filter_by_elem_dim()## In this example a new database is opened and# 5 quad elements with different dimensions are# created. Then this function is called to get# the list of elements within a certain# dimension range from an input list.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_filter_by_elem_dim()# has the following arguments:## list_filter_by_elem_dim# ( input_list,# criterion,# segment_count,# minimum,# maximum,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list[32]STRING s_criterion[32]INTEGER i_segment_countREAL r_minimumREAL r_maximumSTRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_created_entities_list[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuequad_elem_label( TRUE )#---------------------------------------------------------------------# Create quad elementsi_return_value = @ fem_create_elems( "Quad", "Quad4", "1", "Standard", TRUE, @ "[0 0 0][2 0 0][3 0 0][5 0 0][6 0 0]", "[2 0 0][3 0 0]"// @ "[5 0 0][6 0 0][9 0 0]", "[2 1 0][3 1 0][5 1 0][6 1 0]"// @ "[9 1 0]", "[0 1 0][2 1 0][3 1 0][5 1 0][6 1 0]", "", "", "",@ "", sv_created_entities_list )dump i_return_value#---------------------------------------------------------------------# Get the list of elements whose edge lengths are in specified# ranges_input_list = "Element 1:5"s_criterion = "EdgeLengthMax"i_segment_count = 0r_minimum = 1.5r_maximum = 2.5i_return_value = @ list_filter_by_elem_dim @ ( s_input_list, @ s_criterion, @ i_segment_count, @ r_minimum, @ r_maximum, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_created_entities_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_filter_by_ent_shape()## In this example a new database is opened and# different types of finite elements are created.# Then this function is called to get the# list of curves, surfaces, beams elements,# quad elements and hex elements from an input# list.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_filter_by_ent_shape()# has the following arguments:## list_filter_by_ent_shape# ( input_list,# geometric_points,# geometric_curves,# geometric_surfaces,# geometric_solids,# element_points,# element_beams,# element_tria,# element_quad,# element_tet,# element_wedge,# element_hex,# node,# mpc,# any_other,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list[128]INTEGER i_geometric_pointsINTEGER i_geometric_curvesINTEGER i_geometric_surfacesINTEGER i_geometric_solidsINTEGER i_element_pointsINTEGER i_element_beamsINTEGER i_element_triaINTEGER i_element_quadINTEGER i_element_tetINTEGER i_element_wedgeINTEGER i_element_hexINTEGER i_nodeINTEGER i_mpcINTEGER i_any_otherSTRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_created_entities[VIRTUAL]INTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuebar_elem_label( TRUE )tri_elem_label( TRUE )quad_elem_label( TRUE )hex_elem_label( TRUE )#---------------------------------------------------------------------# Create Solid and various types of elementsi_return_value = @ asm_const_hpat_xyz( "1", "<2 1 1>", "[0 0 0]", "Coord 0", @ sv_created_entities )dump i_return_valuei_return_value = @ sgm_const_surface_extrude( "1", "<-2 0 0>", 1., 0., @ "[0 0 0]", "Coord 0", "Solid 1.1.3 ", sv_created_entities )dump i_return_valuei_return_value = @ sgm_const_surface_extrude( "2", "<0 0 -2>", 1., 0., @ "[0 0 0]", "Coord 0", "Solid 1.4.1 ", sv_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 2 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Tria3", "10", "5", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_valuei_return_value = @ fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [1.], @ "Hex8", "16", "9", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_valuei_return_value = @ fem_create_elems( "Bar ", "Bar2", "11", "Standard", FALSE, @ "Node 14 ", "Node 7 ", "", "", "", "", "", "", @ sv_created_entities )dump i_return_value#---------------------------------------------------------------------# Get entities with mentioned relationss_input_list = "Node 1:27 Elm 1:11 Point 1:12 " // @ "Surface 1 2 Solid 1"i_geometric_points = 0i_geometric_curves = 1i_geometric_surfaces = 1i_geometric_solids = 0i_element_points = 0i_element_beams = 1i_element_tria = 0i_element_quad = 1i_element_tet = 0i_element_wedge = 0i_element_hex = 1i_node = 0i_mpc = 0i_any_other = 0i_return_value = @ list_filter_by_ent_shape @ ( s_input_list, @ i_geometric_points, @ i_geometric_curves, @ i_geometric_surfaces, @ i_geometric_solids, @ i_element_points, @ i_element_beams, @ i_element_tria, @ i_element_quad, @ i_element_tet, @ i_element_wedge, @ i_element_hex, @ i_node, @ i_mpc, @ i_any_other, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string(sv_return_list)sys_free_string(sv_created_entities)sys_free_string(sv_created_nodes)sys_free_string(sv_created_elems)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_filter_by_ep_type()## In this example a new database is opened and# a solid & a surface are created. The created# solid and surface are meshed into hex and# quad elements respectively. 2 Element# properties are created and associated with# some of the finite elements. Then this# function is called to get entities of "Shell"# type from a set of input entities.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_filter_by_ep_type()# has the following arguments:## list_filter_by_ep_type# ( input_list,# ep_type_count,# ep_type_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list[128]INTEGER i_ep_type_countSTRING sa_ep_type_name[32](1)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]INTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuequad_elem_label( TRUE )hex_elem_label( TRUE )#---------------------------------------------------------------------# Create solid and surfacei_return_value = @ asm_const_hpat_xyz( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 1]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [1.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "25", "6", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_value#---------------------------------------------------------------------# Create Material and Element properties.i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] )dump i_return_valuei_return_value = @ elementprops_create( "NEW_EP_1", 71, 25, 30, 1, 1, 20, [13, @ 21, 4124, 4126, 4125], [5, 4, 4, 4, 4], ["m:Aluminium", "", @ "", "", ""], "Elm 1:3" )dump i_return_valuei_return_value = @ elementprops_create( "NEW_EP_2", 51, 25, 35, 1, 1, 20, [13, @ 20, 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:Aluminium", "", "0.2", "", "", "", ""] , "Elm 9:10")dump i_return_value#---------------------------------------------------------------------# Get the list of elements having element-property as "Shell"s_input_list = "Element 1:10"i_ep_type_count = 1sa_ep_type_name(1) = "Shell"i_return_value = @ list_filter_by_ep_type @ ( s_input_list, @ i_ep_type_count, @ sa_ep_type_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string(sv_return_list)sys_free_string(sv_ids_of_created_entities)sys_free_string(sv_created_nodes)sys_free_string(sv_created_elems)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_filter_by_ep_value()## In this example a new database is opened and# 5 surface are created. The surface are meshed# into quad elements. 3 different element# properties (with different thickness values)# are associated with different elements. Then# this function is called to get the list of# elements whose thickness lie between 0.15 and# 0.25 units from a set of input entities.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_filter_by_ep_value()# has the following arguments:## list_filter_by_ep_value# ( input_list,# element_property,# component,# minimum,# maximum,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list[128]STRING s_element_property[32]INTEGER i_componentREAL r_minimumREAL r_maximumSTRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]INTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_created_node[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuequad_elem_label(TRUE)#---------------------------------------------------------------------# Create curve, surfaces and finite elements.i_return_value = @ asm_const_line_2point( "#", "[0 0 0][0 1 -1][0 1 -1]"// @ "[0 2 -2][0 2 -2][5 0 0][5 1 -1][5 1 -1][5 2 -2][5 2 -2]", @ "[0 0 -1][0 0 -1][0 1 -2][0 1 -2][0 2 -3][5 0 -1][5 0 -1]"// @ "[5 1 -2][5 1 -2][5 2 -3]", 0, "", 50., 1, @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ sgm_const_surface_2curve( "#", "Curve 1:5 ", "Curve 6:10", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1:5 ", 1, @ [1.], "Quad4", "1", "1", "Coord 0", "Coord 0", @ i_num_nodes, i_num_elems, sv_created_node, sv_created_elems )#---------------------------------------------------------------------i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_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","Density"],@ [2, 5, 16, 0], "Property Values", ["10E6", "0.11", "0.1", ""])dump i_return_valuei_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_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","Density"],@ [2, 5, 16, 0], "Property Values", ["20E6", "0.22", "0.2", ""])dump i_return_valuei_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_3", 0, "", "Isotropic", 1, "Directionality", 1, @ "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs",["Elastic Modulus","Poisson Ratio","Density"],@ [2, 5, 16, 0], "Property Values", ["30E6", "0.33", "0.3", ""])dump i_return_valuei_return_value = @ elementprops_create( "EP_1", 51, 25, 35, 1, 1, 20, [13, 20, @ 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_1", @ "", "0.1", "", "", "", ""], "Element 1:5" )dump i_return_valuei_return_value = @ elementprops_create( "EP_2", 51, 25, 35, 1, 1, 20, [13, 20, @ 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_2", @ "", "0.2", "", "", "", ""], "Element 6:15")dump i_return_valuei_return_value = @ elementprops_create( "EP_3", 51, 25, 35, 1, 1, 20, [13, 20, @ 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_3", @ "", "0.3", "", "", "", ""], "Element 16:25" )dump i_return_value#---------------------------------------------------------------------# Get elements whose thickness lie between 0.15 and 0.25s_input_list = "Element 1:25"s_element_property = "Thickness"i_component = 0r_minimum = 0.15r_maximum = 0.25i_return_value = @ list_filter_by_ep_value @ ( s_input_list, @ s_element_property, @ i_component, @ r_minimum, @ r_maximum, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_ids_of_created_entities)sys_free_string( sv_created_node)sys_free_string( sv_created_elems)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_filter_by_fem_type()## In this example a new database is opened and# different types of finite elements are created.# Then this function is called to get the# list of elements which are of type Hex8 and# Bar2 from an input list.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_filter_by_fem_type()# has the following arguments:## list_filter_by_fem_type# ( input_list,# fem_type_count,# fem_type_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list[128]INTEGER i_fem_type_countSTRING sa_fem_type_name[32](2)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_created_entities[VIRTUAL]STRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuebar_elem_label( TRUE )tri_elem_label( TRUE )quad_elem_label( TRUE )hex_elem_label( TRUE )#---------------------------------------------------------------------# Create different type of elmentsi_return_value = @ asm_const_hpat_xyz( "1", "<2 1 1>", "[0 0 0]", "Coord 0", @ sv_created_entities )dump i_return_valuei_return_value = @ sgm_const_surface_extrude( "1", "<-2 0 0>", 1., 0., @ "[0 0 0]", "Coord 0", "Solid 1.1.3 ", sv_created_entities )dump i_return_valuei_return_value = @ sgm_const_surface_extrude( "2", "<0 0 -2>", 1., 0., @ "[0 0 0]", "Coord 0", "Solid 1.4.1 ", sv_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 2 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Tria3", "10", "5", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_valuei_return_value = @ fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [1.], @ "Hex8", "16", "9", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_valuei_return_value = @ fem_create_elems( "Bar ", "Bar2", "11", "Standard", FALSE, @ "Node 14 ", "Node 7 ", "", "", "", "", "", "", @ sv_created_entities )dump i_return_value#---------------------------------------------------------------------# Get elements which are of type Hex8 and Bar2s_input_list = "Node 1:27 Elm 1:11"i_fem_type_count = 2sa_fem_type_name(1) = "ElmHex8"sa_fem_type_name(2) = "ElmBar2"i_return_value = @ list_filter_by_fem_type @ ( s_input_list, @ i_fem_type_count, @ sa_fem_type_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_created_entities)sys_free_string( sv_created_nodes)sys_free_string( sv_created_elems)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_filter_by_lbc_type()## In this example a new database is opened and# a surface with displacement and pressure# loads is created. Then this function is# called to get the list of elements which have# loads of type "Displacement" and "Pressure"# from an input list.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_filter_by_lbc_type()# has the following arguments:## list_filter_by_lbc_type# ( input_list,# lbc_type_count,# lbc_type_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list[128]INTEGER i_lbc_type_countSTRING sa_lbc_type_name[32](2)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueSTRING sv_ids_of_created_entities[VIRTUAL]INTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuenode_label ( TRUE )quad_elem_label( TRUE )#---------------------------------------------------------------------# Create Surface and LBCsi_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_valuei_return_value = @ loadsbcs_create( "NEW_DISP", "Displacement", "Nodal", "", @ "Static", [ "Point 1 4"], "Geometry", "Coord 0", 1., @ ["< 0 0 0 >", "< 0 0 0 >"], ["" , ""] )dump i_return_valuei_return_value = @ loadsbcs_create( "NEW_PRESS", "Pressure", "Element Uniform", @ "2D", "Static", ["Element 4 5"], "FEM", "", 1., [" 500", @ "", ""], ["", "", ""] )dump i_return_value#---------------------------------------------------------------------# Get elements which have loads of type "Displacement" and# "Pressure".s_input_list = "Node 1:12 Elm 1:5"i_lbc_type_count = 2 sa_lbc_type_name(1) = "Displacement"sa_lbc_type_name(2) = "Pressure"i_return_value = @ list_filter_by_lbc_type @ ( s_input_list, @ i_lbc_type_count, @ sa_lbc_type_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_ids_of_created_entities)sys_free_string( sv_created_nodes)sys_free_string( sv_created_elems)#--------------------------------------------------------------------- () |
## Purpose : This file provides an example of a call to the# function list_filter_by_lbc_value()## In this example a new database is opened and# a surface with Pressure LBCs of different# values is created. Then this function is# called to get the list of elements which have# pressure values are between 150 and 250 units# from an input list.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_filter_by_lbc_value()# has the following arguments:## list_filter_by_lbc_value# ( input_list,# load_case_name,# lbc_var_name,# component,# minimum,# maximum,# evaluation_time,# evaluation_frequency,# sub_entity,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list[128]STRING s_load_case_name[32]STRING s_lbc_var_name[32]INTEGER i_componentREAL r_minimumREAL r_maximumREAL r_evaluation_timeREAL r_evaluation_frequencySTRING s_sub_entity[32]STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_ids_of_created_entities[VIRTUAL]STRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuequad_elem_label( TRUE )#---------------------------------------------------------------------# Create Surface and finite elementsi_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_value#---------------------------------------------------------------------# Create LBCsi_return_value = @ loadsbcs_create( "NEW_PRESS_ELEM_1", "Pressure", @ "Element Uniform", "2D", "Static", ["Element 1"], "FEM", @ "", 1., ["100", "", ""], ["", "", ""] )dump i_return_valuei_return_value = @ loadsbcs_create( "NEW_PRESS_ELEM_2_3", "Pressure", @ "Element Uniform", "2D", "Static", ["Element 2:3"], "FEM", @ "", 1., ["200", "", ""], ["", "", ""] )dump i_return_valuei_return_value = @ loadsbcs_create( "NEW_PRESS_ELEM_4_5", "Pressure", @ "Element Uniform", "2D", "Static", ["Element 4:5"], "FEM", @ "", 1., ["300", "", ""], ["", "", ""] )dump i_return_value#---------------------------------------------------------------------# Get elements whose pressure values are between 150 and 250 units.s_input_list = "Elm 1:5"s_load_case_name = ""s_lbc_var_name = "Top Surf Pressure"i_component = 3r_minimum = 150r_maximum = 250r_evaluation_time = 0r_evaluation_frequency = 0s_sub_entity = "ANY"i_return_value = @ list_filter_by_lbc_value @ ( s_input_list, @ s_load_case_name, @ s_lbc_var_name, @ i_component, @ r_minimum, @ r_maximum, @ r_evaluation_time, @ r_evaluation_frequency, @ s_sub_entity, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_ids_of_created_entities)sys_free_string( sv_created_nodes)sys_free_string( sv_created_elems)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_filter_by_mat_name()## In this example a new database is opened and# 2 surfaces are created. A material("Aluminium")# is created and associated with surface 1.# Then this function is called to get the# elements having Aluminium as the material# from an input list.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.### The function list_filter_by_mat_name()# has the following arguments:## list_filter_by_mat_name# ( input_list,# mat_count,# mat_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list[128]INTEGER i_mat_countSTRING sa_mat_name[32](1)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_ids_of_created_entities[VIRTUAL]STRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuesurface_label(TRUE)quad_elem_label( TRUE )#---------------------------------------------------------------------# Create Surface and finite elements.i_return_value = @ asm_const_patch_xyz( "#", "<5 1 0>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ asm_const_patch_xyz( "#", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0,"Surface 1 2", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_value#---------------------------------------------------------------------# Create Material and Element properties.i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] )dump i_return_valuei_return_value = @ elementprops_create( "NEW_EP", 51, 25, 35, 1, 1, 20, [13, 20,@ 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:Aluminium", "", "0.2", "", "", "", ""] , "Surface 1" )dump i_return_value#---------------------------------------------------------------------# Get Elements which have "Aluminium" as material.s_input_list = "Element 1:10"i_mat_count = 1sa_mat_name(1) = "Aluminium"i_return_value = @ list_filter_by_mat_name @ ( s_input_list, @ i_mat_count, @ sa_mat_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_ids_of_created_entities)sys_free_string( sv_created_nodes)sys_free_string( sv_created_elems)#--------------------------------------------------------------------- () |
## Purpose : This file provides an example of a call to the# function list_filter_by_mat_type()## In this example a new database is opened and 2# surfaces are created. A material (Aluminium) is# created and associated with some of the# elements. Then this function is called to get# the elements having "isotropic" as the# material-type from an input list.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_filter_by_mat_type()# has the following arguments:## list_filter_by_mat_type# ( input_list,# mat_type_count,# mat_type_name,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list[128]INTEGER i_mat_type_countSTRING sa_mat_type_name[32](1)STRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_ids_of_created_entities[VIRTUAL]STRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuesurface_label(TRUE)quad_elem_label(TRUE)#---------------------------------------------------------------------# Create surface and finite elementsi_return_value = @ asm_const_patch_xyz( "#", "<5 1 0>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ asm_const_patch_xyz( "#", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0,"Surface 1 2", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_value#---------------------------------------------------------------------# Create material and element property.i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] )dump i_return_valuei_return_value = @ elementprops_create( "NEW_EP", 51, 25, 35, 1, 1, 20, [13, 20,@ 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:Aluminium", "", "0.2", "", "", "", ""] , "Surface 1" )dump i_return_value#---------------------------------------------------------------------# Get entities with material type "Isotropic"s_input_list = "Surface 1:2 Element 4:10"i_mat_type_count = 1sa_mat_type_name(1) = "Isotropic"i_return_value = @ list_filter_by_mat_type @ ( s_input_list, @ i_mat_type_count, @ sa_mat_type_name, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_ids_of_created_entities)sys_free_string( sv_created_nodes)sys_free_string( sv_created_elems)#--------------------------------------------------------------------- () |
## Purpose : This file provides an example of a call to the# function list_filter_by_mat_value()## In this example a new database is opened and 5# surfaces are created with different Material# properties. The surfaces are meshed with quad# elements. Then this function is called to get# the list of elements whose poisson-ratio lie# within a range of 0.05 to 0.25 from an input# list.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_filter_by_mat_value()# has the following arguments:## list_filter_by_mat_value# ( input_list,# mat_prop_name,# minimum,# maximum,# eval_at_temperature,# evaluation_strain,# evaluation_rate,# evaluation_time,# evaluation_frequency,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list[128]STRING s_mat_prop_name[32]REAL r_minimumREAL r_maximumREAL r_eval_at_temperatureREAL r_evaluation_strainREAL r_evaluation_rateREAL r_evaluation_timeREAL r_evaluation_frequencySTRING sv_return_list[VIRTUAL]INTEGER i_return_valueINTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_ids_of_created_entities[VIRTUAL]STRING sv_created_nodes[VIRTUAL]STRING sv_created_elems[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_valuesurface_label(TRUE)quad_elem_label( TRUE )#---------------------------------------------------------------------# Create 5 surfacei_return_value = @ asm_const_line_2point( "#", "[0 0 0][0 1 -1][0 1 -1]"// @ "[0 2 -2][0 2 -2][5 0 0][5 1 -1][5 1 -1][5 2 -2][5 2 -2]", @ "[0 0 -1][0 0 -1][0 1 -2][0 1 -2][0 2 -3][5 0 -1][5 0 -1]"// @ "[5 1 -2][5 1 -2][5 2 -3]", 0, "", 50., 1, @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ sgm_const_surface_2curve( "#", "Curve 1:5 ", "Curve 6:10", @ sv_ids_of_created_entities )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0,"Surface 1:5", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems )dump i_return_value#---------------------------------------------------------------------# Create Material and Element propertiesi_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_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","Density"],@ [2, 5, 16, 0], "Property Values", ["10E6", "0.11", "0.1", ""])dump i_return_valuei_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_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","Density"],@ [2, 5, 16, 0], "Property Values", ["20E6", "0.22", "0.2", ""])dump i_return_valuei_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_3", 0, "", "Isotropic", 1, "Directionality", 1, @ "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs",["Elastic Modulus","Poisson Ratio","Density"],@ [2, 5, 16, 0], "Property Values", ["30E6", "0.33", "0.3", ""])dump i_return_valuei_return_value = @ elementprops_create( "EP_1", 51, 25, 35, 1, 1, 20, [13, 20, @ 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_1", @ "", "0.1", "", "", "", ""], "Surface 1" )dump i_return_valuei_return_value = @ elementprops_create( "EP_2", 51, 25, 35, 1, 1, 20, [13, 20, @ 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_2", @ "", "0.2", "", "", "", ""], "Surface 2 3" )dump i_return_valuei_return_value = @ elementprops_create( "EP_3", 51, 25, 35, 1, 1, 20, [13, 20, @ 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_3", @ "", "0.3", "", "", "", ""], "Surface 4 5" )dump i_return_value#---------------------------------------------------------------------# Get the list of elements whose poisson-ratio lie within a# range of 0.05 to 0.25s_input_list = "Surface 2:5 Element 5:25"s_mat_prop_name = "Poisson Ratio"r_minimum = 0.05r_maximum = 0.25r_eval_at_temperature = 0.0r_evaluation_strain = 0.0r_evaluation_rate = 0.0r_evaluation_time = 0.0r_evaluation_frequency = 0.0i_return_value = @ list_filter_by_mat_value @ ( s_input_list, @ s_mat_prop_name, @ r_minimum, @ r_maximum, @ r_eval_at_temperature, @ r_evaluation_strain, @ r_evaluation_rate, @ r_evaluation_time, @ r_evaluation_frequency, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string( sv_return_list)sys_free_string( sv_ids_of_created_entities)sys_free_string( sv_created_nodes)sys_free_string( sv_created_elems)#--------------------------------------------------------------------- () |
## Purpose : This file provides an example of 2 calls to the# function list_filter_by_presence()## In this example a input list and a reference# list is defined. This function is called once# to get the entities that are exactly# referenced in both list and second time to# get the entities from input_list which are# parents of entities mentioned in # reference_list.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_filter_by_presence()# has the following arguments:## list_filter_by_presence# ( input_list,# acceptance_criteria,# reference_list,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list[128]STRING s_acceptance_criteria[7]STRING s_reference_list[128]STRING sv_return_list[VIRTUAL]INTEGER i_return_value#---------------------------------------------------------------------s_input_list = "Solid 1.1 1.1.4 1.6 Elm 1 1.1 2.2.2"s_acceptance_criteria = "exact"s_reference_list = "Solid 1.1 1.1.5 1.6.1 Elm 1 1.2 2.2.2 2.2.5"i_return_value = @ list_filter_by_presence @ ( s_input_list, @ s_acceptance_criteria, @ s_reference_list, @ sv_return_list )dump i_return_valuedump sv_return_lists_input_list = "Solid 1.1 1.1.4 1.6 Elm 1 1.1 2.2 3.3"s_acceptance_criteria = "parent"s_reference_list = "Solid 1.1.5 1.6.1 Elm 1.2 2.2 2.3.5 3.3.2"i_return_value = @ list_filter_by_presence @ ( s_input_list, @ s_acceptance_criteria, @ s_reference_list, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string(sv_return_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function list_intersect()## In this example 2 input lists are defined and# this function is called to get entities which# are exactly referenced in both list.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_intersect()# has the following arguments:## list_intersect# ( input_list_1,# input_list_2,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list_1[128]STRING s_input_list_2[128]STRING sv_return_list[VIRTUAL]INTEGER i_return_value#---------------------------------------------------------------------s_input_list_1 = "Solid 1.1 1.1.4 1.6 Elm 1 1.1 2.2.2 3.4.5.6"s_input_list_2 = "Solid 1.1 1.1.5 1.6.1 Elm 1 1.2 2.2.2 2.2.5 3.4.5.6"i_return_value = @ list_intersect @ ( s_input_list_1, @ s_input_list_2, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string(sv_return_list)#--------------------------------------------------------------------- () |
## Purpose : This file provides an example of a call to the# function list_rem_duplicate()## In this example a list with duplication of# entities is defined. Then this function is# called to get the list without any# duplication of entities.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_rem_duplicate()# has the following arguments:## list_rem_duplicate# ( input_list,# return_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_input_list[128]STRING sv_return_list[VIRTUAL]INTEGER i_return_value#---------------------------------------------------------------------# Remove duplication from input lists_input_list = "Solid 1 1.1 2.2 1.1 Elm 2.1 3.3 Solid 2.2 Elm 3.3"i_return_value = @ list_rem_duplicate @ ( s_input_list, @ sv_return_list )dump i_return_valuedump sv_return_listsys_free_string(sv_return_list)#--------------------------------------------------------------------- () |
## Purpose : This file provides an example of a call to the# function list_save_group()## This function adds a list of entities stored# in a global string variable into a group.## In this example, the spool database is opened# and group "default_group" is posted. The global# string variable "lista" is assigned a value.# Then this function is called to save the# entities mentioned in the string to# "default_group" and posted to default viewport.# The list of members present in "default_group"# is verified before and after the addition of# entities.## Before running this session file run spool.ses# to create spool.db## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function list_save_group()# has the following arguments:## list_save_group# ( target_list,# group_name,# update )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_target_list[6]STRING s_group_name[32]LOGICAL l_updateINTEGER i_return_valueSTRING sv_members[VIRTUAL]#---------------------------------------------------------------------# Open the database "spool.db"uil_file_open.go("spool.db")# Post the "default_group"uil_viewport_post_groups.posted_groups @ ( "default_viewport", @ 1, ["default_group"] )#---------------------------------------------------------------------# Assign value to "lista"i_return_value = @ list_create_target_list @ ( "lista", "Element 1:192 " )dump i_return_value#---------------------------------------------------------------------# Get the list of all members of groupi_return_value = @ uil_group_members_get @ ( "default_group", @ sv_members )dump i_return_valuedump sv_members#---------------------------------------------------------------------# Add the list of entities in "lista" to "default_group"s_target_list = "lista"s_group_name = "default_group"l_update = FALSEi_return_value = @ list_save_group @ ( s_target_list, @ s_group_name, @ l_update )#---------------------------------------------------------------------# Get the list of all members of groupi_return_value = @ uil_group_members_get @ ( "default_group", @ sv_members )dump i_return_valuedump sv_members#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_members)# The newly added entities to "default_group" appear on the display# immediately after addition.#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function uil_list_a.previous()## This function will swap the contents of the# global string variable "lista" with the# contents of the global string "lista_reset".## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. Then global# variable "lista" is assigned consecutively# twice using the function# list_create_target_list(). Then this function# is called to get the first assignment made to# "lista" and verified in the end.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function uil_list_a.previous() has no arguments.##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_return_valueSTRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", @ sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# First assignment to global variable "lista".i_return_value = @ list_create_target_list @ ( "lista", @ "Curve 1" )dump i_return_value# Second assignment to global variable "lista".i_return_value = @ list_create_target_list @ ( "lista", @ "Point 1" )dump i_return_value#---------------------------------------------------------------------# Value of global string "lista" before swappingdump lista# Set the contents of "lista_reset" to "lista"uil_list_a.previous()# Value of global string "lista" after swappingdump lista#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function uil_list_b.previous()## This function will swap the contents of the# global string variable "listb" with the# contents of the global string "listb_reset".## In this example a new database is opened. Geom-# etry consisting of a single curve and surface# of dimension 2 X 1 is created. Then global# variable "listb" is assigned consecutively# twice using the function# list_create_target_list(). Then this function# is called to get the first assignment made to# "listb" and verified in the end.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function uil_list_b.previous() has no arguments.##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_return_valueSTRING sv_asm_point[VIRTUAL]STRING sv_asm_line[VIRTUAL]STRING sv_sgm_surface[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_grid_xyz @ ( "2","[0 0 1]","Coord 0",sv_asm_point)dump i_return_valuei_return_value = @ asm_const_line_2point @ ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line )dump i_return_valuei_return_value = @ sgm_const_surface_extrude @ ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", @ sv_sgm_surface )dump i_return_value#---------------------------------------------------------------------# First assignment to global variable "listb".i_return_value = @ list_create_target_list @ ( "listb", @ "Curve 1" )dump i_return_value# Second assignment to global variable "listb".i_return_value = @ list_create_target_list @ ( "listb", @ "Point 1" )dump i_return_value#---------------------------------------------------------------------# Value of global string "listb" before swappingdump listb# Set the contents of "listb_reset" to "listb"uil_list_b.previous()# Value of global string "listb" after swappingdump listb#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_asm_point)sys_free_string( sv_asm_line)sys_free_string( sv_sgm_surface)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function uil_list_a.clear()## This function sets the global string# "lista_reset" to the contents of the global# string "lista" and then sets "lista" to a# single space.## In this example a new database is opened and# global string "lista" is assigned a value. Then# this function is called to set "lista_reset" to# "lista" and then set a single space to "lista".# The value of the global string "lista" is# checked before and after the calling of this# function.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function uil_list_a.clear() has no arguments.##---------------------------------------------------------------------# Variable DeclarationINTEGER i_return_value#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Assign value to global string "lista"i_return_value = @ list_create_target_list @ ( "lista", @ "Curve 1" )dump i_return_value# Value of global string "lista" and "lista_reset" before clearingdump listadump lista_reset# Set the contents of "lista" to a single space.uil_list_a.clear()# Value of global string "lista" and "lista_reset" after clearingdump listadump lista_reset() |
## Purpose : This file provides an example of a call to the# function uil_list_b.clear()## This function sets the global string# "listb_reset" to the contents of the global# string "listb" and then sets "listb" to a# single space.## In this example a new database is opened and# global string "listb" is assigned a value. Then# this function is called to set "listb_reset" to# "listb" and then set a single space to "listb".# The value of the global string "listb" is# checked before and after the calling of this# function.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function uil_list_b.clear() has no arguments.##---------------------------------------------------------------------# Variable DeclarationINTEGER i_return_value#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Assign value to global string "listb"i_return_value = @ list_create_target_list @ ( "listb", @ "Curve 1" )dump i_return_value# Value of global string "listb" and "listb_reset" before clearingdump listbdump listb_reset# Set the contents of "listb" to a single space.uil_list_b.clear()# Value of global string "listb" and "listb_reset" after clearingdump listbdump listb_reset#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function uil_list_boolean.create()## This function creates a list of entities by# combining the contents of the global strings# "lista" and "listb" using the type of operation# specified by the input string "boolean" and# placing the results in the global string# "listc".## In this example a new database is opened. Geom-# etry consisting of a cube of dimension 1x1x1# is created. The global variables "lista" and# "listb" are assigned using# list_create_target_list(). Then this function# is called to create a boolean set in global# variable "listc" using "and" operation.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function uil_list_boolean.create()# has the following arguments.## uil_list_boolean.create# ( boolean )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_return_valueSTRING s_boolean[7]STRING sv_hpat_xyz_ids[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_hpat_xyz @ ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_xyz_ids )dump i_return_value#---------------------------------------------------------------------# Assignment to global variable "lista".i_return_value = @ list_create_target_list @ ( "lista", @ "Point 2 4" )dump i_return_value# Assignment to global variable "listb".i_return_value = @ list_create_target_list @ ( "listb", @ "Point 2 3 6 7" )dump i_return_value#---------------------------------------------------------------------# Create a boolen set in "listc"s_boolean = "and"uil_list_boolean.create( s_boolean )# Value of strings "lista","listb"&"listc" after boolean operation.dump listadump listbdump listc#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_hpat_xyz_ids)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function uil_list_a.replace()## This function will set the contents of the# global string variable "lista_reset" to equal# the contents of the global string variable# "lista". It will then set the global string# variable "lista" to equal the contents of the# global string variable "listc"## In this example a new database is opened. Geom-# etry consisting of a cube of dimension 1x1x1# is created. The global variables "lista" and# "listb" are assigned using# list_create_target_list(). Then the function# uil_list_boolean.create() is called to create# a boolean-set in global variable "listc".# Finally this function is called to replace# "lista" by "listc". The value of "lista" is# verified before and after the replacement.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function uil_list_a.replace() has no arguments.##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_return_valueSTRING s_boolean[7]STRING sv_hpat_xyz_ids[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_hpat_xyz @ ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_xyz_ids )dump i_return_value#---------------------------------------------------------------------# Assignment to global variable "lista".i_return_value = @ list_create_target_list @ ( "lista", @ "Point 2 4" )dump i_return_value# Assignment to global variable "listb".i_return_value = @ list_create_target_list @ ( "listb", @ "Point 2 3 6 7" )dump i_return_value#---------------------------------------------------------------------# Create a boolean set in "listc"s_boolean = "b-a"uil_list_boolean.create( s_boolean )# Value of global string "listc" after boolean operationdump listc#---------------------------------------------------------------------# Value of global string "lista" and "lista_reset" before replacementdump listadump lista_reset# Replace contents of "lista" by "listc"uil_list_a.replace()# Value of global string "lista" and "lista_reset" after replacementdump listadump lista_reset#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_hpat_xyz_ids)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function uil_list_a.replace()## This function will set the contents of the# global string variable "listb_reset" to equal# the contents of the global string variable# "listb". It will then set the global string# variable "listb" to equal the contents of the# global string variable "listc"## In this example a new database is opened. Geom-# etry consisting of a cube of dimension 1x1x1# is created. The global variables "lista" and# "listb" are assigned using# list_create_target_list(). Then the function# uil_list_boolean.create() is called to create# a boolean-set in global variable "listc".# Finally this function is called to replace# "listb" by "listc". The value of "lista" is# verified before and after the replacement.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function uil_list_b.replace() has no arguments.##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_return_valueSTRING s_boolean[7]STRING sv_hpat_xyz_ids[VIRTUAL]#---------------------------------------------------------------------# Open a new databaseuil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric entitiesi_return_value = @ asm_const_hpat_xyz @ ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_xyz_ids )dump i_return_value#---------------------------------------------------------------------# Assignment to global variable "lista".i_return_value = @ list_create_target_list @ ( "lista", @ "Point 2 4" )dump i_return_value# Assignment to global variable "listb".i_return_value = @ list_create_target_list @ ( "listb", @ "Point 2 3 6 7" )dump i_return_value#---------------------------------------------------------------------# Create a boolean set in "listc"s_boolean = "b-a"uil_list_boolean.create( s_boolean )# Value of global string "listc" after boolean operationdump listc#---------------------------------------------------------------------# Value of global string "listb" and "listb_reset" before replacementdump listbdump listb_reset# Replace contents of "listb" by "listc"uil_list_b.replace()# Value of global string "listb" and "listb_reset" after replacementdump listbdump listb_reset#---------------------------------------------------------------------# Free allocated memorysys_free_string( sv_hpat_xyz_ids)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function mass_prop_create()## This function calculates mass properties for a# set of specified entities, plots principal axes# of the inertia tensor at the center of gravity# and creates and posts a coordinate frame that# is aligned with the principal axes of the# inertia tensor.## In this example a new database is opened and a# surface is created. It is made into finite# elements and assigned with proper material# properties. Then this function is called to# calculate the mass properties of the geometry# created.# Ignore the warnings generated during the# execution of this example.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function mass_prop_create()# has the following arguments:## mass_prop_create# ( analysis_model_type,# all_or_group,# include,# number_of_groups,# groups,# coordinate_frame,# density,# thickness_or_area,# axisymmetric_frame,# axisymmetric_axis,# other_axis,# plot,# aligned_frame,# mass_properties,# entity_list,# length_entities,# number_of_entities,# reject_list,# length_reject,# number_of_rejects,# segment_id,# aligned_label,# coordinate_label )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_analysis_model_type[15]STRING s_all_or_group[5]STRING s_include[8]INTEGER i_number_of_groupsSTRING sa_groups[32](1) = [""]STRING s_coordinate_frame[32]STRING s_density[22]STRING s_thickness_or_area[22]STRING s_axisymmetric_frame[32]INTEGER i_axisymmetric_axisINTEGER i_other_axisLOGICAL l_plotLOGICAL l_aligned_frameREAL rv_mass_properties(VIRTUAL)STRING sv_entity_list[VIRTUAL]INTEGER i_length_entitiesINTEGER i_number_of_entitiesSTRING sv_reject_list[VIRTUAL]INTEGER i_length_rejectINTEGER i_number_of_rejectsINTEGER i_segment_idINTEGER i_aligned_labelINTEGER i_coordinate_labelINTEGER i_return_valueSTRING sv_patch_xy_ids[VIRTUAL]INTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_nodes_created[VIRTUAL]STRING sv_elems_created[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric and Finite Element entitiesi_return_value = @ asm_const_patch_xyz @ ( "1", "<10 0 1>", "[0 0 0]", "Coord 0",sv_patch_xy_ids)dump i_return_valuei_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_nodes_created, sv_elems_created )dump i_return_value#---------------------------------------------------------------------# Create Material and Element propertiesi_return_value = @ material.create @ ( "Analysis code ID",1,"Analysis type ID", 1, "new_mat", @ 0,"", "Isotropic", 1, "Directionality", 1, "Linearity",@ 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, @ 0, 0], "Active Flag", 1, "Create", 10, "External Flag",@ FALSE,"Property IDs",["Elastic Modulus", @ "Poisson Ratio","Density"],[2, 5, 16,0], "Property"// @ " Values", ["10E6","0.33","0.1", ""] )dump i_return_valuei_return_value = @ elementprops_create @ ( "new_prop", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, @ 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], ["m:new_mat",@ "", "1", "", "", "", ""], "Surface 1" )dump i_return_value#---------------------------------------------------------------------# Calculate the mass propertiess_analysis_model_type = "2D Plane Stress"s_all_or_group = "All"s_include = "Both"s_coordinate_frame = "Coord 0"s_density = "Use Element Properties"s_thickness_or_area = "Use Element Properties"l_plot = TRUEl_aligned_frame = TRUEi_return_value = @ mass_prop_create @ ( s_analysis_model_type, @ s_all_or_group, @ s_include, @ i_number_of_groups, @ sa_groups, @ s_coordinate_frame, @ s_density, @ s_thickness_or_area, @ s_axisymmetric_frame, @ i_axisymmetric_axis, @ i_other_axis, @ l_plot, @ l_aligned_frame, @ rv_mass_properties, @ sv_entity_list, @ i_length_entities, @ i_number_of_entities, @ sv_reject_list, @ i_length_reject, @ i_number_of_rejects, @ i_segment_id, @ i_aligned_label, @ i_coordinate_label )dump i_return_valuedump rv_mass_propertiesdump sv_entity_listdump i_length_entitiesdump i_number_of_entitiesdump sv_reject_listdump i_length_rejectdump i_number_of_rejectsdump i_segment_iddump i_aligned_labeldump i_coordinate_label#---------------------------------------------------------------------# Free allocated memorysys_free_array ( rv_mass_properties)sys_free_string( sv_entity_list)sys_free_string( sv_reject_list)sys_free_string( sv_patch_xy_ids)sys_free_string( sv_nodes_created)sys_free_string( sv_elems_created)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function mass_prop.gen_report()## This function will write a set of mass# properties and an entity list to a report file.## In this example a new database is opened and a# surface is created. It is made into finite# elements and assigned with proper material# properties. Then the function# mass_prop_create() is called to calculate the# mass properties of the geometry and paused for# user to input the file name. Finally this# function is called to write mass properties to# the report file.# Ignore the warnings generated during the# execution of this example.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function mass_prop.gen_report()# has the following arguments:## mass_prop.gen_report# ( file_columns,# mass_properties,# coordinate_label,# entity_list,# number_of_entities,# entity_list_length,# reject_list,# number_of_rejects,# length_reject )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_file_columnsINTEGER i_coordinate_labelSTRING s_entity_list[128]INTEGER i_number_of_entitiesINTEGER i_entity_list_lengthSTRING s_reject_list[128]INTEGER i_number_of_rejectsINTEGER i_length_rejectINTEGER i_return_valueREAL rv_mass_properties(VIRTUAL)STRING sv_entity_list[VIRTUAL]INTEGER i_length_entitiesSTRING sv_reject_list[VIRTUAL]INTEGER i_segment_idINTEGER i_aligned_labelSTRING sv_patch_xy_ids[VIRTUAL]INTEGER i_num_nodesINTEGER i_num_elemsSTRING sv_nodes_created[VIRTUAL]STRING sv_elems_created[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go( "", "new.db" )$? YES 36000002# Set ISO-1 viewingi_return_value = ga_view_aa_set( 23., -34., 0. )dump i_return_value#---------------------------------------------------------------------# Create Geometric and Finite Element entitiesi_return_value = @ asm_const_patch_xyz @ ( "1", "<10 0 1>", "[0 0 0]", "Coord 0",sv_patch_xy_ids)dump i_return_valuei_return_value = @ mesh_seed_create @ ( "Surface 1.1 1.3 ", 1, 10, 0., 0., 0. )dump i_return_valuei_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_nodes_created, sv_elems_created )dump i_return_value#---------------------------------------------------------------------# Create Material and Element propertiesi_return_value = @ material.create @ ( "Analysis code ID",1,"Analysis type ID", 1, "new_mat", @ 0,"", "Isotropic", 1, "Directionality", 1, "Linearity",@ 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, @ 0, 0], "Active Flag", 1, "Create", 10, "External Flag",@ FALSE,"Property IDs",["Elastic Modulus", @ "Poisson Ratio","Density"],[2, 5, 16,0], "Property"// @ " Values", ["10E6","0.33","0.1", ""] )dump i_return_valuei_return_value = @ elementprops_create @ ( "new_prop", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, @ 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], ["m:new_mat",@ "", "1", "", "", "", ""], "Surface 1" )dump i_return_value#---------------------------------------------------------------------# Calculate the mass propertiesi_return_value = @ mass_prop_create @ ( "2D Plane Stress", "All", "Both", 1, [""], "Coord 0", @ "Use Element Properties", "Unity", "",1, 0, TRUE, TRUE,@ rv_mass_properties, sv_entity_list,i_length_entities, @ i_number_of_entities,sv_reject_list,i_length_reject, @ i_number_of_rejects, i_segment_id, i_aligned_label, @ i_coordinate_label )dump i_return_value#---------------------------------------------------------------------# Follow the given instruction## 1. Pick "File" from the menu bar# 2. Select "Report"# 3. Input the name of the report file,# 4. Press "Apply" and "Cancel"## Pick "Resume" for session file play##---------------------------------------------------------------------# Session file paused. Press "Resume" to continue..sf_pause()#---------------------------------------------------------------------# Write mass properties and entity list to a report filei_file_columns = 80s_entity_list = sv_entity_listi_entity_list_length = i_length_entitiess_reject_list = sv_reject_listi_return_value = @ mass_prop.gen_report @ ( i_file_columns, @ rv_mass_properties, @ i_coordinate_label, @ s_entity_list, @ i_number_of_entities, @ i_entity_list_length, @ s_reject_list, @ i_number_of_rejects, @ i_length_reject )dump i_return_value#---------------------------------------------------------------------# Free allocated memorysys_free_array ( rv_mass_properties)sys_free_string( sv_entity_list)sys_free_string( sv_reject_list)sys_free_string( sv_patch_xy_ids)sys_free_string( sv_nodes_created)sys_free_string( sv_elems_created)# It can be observed that a new report file with the user given name# created in the current directory. This file contains the mass# properties and entity details.#---------------------------------------------------------------------