This is an example of a session file that will create a fem model, make 4 groups and assign colors to them.

uil_file_new.go( "C:\Program Files\MSC.Software\Patran_x64\2020/template.db",  @
"C:\project\wordpress\ex260\ex260.db" )
set_current_dir( "C:\project\wordpress\ex260" )
STRING asm_create_grid_xyz_created_ids[VIRTUAL]
asm_const_grid_xyz( "1", "[0 0 0]", "Coord 0", asm_create_grid_xyz_created_ids )
$# 1 Point created: Point 1
asm_const_grid_xyz( "2", "[10 0 0]", "Coord 0",  @
asm_create_grid_xyz_created_ids )
$# 1 Point created: Point 2
asm_const_grid_xyz( "3", "[10 10 0]", "Coord 0",  @
asm_create_grid_xyz_created_ids )
$# 1 Point created: Point 3
asm_const_grid_xyz( "4", "[0 10 0]", "Coord 0",  @
asm_create_grid_xyz_created_ids )
$# 1 Point created: Point 4
STRING asm_line_2point_created_ids[VIRTUAL]
asm_const_line_2point( "1", "Point 1", "Point 2", 0, "", 50., 1,  @
asm_line_2point_created_ids )
$# 1 Line created: Line 1
asm_const_line_2point( "2", "Point 2", "Point 3", 0, "", 50., 1,  @
asm_line_2point_created_ids )
$# 1 Line created: Line 2
asm_const_line_2point( "3", "Point 3", "Point 4", 0, "", 50., 1,  @
asm_line_2point_created_ids )
$# 1 Line created: Line 3
asm_const_line_2point( "4", "Point 4", "Point 1", 0, "", 50., 1,  @
asm_line_2point_created_ids )
$# 1 Line created: Line 4
STRING sgm_surface_2curve_created_ids[VIRTUAL]
sgm_const_surface_2curve( "1", "Curve 1", "Curve 3",  @
sgm_surface_2curve_created_ids )
$# 1 Surface Created: Surface 1
uil_toolbar.shaded_smooth(  )
ui_exec_function( "mesh_seed_display_mgr", "init" )
INTEGER fem_create_mesh_surfa_num_nodes
INTEGER fem_create_mesh_surfa_num_elems
STRING fem_create_mesh_s_nodes_created[VIRTUAL]
STRING fem_create_mesh_s_elems_created[VIRTUAL]
fem_create_mesh_surf_4( "IsoMesh", 49152, "Surface 1", 1, ["1"], "Quad4", "#", @
 "#", "Coord 0", "Coord 0", fem_create_mesh_surfa_num_nodes,  @
fem_create_mesh_surfa_num_elems, fem_create_mesh_s_nodes_created,  @
fem_create_mesh_s_elems_created )
STRING g1[25],g2[25],g3[25],g4[25]
STRING e1[36],e2[36],e3[36],e4[36]
STRING created_ids_list[VIRTUAL]
sys_poll_option( 2 )
g1 = "Group 1"
e1 = "Elm 1:5 11:15 21:25 31:35 41:45"
ga_group_create(g1)
ga_group_current_set(g1)
uil_list_a.clear( )
list_create_target_list( "lista", e1 )
list_create_node_ass_elem( e1, "lista", created_ids_list )
list_save_group( "lista", g1, FALSE )
ga_group_color_set(g1,1)
g2 = "Group 2"
e2 = "Elm 6:10 16:20 26:30 36:40 46:50"
ga_group_create(g2)
ga_group_current_set(g2)
uil_list_a.clear( )
list_create_target_list("lista", e2)
list_create_node_ass_elem( e2, "lista", created_ids_list )
list_save_group("lista", g2, FALSE)
ga_group_color_set(g2,2)
g3 = "Group 3"
e3 = "Elm 51:55 61:65 71:75 81:85 91:95"
ga_group_create(g3)
ga_group_current_set(g3)
uil_list_a.clear( )
list_create_target_list("lista", e3)
list_create_node_ass_elem( e3, "lista", created_ids_list )
list_save_group( "lista", g3, FALSE )
ga_group_color_set(g3,5)
g4 = "Group 4"
e4 = "Elm 56:60 66:70 76:80 86:90 96:100"
ga_group_create(g4)
ga_group_current_set(g4)
uil_list_a.clear( )
list_create_target_list("lista", e4)
list_create_node_ass_elem(e4, "lista", created_ids_list)
list_save_group("lista", g4, FALSE)
ga_group_color_set(g4,7)
uil_list_a.clear( )
coloring_method( 2 )
sys_poll_option( 0 )
uil_toolbar.shaded_smooth()
uil_toolbar.wireframe(  )
node_size( 15 )
uil_imaging_bw_reverse(  )
ui_repaint_tree( TRUE )
uil_imaging_bw_reverse(  )
ga_view_aa_set( 0., 0., 0. )
uil_viewport_post_groups.posted_groups( "default_viewport", 4, ["Group 1", "Group 2", "Group 3", "Group 4"] )
uil_primary_file.db_save( )