() |
#
## Purpose : This file provides an example of a call to the
# function fem_show_element_cs_plot.plot_elem_cs()
#
# This session file will create a new database by
# name 'new.db' and call the above mentioned
# function and create one hex elements and plot the
# coordinate frame axis at the hex elements centroid.
#
# 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.
#
# Note: Do not forget to call gm_segment_delete() to remove the element
# coordinate system
#
# The function fem_show_element_cs_plot.plot_elem_cs()
# has the following arguments:
#
# fem_show_element_cs_plot.plot_elem_cs
# ( segment_id, @
# entity_list, @
# display_vector_int, @
# display_label_int, @
# display_color, @
# cs_def_type, @
# cs_origin_display_loc, @
# use_offset_1d_elem )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_shape[32]
STRING s_element_type[32]
STRING s_element_select[32]
STRING s_connection_pattern[32]
INTEGER i_flag
STRING s_corner1_node_select[32]
STRING s_corner2_node_select[32]
STRING s_corner3_node_select[32]
STRING s_corner4_node_select[32]
STRING s_corner5_node_select[32]
STRING s_corner6_node_select[32]
STRING s_corner7_node_select[32]
STRING s_corner8_node_select[32]
STRING s_fem_elements_created[260]
STRING sv_fem_nodes_created[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Create 2 nodes without associating with any geometry
i_return_value = fem_create_nodes_1( "Coord 0"@
, "Coord 0"@
, 2@
, "#"@
, "[0 0 0][0 1 0][1 0 0][0.5 1 0]"// @
"[1 0 1][0.5 1 1][0 0 1][0 1 1]"@
, sv_fem_nodes_created)
dump i_return_value
#---------------------------------------------------------------------
i_return_value = ga_view_aa_set(23., -34., 0.)
dump i_return_value
node_label( TRUE )
hex_elem_label( TRUE )
#---------------------------------------------------------------------
# Calling function to create 2 HEX27 elements.
s_shape = "Hex"
s_element_type = "Hex8"
s_element_select = "1"
s_connection_pattern = "Standard"
i_flag = TRUE
s_corner1_node_select = "Node 1"
s_corner2_node_select = "Node 3"
s_corner3_node_select = "Node 4"
s_corner4_node_select = "Node 2"
s_corner5_node_select = "Node 7"
s_corner6_node_select = "Node 5"
s_corner7_node_select = "Node 6"
s_corner8_node_select = "Node 8"
#
i_return_value = fem_create_elems_1 ( s_shape, @
s_element_type, @
s_element_select, @
s_connection_pattern, @
i_flag, @
s_corner1_node_select, @
s_corner2_node_select, @
s_corner3_node_select, @
s_corner4_node_select, @
s_corner5_node_select, @
s_corner6_node_select, @
s_corner7_node_select, @
s_corner8_node_select, @
s_fem_elements_created )
dump i_return_value
STRING entity_list[10] = "Elm 1"
INTEGER i
/* Intialize variables to display vector triad at centroid in color 1,2,3 */
INTEGER display_vector_int(3)=1,1,1
INTEGER display_label_int(3)=1,1,1
INTEGER display_color(3)= 1,2,3
INTEGER cs_def_type, cs_origin_display_loc
INTEGER use_offset_1d_elem = 0
INTEGER segment_id
/* Plot the patran coordinate system */
cs_def_type = 1
/* Plot at the element centroid */
cs_origin_display_loc = 1
gm_segment_create( segment_id )
dump segment_id
fem_show_element_cs_plot.plot_elem_cs( @
segment_id, @
entity_list, @
display_vector_int, @
display_label_int, @
display_color, @
cs_def_type, @
cs_origin_display_loc, @
use_offset_1d_elem )
#
# Call gm_segment_delete(segment_id) to remove the plot (usually when you exit the form)
#