MSC - Acumen 2006 Code Examples
MSC - Acumen 2006 Code Examples
MSC.Acumen Toolkit
MSC.Acumen,
Volume
Examples
Code2:
Code Examples MSC.Acumen Tool-
kit, Code Examples
CHAPTER
1
Introduction ■ Introduction, 2
• db_get_p3_version, 2
• is_batch, 2
• user_db_close, 3
• user_db_new, 3
• user_db_open, 4
• user_quit, 5
• user_start, 5
• utl_get_terse_version, 6
• utl_query_version_level, 6
2
Model ■ Introduction, 8
• db_count_client_labels_by_type, 8
• db_count_general_field, 10
• db_create_client_data, 11
• db_delete_client_data, 13
• db_get_all_client_data, 14
• db_get_client_data, 16
• db_get_client_id_by_label, 18
• db_get_client_label_by_id, 19
• db_get_client_labels_by_type, 21
• db_get_db_version, 23
• db_get_general_field, 23
• db_get_general_field_length, 25
• db_get_model_file_suffix, 27
• db_get_next_client_entity_label, 28
3
Files ■ Introduction, 32
• file_is_directory, 32
• get_current_dir, 32
• jou_file_write, 33
• neutral_export2, 33
• nf_write, 34
• nf_write2, 36
• p3_ps_get_xmt, 37
• set_current_dir, 38
Main Index
• sf_write_disable, 39
• ugi_export_iges_v1, 40
• ugi_import_iges_v3, 41
• ui_form_to_frame, 43
• ui_framemaker, 44
• uil_file_open.open_db, 46
• utl_is_locked_file, 47
• utl_lock_file, 48
• utl_unlock_file, 49
4
Graphics ■ Introduction, 52
• clip_plane_ar_calc, 52
• clip_plane_zoom_calc, 53
• db_get_current_viewport_id, 55
• end_vrml_animation, 55
• ga_clip_plane_clip_planes_get, 58
• ga_clip_plane_create, 59
• ga_clip_plane_delete, 60
• ga_clip_plane_direction_get, 61
• ga_clip_plane_direction_set, 62
• ga_clip_plane_icon_get, 63
• ga_clip_plane_icon_set, 64
• ga_clip_plane_location_get, 65
• ga_clip_plane_location_set, 66
• ga_clip_plane_movement_get, 67
• ga_clip_plane_movement_set, 69
• ga_clip_plane_nclip_planes_get, 70
• ga_clip_plane_nposted_get, 71
• ga_clip_plane_post, 72
• ga_clip_plane_posted_get, 73
• ga_clip_plane_unpost, 75
• ga_clip_plane_up_set, 76
• ga_elem_scalar_create, 77
• ga_elem_scalar_single_create, 79
• ga_error, 80
• ga_light_attenuation_get, 81
• ga_light_attenuation_set, 82
• ga_light_color_get, 83
• ga_light_color_set, 84
• ga_light_create, 85
• ga_light_delete, 86
• ga_light_direction_get, 87
• ga_light_direction_set, 89
• ga_light_icon_get, 90
• ga_light_icon_set, 91
• ga_light_intensity_get, 92
• ga_light_intensity_set, 93
• ga_light_lights_get, 94
• ga_light_location_get, 95
• ga_light_location_set, 96
• ga_light_movement_get, 97
• ga_light_movement_set, 98
Main Index
• ga_light_nlights_get, 100
• ga_light_nposted_get, 100
• ga_light_post, 101
• ga_light_posted_get, 102
• ga_light_type_get, 103
• ga_light_type_set, 104
• ga_light_unpost, 105
• ga_lookup_colors_get, 107
• ga_lookup_colors_set, 108
• ga_lookup_create, 110
• ga_lookup_current_get, 111
• ga_lookup_current_set, 112
• ga_lookup_delete, 113
• ga_lookup_ncolors_get, 114
• ga_lookup_ntables_get, 115
• ga_lookup_rename, 116
• ga_lookup_tables_get, 117
• ga_node_deform_create, 118
• ga_range_contour_get, 119
• ga_range_contour_set, 120
• ga_range_create, 122
• ga_range_delete, 124
• ga_range_exist_get, 126
• ga_range_nranges_get, 127
• ga_range_nvalues_get, 127
• ga_range_ranges_get, 128
• ga_range_rename, 129
• ga_range_startend_set, 131
• ga_range_threshold_set, 133
• ga_range_values_get, 135
• ga_range_values_set, 136
• ga_spectrum_colors_get, 138
• ga_spectrum_colors_set, 139
• ga_spectrum_continuous_get, 141
• ga_spectrum_continuous_set, 142
• ga_spectrum_create, 143
• ga_spectrum_current_get, 145
• ga_spectrum_current_set, 145
• ga_spectrum_delete, 147
• ga_spectrum_interpolation_get, 148
• ga_spectrum_interpolation_set, 149
• ga_spectrum_ncolors_get, 151
• ga_spectrum_nspectrums_get, 151
• ga_spectrum_rename, 152
• ga_spectrum_spectrums_get, 153
• ga_title_color_get, 154
• ga_title_color_set, 155
• ga_title_create, 157
• ga_title_delete, 158
• ga_title_font_size_get, 159
• ga_title_font_size_set, 160
• ga_title_list_get, 161
• ga_title_loc_get, 162
• ga_title_loc_set, 163
Main Index
• ga_title_nposted_get, 164
• ga_title_num_get, 165
• ga_title_posted_get, 166
• ga_title_rename, 167
• ga_vector_create, 168
• ga_vector_get, 170
• ga_vector_number_get, 173
• ga_view_normal_get, 175
• gm_conv_device_to_subject, 176
• gm_convert_name, 177
• gm_database_current, 178
• gm_draw_entity, 178
• gm_fit_view, 179
• gm_fullcolor_mode, 180
• gm_graphics_off, 181
• gm_graphics_on, 181
• gm_hilight_clear, 182
• gm_hilight_entity, 183
• gm_hilight_string, 184
• gm_hilight_widget, 185
• gm_lookup_write, 186
• gm_mpeg_pause_recording, 187
• gm_mpeg_resume_recording, 189
• gm_mpeg_start_recording, 191
• gm_mpeg_stop_recording, 193
• gm_viewport_hardware_mode_get, 195
• gm_viewport_hardware_mode_set, 195
• gm_viewport_id_to_name, 196
• gm_viewport_limits_get, 197
• gm_viewport_ncolors_get, 198
• gm_viewport_refresh_off, 198
• gm_viewport_refresh_on, 199
• gm_viewport_refresh_status, 200
• gm_viewport_view_corners, 200
• gm_visibility_all, 202
• gm_visibility_widget, 202
• gm_write_image, 203
• gm_write_vrml, 205
• ga_lookup_create, 207
• ga_lookup_current_set, 208
• ga_lookup_delete, 209
• ga_range_create, 211
• ga_range_delete, 212
• ga_spectrum_colors_set, 214
• ga_spectrum_continuous_set, 216
• ga_spectrum_create, 217
• ga_spectrum_current_set, 218
• ga_spectrum_delete, 220
• ga_spectrum_interpolation_set, 221
• ga_title_create, 223
• ga_title_delete, 224
• start_vrml_animation, 226
• verify_boundaries_display_mgr.erase, 229
• verify_boundaries_display_mgr.initialize, 229
Main Index
• verify_boundaries_display_mgr.plot, 230
5
User Interface ■ Introduction, 234
• app_count_list, 234
• app_count_list, 235
• app_db_err_msg, 237
• app_ids_to_vstring, 238
• app_int_array_to_vstring, 240
• appcode, 241
• asm_u_coord_global_to_local, 241
• asm_u_lp_get_entity_label, 242
• asm_u_lp_get_point, 243
• asm_u_lp_get_vector, 244
• lp_eval_cleanup, 246
• lp_geometry_text, 247
• lp_keyword_text, 248
• msg_format_string, 249
• msg_get_application, 251
• msg_string_more, 252
• msg_to_file, 253
• msg_to_string, 254
• notemessage.text, 256
• ui_add_help, 256
• ui_clear_focus, 258
• ui_exec_command, 259
• ui_form_delete, 259
• ui_form_exists, 260
• ui_form_is_displayed, 262
• ui_form_is_displayed, 263
• ui_get_client, 265
• ui_get_help, 265
• ui_get_server, 267
• ui_graph_create, 267
• ui_graph_create, 268
• ui_is_initialized, 269
• ui_register_help, 269
• ui_sys_command, 271
• ui_sys_return, 272
• ui_text_select, 272
• ui_text_select, 273
• ui_wid_exit, 275
• ui_wid_hide_forms, 275
• ui_wid_restore_widget, 276
• ui_wid_save_widget, 278
• uid_get_border_sizes, 280
• uid_get_font_heights, 281
• uid_get_screen_info, 281
• uid_set_sys_pix, 282
• uil_app_analysis.get_real_name, 283
• uil_pcntcomplete.close, 284
• uil_pcntcomplete.initlz, 284
Main Index
• uil_primary.get_menubar_id, 285
• uil_utils_listbox.append_list, 286
• uil_utils_listbox.create_list, 287
• uil_utils_listbox.delete_item, 288
• uil_utils_listbox.delete_item_list, 290
• uil_utils_listbox.delete_selected, 291
• uil_utils_listbox.get_all, 293
• uil_utils_listbox.get_selected, 294
• uil_utils_listbox.get_unselected, 296
• uil_utils_listbox.select, 297
• uil_utils_listbox.select_all, 299
• uil_utils_listbox.select_list, 300
• uil_utils_listbox.select_none, 301
• user_message, 303
6
Group ■ Introduction, 306
• asm_db_count_asm_in_group, 306
• asm_db_get_grids_in_group, 307
• asm_db_get_hpats_in_group, 308
• asm_db_get_lines_in_group, 309
• asm_db_get_patches_in_group, 311
• count_orphan_elements, 312
• count_orphan_nodes, 313
• db_add_mpc_to_group, 315
• db_count_entities_in_group, 316
• db_count_groups_for_entity, 317
• db_count_groups_using_mpc, 318
• db_count_orphan_curves, 319
• db_count_orphan_curves, 320
• db_count_orphan_mpcs, 322
• db_count_orphan_points, 323
• db_count_orphan_solids, 324
• db_count_orphan_surfaces, 325
• db_get_group_name, 326
• db_get_groups_for_entity, 327
• db_get_groups_using_mpc, 328
• db_get_orphan_curves, 329
• db_get_orphan_mpcs, 330
• db_get_orphan_points, 331
• db_get_orphan_solids, 332
• db_get_orphan_surfaces, 333
• ga_group_color_get, 334
• ga_group_color_set, 335
• ga_group_current_get, 336
• ga_group_deform_get, 337
• ga_group_deform_set, 338
• ga_group_display_get, 339
• ga_group_elem_scalar_get, 341
• ga_group_elem_scalar_set, 342
• ga_group_entities_get, 344
• ga_group_exist_get, 345
Main Index
• ga_group_groups_get, 346
• ga_group_label_get, 347
• ga_group_label_set, 348
• ga_group_load_vector_get, 349
• ga_group_load_vector_set, 351
• ga_group_load_vector_set, 352
• ga_group_load_vector_set, 354
• ga_group_nentities_get, 356
• ga_group_node_deform_set, 357
• ga_group_node_deform_set, 358
• ga_group_precision_get, 360
• ga_group_result_vector_get, 361
• ga_group_result_vector_get, 363
• ga_group_result_vector_set, 365
• ga_group_result_vector_set, 367
• ga_group_selectable_get, 369
• ga_group_selectable_set, 371
• ga_group_style_get, 372
• ga_group_style_set, 373
• ga_group_vector_load_get, 375
• ga_group_vector_load_set, 376
• ga_group_vector_result_get, 377
• ga_group_vector_result_get, 378
• ga_group_vector_result_set, 380
• ga_group_vector_result_set, 381
• ga_groups_load_vector_set, 382
• ga_groups_load_vector_set, 384
• get_orphan_elements, 386
• get_orphan_nodes, 387
• sgm_db_count_iges_in_group, 388
• sgm_db_get_iges_in_group, 389
• sgm_db_get_iges_in_group, 390
• uil_entity_group_members_get, 391
7
Geometry ■ Introduction, 394
• app_db_get_ref_cid, 394
• asm_const_curve_2d_arc2point_v2, 395
• asm_const_curve_2d_arc3point_v1, 396
• asm_const_curve_2d_circle_v1, 397
• asm_const_curve_project_v1, 398
• asm_db_create_grid, 400
• asm_db_get_curve_geo, 401
• asm_db_get_next_cord_label, 402
• asm_db_get_next_grid_label, 403
• asm_db_get_next_hpat_label, 405
• asm_db_get_next_line_label, 406
• asm_db_get_next_patch_label, 406
• asm_u_coord_global_to_local, 407
• asm_u_coord_local_to_global, 408
• curve_arc_to_parm, 409
• curve_parm_to_arc, 410
Main Index
• db_check_coord_frame_exist, 412
• db_count_coordinate_frame, 413
• db_count_curve, 413
• db_count_curves_for_point, 414
• db_count_point, 415
• db_count_solid, 416
• db_count_solids_for_surface, 417
• db_count_surface, 418
• db_count_surfaces_for_edge, 418
• db_get_all_coord_frame_ids, 419
• db_get_all_posted_coord, 421
• db_get_coord_frame_label, 422
• db_get_current_coord, 423
• db_get_curve_coo_and_type, 424
• db_get_curve_id, 425
• db_get_curve_label, 426
• db_get_curves_for_point, 426
• db_get_geom_type, 428
• db_get_max_coord_label, 429
• db_get_max_curve_label, 429
• db_get_max_point_label, 430
• db_get_max_solid_label, 431
• db_get_max_surface_label, 432
• db_get_min_coord_label, 432
• db_get_min_curve_label, 433
• db_get_min_point_label, 434
• db_get_min_solid_label, 435
• db_get_min_surface_label, 435
• db_get_next_coord_frame_ids, 436
• db_get_next_posted_coord, 437
• db_get_point_association_count, 439
• db_get_point_coo_and_type, 440
• db_get_point_id, 441
• db_get_point_label, 441
• db_get_solid_coo_and_type, 442
• db_get_solid_id, 443
• db_get_solid_label, 444
• db_get_solids_for_surface, 445
• db_get_surface_coo_and_type, 446
• db_get_surface_id, 447
• db_get_surface_label, 448
• db_get_surfaces_for_edge, 449
• sgm_associate_nodes_curve, 450
• sgm_const_curve_project_v1, 451
• sgm_construct_solid_brep, 453
• sgm_construct_solid_volume, 454
• sgm_create_curve_on_surface, 456
• sgm_create_surface_composite_c, 458
• sgm_create_surface_comptrim_v1, 460
• sgm_create_surface_from_elems1, 462
• sgm_curve_convert_s_to_u, 464
• sgm_curve_convert_u_to_s, 466
• sgm_curve_evaluate, 468
• sgm_db_get_blob_size, 470
Main Index
• sgm_db_get_company_of_origin, 471
• sgm_db_get_curve, 472
• sgm_db_get_edge_vertex_ids, 473
• sgm_db_get_gen_body_face_ids, 474
• sgm_db_get_gen_body_vertex_ids, 476
• sgm_db_get_gen_face_edge_ids, 477
• sgm_db_get_gen_face_vertex_ids, 478
• sgm_db_get_num_edges_face, 479
• sgm_db_get_num_faces_body, 480
• sgm_db_get_num_loops_face, 481
• sgm_db_get_num_vertices_body, 483
• sgm_db_get_point, 484
• sgm_db_get_solid, 485
• sgm_db_get_surface, 486
• sgm_db_modify_entity_label, 487
• sgm_edit_brep_break_plane_v1, 489
• sgm_edit_brep_break_surface_v1, 490
• sgm_edit_point_equivalence, 491
• sgm_edit_solid_break, 492
• sgm_edit_solid_refit_v1, 494
• sgm_edit_solid_reverse, 495
• sgm_edit_surface_edge_match, 496
• sgm_edit_surface_sew, 500
• sgm_get_arc_center_radius, 503
• sgm_get_close_points, 504
• sgm_get_curve_length, 506
• sgm_get_solid_volume, 507
• sgm_get_surface_area, 508
• sgm_incongruent_geom_display, 509
• sgm_incongruent_geom_exist, 510
• sgm_incongruent_geom_seg_exit, 510
• sgm_nearest_point_on_curve, 512
• sgm_nearest_point_on_curve_aea, 513
• sgm_node_on_curve, 515
• sgm_node_on_point, 516
• sgm_node_on_surface, 518
• sgm_show_angle_between_curves, 519
• sgm_show_surface_normals, 521
• sgm_solid_evaluate, 522
• sgm_surface_evaluate, 524
• sgm_u_calc_mscale_mat, 525
• sgm_verify_solid_brep, 526
• transform_pts, 527
• xy_curve_num_points_get, 528
8
Finite Element ■ Introduction, 532
Model • db_count_elem_topology_codes, 532
• db_count_elem_w_topology, 532
• db_count_elems_for_geo, 533
• db_count_elems_using_node, 534
• db_count_mpcs_using_node, 535
Main Index
• db_count_nodes_for_geometry, 536
• db_count_nodes_in_mpc, 537
• db_count_unref_nodes, 538
• db_count_valid_dofs_f_mpc_type, 539
• db_count_valid_mpc_types, 539
• db_get_all_valid_dof_f_mpc_type, 540
• db_get_all_valid_mpc_type, 541
• db_get_dep_nodes_in_sub_mpc, 542
• db_get_dof_id, 544
• db_get_dof_name, 544
• db_get_elem_config_ntl, 545
• db_get_elem_dimens, 547
• db_get_elem_for_geo_type_and_id, 547
• db_get_elem_nodes, 548
• db_get_elem_shape_for_id, 549
• db_get_elem_top_name, 550
• db_get_elem_topology_codes, 551
• db_get_elem_topos_for_geom, 551
• db_get_elem_verification_parms, 552
• db_get_elems, 553
• db_get_elems_by_lbc, 554
• db_get_elems_using_nodes, 555
• db_get_etop_for_a_code, 556
• db_get_indep_nodes_in_sub_mpc, 557
• db_get_max_elem_id, 558
• db_get_max_node_id, 559
• db_get_mesh_params, 560
• db_get_min_elem_id, 561
• db_get_min_node_id, 561
• db_get_mpc_type_id, 562
• db_get_mpc_type_name, 563
• db_get_next_elem_id, 564
• db_get_next_mpc_id, 564
• db_get_next_node_id, 565
• db_get_next_valid_mpc_type, 566
• db_get_nodal_association, 567
• db_get_node, 568
• db_get_nodes_by_lbc, 568
• db_get_nodes_for_geometry, 569
• db_get_nodes_in_mpc, 570
• db_get_nxt_valid_dof_f_mpc_type, 571
• db_get_unreferenced_node_ids, 573
• db_get_valid_mpc_ids_in_group, 573
• db_update_elem_ids, 574
• db_update_elem_types, 576
• db_validate_mpc, 577
• db_verify_nodes_exist, 578
• fem_create_mesh_sol_3, 579
• fem_get_elem_assoc_groups, 580
• fem_get_elem_ids, 581
• fem_get_mpc_assoc_groups, 582
• fem_get_mpc_assoc_nodes, 583
• fem_get_mpc_ids, 584
• fem_get_node_assoc_groups, 585
Main Index
• fem_get_node_ids, 586
• fem_seed_display_dir_arrows, 587
• fem_u_get_free_edges, 588
• fem_u_get_free_faces, 590
• list_get_node_ass_el_edge, 592
• list_get_node_ass_el_face, 593
• list_get_node_ass_elem, 594
• list_get_node_ass_geo, 595
• list_get_node_ass_group, 597
• list_get_node_ass_mpc, 598
• list_get_node_att_fringe, 600
• list_get_node_att_value, 602
• move_mesh, 603
• move_mesh_1, 605
9
Load Cases ■ Introduction, 608
• db_activate_load_case, 608
• db_delete_load_case, 609
• db_find_load_case_id, 610
• db_get_lc_id_given_job_seq, 611
10
Element ■ Introduction, 616
Properties • bl_create_std_beam_section, 616
• bl_get_std_beam_section_data, 617
• bl_modify_std_beam_section, 619
• blcomputeprincaxespoints, 621
• blgetalpha, 622
• blgetbuttonicon, 623
• blgetcenters, 624
• blgetdimfieldid, 625
• blgetdimvalue, 626
• blgetlabelicon, 628
• blgetlabels, 629
• blgetnumdimension, 629
• blgetnumplotpoints, 630
• blgetnumplotpointsbyid, 631
• blgetnumtypeinfo, 633
• blgetperim, 633
• blgetplotpoints, 634
• blgetplotpointsbyid, 636
• blgetplotpointsbyid2, 638
• blgetprop, 641
• blgetproplabels, 642
• blgettypeinfo, 643
• blmodifybeamdimension, 644
• db_associate_geo_to_region, 645
• db_bulk_get_possible_dof_sets1, 647
• db_bulk_get_possible_dof_sets2, 648
Main Index
• db_bulk_get_possible_form_opts1, 649
• db_bulk_get_possible_form_opts2, 650
• db_bulk_get_possible_geo_opts1, 651
• db_bulk_get_possible_lam_opts1, 652
• db_bulk_get_possible_lam_opts2, 653
• db_bulk_get_possible_matl_dirs, 654
• db_bulk_get_possible_matl_lins, 656
• db_bulk_get_selected_etops_mat, 657
• db_count_elem_type, 659
• db_count_elements_in_region_exp, 660
• db_count_etop_for_a_code, 661
• db_count_geo_in_region, 662
• db_create_analysis_elements, 663
• db_create_anl_elm_summary, 665
• db_create_phys_prop_set_defn, 666
• db_create_selected_etype, 667
• db_delete_analysis_elements, 669
• db_delete_anl_elm_summary, 671
• db_delete_phys_prop_region, 672
• db_get_a_phys_prop_w_nord, 673
• db_get_all_dof_set_names, 675
• db_get_all_elem_defn, 675
• db_get_all_form_opt_code_names, 677
• db_get_all_geo_opt_code_names, 677
• db_get_all_lam_opt_code_names, 678
• db_get_all_pp_ids_and_names, 679
• db_get_allowable_phys_prop, 680
• db_get_analysis_elements, 681
• db_get_anl_elm_summary, 682
• db_get_elements_in_region_exp, 684
• db_get_etop_for_a_code, 685
• db_get_geo_in_region, 686
• db_get_next_dof_set_names, 688
• db_get_next_elem_defn, 689
• db_get_next_form_opt_code_names, 690
• db_get_next_geo_opt_code_names, 690
• db_get_next_lam_opt_code_names, 691
• db_get_next_pp_ids_and_names, 692
• db_get_phys_prop_set_defn, 693
• db_get_region_for_geometry, 694
• db_get_region_ids_and_names, 695
• db_get_selected_prop_set, 696
• db_set_comp_lam, 697
11
Loads and ■ Introduction, 702
Boundary • db_bulk_get_lbc_ds, 702
Conditions • db_bulk_get_lbc_dv, 704
• db_bulk_get_lbc_ss, 706
• db_bulk_get_lbc_sv, 707
• db_count_appl_geo_region, 709
• db_count_lbc, 710
Main Index
• db_count_lbc_appl_region_entity, 711
• db_count_lbc_types, 712
• db_count_load_cases_with_lbc, 712
• db_count_loads_for_element, 714
• db_delete_lbc, 715
• db_delete_lbc_defn, 716
• db_get_all_appl_geo_regions, 717
• db_get_all_appl_reg_defns, 718
• db_get_all_lbc_names, 719
• db_get_all_lbc_names_by_type, 720
• db_get_all_lbc_type_defns, 721
• db_get_all_lbc_type_names, 723
• db_get_all_lbc_var_defns, 723
• db_get_all_lbcs_new, 724
• db_get_lbc_id, 726
• db_get_lbc_name, 727
• db_get_lbc_type_defn, 728
• db_get_lbc_var_defn, 730
• db_get_load_cases_with_lbc, 731
• db_get_loads_for_element, 733
• db_get_next_appl_geo_region, 734
• db_get_next_appl_reg_defn, 735
• db_get_next_lbc_name, 736
• db_get_next_lbc_name_by_type, 737
• db_get_next_lbc_type_defn, 738
• db_get_next_lbc_type_name, 740
• db_get_next_lbc_var_defn, 741
• db_get_next_lbcs_new, 742
• db_get_valid_cat_by_type, 743
• db_get_valid_eldim_by_type_cat, 744
• db_get_valid_lbc_var_ids, 746
• db_modify_load_case, 747
• lbc_create, 749
• lbc_delete, 752
• lbc_eval_fem_by_lc, 754
• lbc_eval_fem_lbc, 754
• lbc_get_sdbx_datatype, 755
• lbc_gm, 756
• lbc_graphics_defn, 757
• lbc_lp_parse_sca, 758
• lbc_lp_parse_vec, 759
• lbc_plot_markers, 760
• lbc_show_plot_scalar, 762
• loadcase_create2, 763
• loadsbcs_get_appl_region_list, 765
• loadsbcs_lp_coord, 766
12
Materials ■ Introduction, 768
• db_bulk_get_possible_cond_opts1, 768
• db_bulk_get_possible_cond_opts2, 769
• db_bulk_get_possible_dof_sets, 770
Main Index
• db_count_materials, 771
• db_count_options, 773
• db_create_mtl_allowable_magics, 774
• db_delete_material, 775
• db_delete_material_property, 776
• db_delete_matl_const_model, 778
• db_get_all_allow_matl_prop_cnt, 779
• db_get_all_allowable_matl_prop, 780
• db_get_all_cond_opt_code_names, 782
• db_get_all_lam_opt_code_names, 782
• db_get_all_material_names, 783
• db_get_allowable_matl_prop, 785
• db_get_allowable_matl_prop_cnt, 786
• db_get_comp_hal, 787
• db_get_comp_sfc, 789
• db_get_constitutive_model, 792
• db_get_material_id_from_name, 793
• db_get_material_name_from_id, 794
• db_get_matl_category, 795
• db_get_matl_prop_alias, 797
• db_get_matl_prop_defn, 798
• db_get_mtl_allowable_magic_cnt, 800
• db_get_mtl_allowable_magics, 801
• db_get_mtl_magics, 802
• db_get_mtl_magics_count, 804
• db_get_mtl_magics_defn, 805
• db_get_mtl_magics_options, 806
• db_get_next_cond_opt_code_names, 808
• db_get_next_lam_opt_code_names, 808
• db_get_next_material_name, 809
• db_get_valid_const_models, 811
• db_get_valid_const_models_count, 812
• db_get_valid_mtl_categories, 813
• db_get_valid_mtl_category_cnt, 814
• db_mo_const_models_specified, 815
• db_modify_material, 817
• db_modify_matl_prop_value, 819
• engin_cons_to_elastic_matrix, 820
• get_qab_from_engin_cons, 821
• mat_2d_ani_to_2d_ort, 822
• mat_3d_ani_to_3d_ort, 823
• mat_hal_load_defn_show, 824
• mat_lam_load_defn_show, 826
• mat_load_show, 828
• mat_mix_load_defn_show, 830
• mat_sfc_load_defn_show, 832
• material.namedelete, 834
• n21_cons_to_sym_6x6_matrix, 836
• p3cm.close_2, 837
• p3cm.create_book_layup2, 838
• P3cm.create_laminates_layup_2, 841
• p3cm.create_layup_add_2, 844
• p3cm.create_material_add, 846
• p3cm.create_ply_add_2, 848
Main Index
• p3cm.create_results_failure, 850
• p3cm.create_results_mid_sort, 852
• p3cm.create_results_sort, 853
• p3cm.delete_laminates, 855
• p3cm.delete_material_name, 856
• p3cm.delete_ply_name, 858
• p3cm.delete_propsets, 859
• p3cm.import_model_file_2, 861
• p3cm.import_plies_file_2, 862
• p3cm.modify_material, 864
• p3cm.modify_ply, 865
• p3cm.new, 868
• p3cm.set_offsets, 869
• p3cm.open, 870
• p3cm.save_as_2, 871
• p3cm.set_export_options_2, 873
• p3cm.set_graphics_options_2, 874
• p3cm.set_tolerance, 876
• p3cm.show_laminate, 877
• p3cm.show_layup_exploded, 880
• p3cm.show_ply, 881
13
Analysis ■ Introduction, 884
• analysis_get.pset_for_job, 884
• analysis_import, 885
• analysis_main.job_name_lbox, 889
• analysis_main.user_function, 890
• analysis_submit, 892
• analysis_submit_2, 896
• db_assign_last_jobname, 900
• db_count_all_job_name_ids, 901
• db_count_anal_codes, 902
• db_count_anal_types, 902
• db_count_analysis_steps, 903
• db_count_job_name_list_entry, 904
• db_count_job_names_for_a_code, 905
• db_count_param_set_entries, 906
• db_count_steps_for_a_job, 907
• db_create_analysis_step, 908
• db_create_job_name, 910
• db_create_job_name_for_a_code, 911
• db_create_job_name_list, 912
• db_create_job_name_list_entry, 913
• db_create_param_set_entry, 915
• db_create_pset_matrix_entry, 917
• db_delete_analysis_step_id, 919
• db_delete_job_name, 921
• db_delete_job_name_list, 922
• db_delete_param_set_entries, 924
• db_delete_param_set_entry, 926
• db_get_all_anal_codes, 928
Main Index
• db_get_all_anal_types, 929
• db_get_all_job_name_ids, 930
• db_get_all_job_names, 931
• db_get_anal_code_id, 931
• db_get_anal_code_name, 932
• db_get_anal_type_id, 933
• db_get_anal_type_name, 934
• db_get_analysis_steps, 935
• db_get_at_for_ac, 936
• db_get_default_anal_code, 936
• db_get_default_anal_type, 937
• db_get_id_given_job_name, 937
• db_get_id_given_job_name_code, 939
• db_get_id_given_load_case_name, 940
• db_get_id_given_step_name, 941
• db_get_job_info, 943
• db_get_job_name_given_id, 944
• db_get_jobname_list_entries, 945
• db_get_jobnames_for_a_code, 947
• db_get_last_jobname, 948
• db_get_next_anal_code, 949
• db_get_next_anal_type, 950
• db_get_next_job_name, 951
• db_get_param_set_ent_pcl, 952
• db_get_param_set_entries, 953
• db_get_param_set_entry, 955
• db_get_pset_matrix_entry, 957
• db_get_pset_matrix_size, 959
• db_get_step_info, 960
• db_get_steps_for_a_job, 962
• db_set_at_for_ac, 963
• db_set_default_anal_code, 964
• db_set_default_anal_type, 965
• db_set_model_file_suffix, 966
• db_set_pref, 967
• db_set_results_file_suffix, 968
• db_update_analysis_step, 969
• db_update_jobname_for_a_code, 971
• jobfile.close, 973
• jobfile.create_matrix, 974
• jobfile.open, 976
• jobfile.set_job_status, 977
• jobfile.writec, 978
• jobfile.writei, 979
• jobfile.writer, 980
• jobfile.write_spl, 981
• msc_delete_old_files, 982
• mscnastran_anlyze_sub_create.available_callback, 983
• mscnastran_analyze_tp.get_version_number, 984
• mscnastran_job.associate_subcases, 985
• mscnastran_subcase.create, 987
• mscnastran_subcase.create_char_param, 988
• mscnastran_update.job, 989
• uil_app_analysis.change_current_branch, 990
Main Index
14
Fields ■ Introduction, 994
• db_delete_field, 994
• db_delete_field_res, 995
• db_get_all_field_names, 996
• db_get_field_attrs, 997
• db_get_field_dfem, 998
• db_get_field_id, 1000
• db_get_field_lbc, 1000
• db_get_field_lbc_type, 1002
• db_get_max_field_id, 1003
• db_get_next_field_name, 1004
• db_modify_field, 1006
• field_create_field_lbc, 1009
• fields_create_general_term, 1011
• field_fem_const_eval, 1012
• fld_cre_fem_res_sca, 1014
• fld_cre_fem_res_vec, 1015
• fld_evl_get_maxnod_for_group, 1016
• get_field_values, 1017
• get_field_values_no_trans, 1018
15
Results ■ Introduction, 1022
• db_count_result_types_for_elem, 1022
• db_get_elem_scalar_name, 1023
• db_get_results_file_suffix, 1025
• jobfile.create_jobname, 1026
• jobfile.create_param, 1026
• jobfile.eval_list, 1028
• jobfile.write_array_as_list, 1029
• jobfile.write_element_list, 1030
• jobfile.write_integer_list, 1031
• jobfile.write_node_list, 1033
• jobfile.write_real_list, 1034
• jobfile.write_stream, 1035
• jobfile.write_string, 1036
• jobfile.writer, 1037
• jobfile.writeS1, 1038
• jobfile.writeS2, 1039
• jobfile.writeS3, 1040
• jobfile.writeS4, 1041
• jobfile.writeSS, 1042
• rdm_result_minmax_get, 1043
• res_db_cgetlayerposids, 1045
• res_db_cgetrescases, 1046
• res_utl_create_elem_result, 1048
• res_utl_extract_elem_history2, 1051
• res_utl_extract_elem_results2, 1054
• res_utl_extract_nodal_history2, 1056
• res_utl_extract_nodal_results2, 1059
Main Index
• res_utl_transform_nodal_results, 1062
• vki_db_getresid, 1064
• xy_curve_results_set_wnd, 1066
16
Preferences ■ Introduction, 1070
• db_add_pref, 1070
• db_get_pref, 1071
• pref_anal_get, 1073
• pref_anal_set, 1074
• pref_confirm_get, 1075
• pref_display_method_get, 1076
• pref_entity_dp_get, 1077
• pref_entity_dp_set, 1078
• pref_entity_set, 1079
• pref_env_get_integer, 1081
• pref_env_get_logical, 1082
• pref_env_get_real, 1083
• pref_env_get_string, 1084
• pref_fa_get, 1084
• pref_fa_set, 1086
• pref_geo_cid_int_string, 1087
• pref_geo_cid_string_int, 1088
• pref_geo_get, 1089
• pref_get_anal_attributes, 1090
• pref_get_anal_code_count, 1090
• pref_get_anal_type_count, 1091
• pref_get_next_anal_code, 1092
• pref_get_next_anal_type, 1093
• pref_global_get, 1094
• pref_graphics_get, 1094
• pref_graphics_marker_data_get, 1096
17
Utilities ■ Introduction, 1100
• array_copy_real, 1100
• array_del_zero_int, 1101
• array_fill_int, 1101
• array_fill_zero_int, 1102
• array_fill_zero_real, 1103
• array_real_fill_null, 1104
• array_sort_and_del_dupl_int, 1104
• ga_entities_string_format, 1105
• ga_entity_get_by_type, 1106
• math_get_no_data_null, 1108
• math_is_no_data_null, 1108
• math_mat_add, 1109
• math_mat_invert, 1110
• math_mat_mult, 1111
• math_mat_transp_in_place, 1112
Main Index
• math_vec_len, 1112
• math_vec_norm, 1113
• mth_vec_add, 1114
• mth_vec_cross_prod, 1115
• mth_vec_dot_prod, 1115
• mth_vec_length, 1116
• mth_vec_scale, 1117
• rpc_add_server, 1118
• rpc_call, 1119
• rpc_clear_output, 1121
• rpc_get_bool_array, 1123
• rpc_get_boolean, 1125
• rpc_get_command, 1127
• rpc_get_int_array, 1128
• rpc_get_integer, 1130
• rpc_get_real, 1132
• rpc_get_real_array, 1134
• rpc_get_status, 1135
• rpc_get_string, 1137
• rpc_init_client, 1139
• rpc_inquire_count, 1140
• rpc_inquire_item, 1142
• rpc_put_bool_array, 1144
• rpc_put_boolean, 1146
• rpc_put_command, 1148
• rpc_put_int_array, 1150
• rpc_put_integer, 1151
• rpc_put_real, 1153
• rpc_put_real_array, 1155
• rpc_put_status, 1157
• rpc_put_string, 1158
• rpc_timeout, 1160
• string_newline_count, 1161
• string_newline_position, 1162
• timer_off, 1163
• timer_on, 1164
• uil_list_union_expr, 1164
• util_equal_real, 1165
• util_real_equal_null, 1167
• util_rounder, 1167
18
Support Files ■ Introduction, 1170
Main Index
Main Index
MSC.Acumen, Volume 2: Code Examples
CHAPTER
Introduction
1
■ Introduction
Main Index
2
Code Examples
1.1 Introduction
This chapter provides code examples for the PCL function described in Volume 1. These
examples are designed so that they can be cut and pasted into a file and, by following the
instructions listed with each example, executed in MSC.Patran.
db_get_p3_version ()
# -------------------------------------------------------------------
i_return_value= @
db_get_p3_version @
( s_p3_ver)
dump s_p3_ver
dump i_return_value
# -------------------------------------------------------------------
is_batch ()
# -------------------------------------------------------------------
# Variable Declaration
#
LOGICAL l_status
# -------------------------------------------------------------------
l_status=is_batch()
dump l_status
# -------------------------------------------------------------------
user_db_close ()
user_db_new ()
user_db_open ()
Main Index
CHAPTER 1 5
Introduction
user_quit ()
user_start ()
Main Index
6
Code Examples
utl_get_terse_version ()
# -------------------------------------------------------------------
utl_get_terse_version @
( s_terse_version)
dump s_terse_version
# -------------------------------------------------------------------
utl_query_version_level ()
# -------------------------------------------------------------------
i_return_value = @
utl_query_version_level()
dump i_return_value
# -------------------------------------------------------------------
Main Index
MSC.Acumen, Volume 2: Code Exampleskl
CHAPTER
Model
2
■ Introduction
Main Index
610
Code Examples
2.1 Introduction
This chapter provides code examples for the PCL function described in Volume 1. These
examples are designed so that they can be cut and pasted into a file and, by following the
instructions listed with each example, executed in MSC.Patran.
db_count_client_labels_by_type ()
i_return_value = @
db_create_client_data @
Main Index ( i_id, @
CHAPTER 2 611
Model
i_client_label, @
i_client_type, @
i_num_logicals, @
i_num_integers, @
i_num_reals, @
i_num_strings, @
i_max_string_length, @
l_logical_data, @
i_integer_data, @
r_real_data, @
s_string_data )
i_return_value = @
db_count_client_labels_by_type @
( i_client_type, @
i_nbr_of_labels )
dump i_nbr_of_labels
dump i_return_value
# i_client_label = 102
i_client_label = 102
i_return_value = @
db_create_client_data @
( i_id, @
i_client_label, @
i_client_type, @
i_num_logicals, @
i_num_integers, @
i_num_reals, @
i_num_strings, @
i_max_string_length, @
l_logical_data, @
i_integer_data, @
r_real_data, @
s_string_data )
i_return_value = @
db_count_client_labels_by_type @
( i_client_type, @
i_nbr_of_labels )
Main Index
612
Code Examples
db_count_general_field ()
INTEGER fem_create_mesh_surfa_num_nodes
INTEGER fem_create_mesh_surfa_num_elems
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING fem_create_mesh_s_nodes_created[VIRTUAL]
STRING fem_create_mesh_s_elems_created[VIRTUAL]
#----------------------------------------------------------------------
# Open a new database
if(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
endif
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#---------------------------------------------------------------------
# Create Geometric entities
int_status = asm_const_patch_xyz @
( "1", "<2 5 0>", "[0 0 0]", "Coord 0", @
asm_create_patch_xy_created_ids )
dump int_status
#---------------------------------------------------------------------
# Create Finite Element entities
# 219 Nodes IDS = 1:219
# 60 Elements IDS = 1:60
int_status = fem_create_mesh_surf_3 @
( "IsoMesh", 0, "Surface 1 ", 1, @
["0.1"], "Quad8", "1", @
"1", "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 )
dump int_status
mesh_seed_display_mgr.erase( )
#---------------------------------------------------------------------
# Create a Field - 'field_1'
int_status = fields_create_general @
( "field_1", @
0, 5, 2, "Real", "Coord 0", @
"", 3, 1, 2, 15 )
dump int_status
int_status = fields_create_general_term @
( "field_1", @
0, 0, 0, 30, @
" [ ( 'X + 'Y ) * 'RAD ]" )
dump int_status
#---------------------------------------------------------------------
# Getting the field_id for the field - 'field_1'
int_status = db_get_field_id(str_field,int_field_id)
#---------------------------------------------------------------------
# Using the function db_count_general_field() to get
# the number of terms_ids or count in the field
int_status = db_count_general_field @
(int_field_id, int_count)
#---------------------------------------------------------------------
# Closing the file - new.db
uil_file_close.goquit()
#---------------------------------------------------------------------
db_create_client_data ()
#
# To run this session file,first start
# a session of MSC.Patran,open a database or
# start a new database,then run this session
# file by “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The db_create_client_data has the following arguments:
# db_create_client_data
# ( id,
# client_label,
# client_type,
# num_logicals,
# num_integers,
# num_reals,
# num_strings,
# max_string_length,
# p_logical_data,
# p_integer_data,
# p_real_data,
# p_string_data )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_id, i_client_label, i_client_type, @
i_num_logicals, i_num_integers, i_num_reals, @
i_num_strings, i_max_string_length
LOGICAL l_logical_data(1)= [TRUE]
INTEGER i_integer_data(1)=[1]
REAL r_real_data(1)=[202.54]
STRING s_string_data[25](1)=[“Geometric”]
INTEGER i_return_value
# -------------------------------------------------------------------
# Create a client defined entity in the database.
#
# i_client_label=101
# i_client_type=1001
# i_num_logicals=1
# i_num_integers=1
# i_num_reals=1
# i_num_strings=1
# i_max_string_length=25
#
i_client_label = 101
i_client_type = 1001
i_num_logicals = 1
i_num_integers = 1
i_num_reals = 1
i_num_strings = 1
i_max_string_length = 25
i_return_value = @
db_create_client_data @
( i_id, @
i_client_label, @
i_client_type, @
i_num_logicals, @
i_num_integers, @
i_num_reals, @
i_num_strings, @
i_max_string_length, @
l_logical_data, @
i_integer_data, @
Main Index
CHAPTER 2 615
Model
r_real_data, @
s_string_data )
dump i_return_value
# -------------------------------------------------------------------
db_delete_client_data ()
# -------------------------------------------------------------------
# Create a client defined entity in the database.
#
# i_client_label=101
# i_client_type=1001
# i_num_logicals=1
# i_num_integers=1
# i_num_reals=1
# i_num_strings=1
# i_max_string_length=25
#
i_client_label = 101
i_client_type = 1001
i_num_logicals = 1
i_num_integers = 1
i_num_reals = 1
i_num_strings = 1
i_max_string_length = 25
i_return_value = @
db_create_client_data @
( i_id, @
Main Index
616
Code Examples
i_client_label, @
i_client_type, @
i_num_logicals, @
i_num_integers, @
i_num_reals, @
i_num_strings, @
i_max_string_length, @
l_logical_data, @
i_integer_data, @
r_real_data, @
s_string_data )
#
dump i_return_value
i_return_value = @
db_delete_client_data @
( i_client_label )
db_get_all_client_data ()
LOGICAL l_c_logical_data(1)
INTEGER i_c_integer_data(1)
REAL r_c_real_data(1)
STRING s_c_string_data[25](1)
INTEGER i_return_value
# -------------------------------------------------------------------
# Create a client defined entity in the database.
#
# i_client_label=101
# i_client_type=1001
# i_num_logicals=1
# i_num_integers=1
# i_num_reals=1
# i_num_strings=1
# i_max_string_length=25
#
i_client_label = 101
i_client_type = 1001
i_num_logicals = 1
i_num_integers = 1
i_num_reals = 1
i_num_strings = 1
i_max_string_length = 25
i_return_value = @
db_create_client_data @
( i_id, @
i_client_label, @
i_client_type, @
i_num_logicals, @
i_num_integers, @
i_num_reals, @
i_num_strings, @
i_max_string_length, @
l_logical_data, @
i_integer_data, @
r_real_data, @
s_string_data )
#
dump i_return_value
i_return_value = @
db_get_all_client_data @
( i_id, @
i_num_logicals, @
i_num_integers, @
i_num_reals, @
i_num_strings, @
i_max_string_length, @
l_c_logical_data, @
i_c_integer_data, @
Main Index
618
Code Examples
r_c_real_data, @
s_c_string_data )
dump l_c_logical_data
dump i_c_integer_data
dump r_c_real_data
dump s_c_string_data
dump i_return_value
# -------------------------------------------------------------------
db_get_client_data ()
INTEGER i_return_value
# -------------------------------------------------------------------
# Create a client defined entity in the database.
Main Index
CHAPTER 2 619
Model
#
# i_client_label=101
# i_client_type=1001
# i_num_logicals=1
# i_num_integers=1
# i_num_reals=1
# i_num_strings=1
# i_max_string_length=25
#
i_client_label = 101
i_client_type = 1001
i_num_logicals = 1
i_num_integers = 1
i_num_reals = 1
i_num_strings = 1
i_max_string_length = 25
i_return_value = @
db_create_client_data @
( i_id, @
i_client_label, @
i_client_type, @
i_num_logicals, @
i_num_integers, @
i_num_reals, @
i_num_strings, @
i_max_string_length, @
l_logical_data, @
i_integer_data, @
r_real_data, @
s_string_data )
#
dump i_return_value
i_return_value = @
db_get_client_data @
( i_client_label, @
i_id, @
i_c_client_type, @
i_c_num_logicals, @
i_c_num_integers, @
i_c_num_reals, @
i_c_num_strings, @
i_c_max_string_length )
dump i_c_client_type
dump i_c_num_logicals
dump i_c_num_integers
dump i_c_num_reals
dump i_c_num_strings
dump i_c_max_string_length
dump i_return_value
# -------------------------------------------------------------------
Main Index
620
Code Examples
db_get_client_id_by_label ()
# -------------------------------------------------------------------
i_client_label = 101
i_client_type = 1001
i_num_logicals = 1
i_num_integers = 1
i_num_reals = 1
i_num_strings = 1
i_max_string_length = 1
i_return_value = @
db_create_client_data @
Main Index
CHAPTER 2 621
Model
( i_id, @
i_client_label, @
i_client_type, @
i_num_logicals, @
i_num_integers, @
i_num_reals, @
i_num_strings, @
i_max_string_length, @
l_logical_data, @
i_integer_data, @
r_real_data, @
s_string_data )
i_return_value = @
db_get_client_id_by_label @
( i_client_label, @
i_c_id )
dump i_c_id
dump i_return_value
# -------------------------------------------------------------------
db_get_client_label_by_id ()
STRING s_string_data[25](1)=[“Geometric”]
# -------------------------------------------------------------------
i_client_label = 101
i_client_type = 1001
i_num_logicals = 1
i_num_integers = 1
i_num_reals = 1
i_num_strings = 1
i_max_string_length = 25
i_return_value = @
db_create_client_data @
( i_id, @
i_client_label, @
i_client_type, @
i_num_logicals, @
i_num_integers, @
i_num_reals, @
i_num_strings, @
i_max_string_length, @
l_logical_data, @
i_integer_data, @
r_real_data, @
s_string_data )
i_return_value = @
db_get_client_label_by_id @
( i_id, @
i_c_client_label )
dump i_c_client_label
dump i_return_value
# -------------------------------------------------------------------
Main Index
CHAPTER 2 623
Model
db_get_client_labels_by_type ()
# -------------------------------------------------------------------
i_client_label = 101
i_client_type = 1001
i_num_logicals = 1
i_num_integers = 1
i_num_reals = 1
i_num_strings = 1
i_max_string_length = 25
i_return_value = @
db_create_client_data @
( i_id, @
i_client_label, @
i_client_type, @
i_num_logicals, @
i_num_integers, @
Main Index
624
Code Examples
i_num_reals, @
i_num_strings, @
i_max_string_length, @
l_logical_data, @
i_integer_data, @
r_real_data, @
s_string_data )
i_return_value = @
db_get_client_labels_by_type @
( i_client_type, @
i_labels )
dump i_labels
dump i_return_value
# i_client_label = 102
i_client_label = 102
i_return_value = @
db_create_client_data @
( i_id, @
i_client_label, @
i_client_type, @
i_num_logicals, @
i_num_integers, @
i_num_reals, @
i_num_strings, @
i_max_string_length, @
l_logical_data, @
i_integer_data, @
r_real_data, @
s_string_data )
i_return_value = @
db_get_client_labels_by_type @
( i_client_type, @
i_labels )
Main Index
CHAPTER 2 625
Model
db_get_db_version ()
# -------------------------------------------------------------------
i_return_value = @
db_get_db_version @
( s_db_ver )
dump i_return_value
dump s_db_ver
# -------------------------------------------------------------------
db_get_general_field ()
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER fem_create_mesh_surfa_num_nodes
INTEGER fem_create_mesh_surfa_num_elems
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING fem_create_mesh_s_nodes_created[VIRTUAL]
STRING fem_create_mesh_s_elems_created[VIRTUAL]
#----------------------------------------------------------------------
# Open a new database
if(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
endif
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#---------------------------------------------------------------------
# Create Geometric entities
int_status = asm_const_patch_xyz @
( "1", "<2 5 0>", "[0 0 0]", "Coord 0", @
asm_create_patch_xy_created_ids )
dump int_status
#---------------------------------------------------------------------
# Create Finite Element entities
# 219 Nodes IDS = 1:219
# 60 Elements IDS = 1:60
int_status = fem_create_mesh_surf_3 @
( "IsoMesh", 0, "Surface 1 ", 1, @
["0.1"], "Quad8", "1", @
"1", "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 )
dump int_status
mesh_seed_display_mgr.erase( )
#---------------------------------------------------------------------
# Create a Field - 'field_1'
int_status = fields_create_general @
( "field_1", @
0, 5, 2, "Real", "Coord 0", @
"", 3, 1, 2, 15 )
dump int_status
int_status = fields_create_general_term @
( "field_1", @
Main Index
CHAPTER 2 627
Model
0, 0, 0, 30, @
" [ ( 'X + 'Y ) * 'RAD ]" )
dump int_status
#---------------------------------------------------------------------
# Getting the field_id for the field - 'field_1'
int_status = db_get_field_id(str_field,int_field_id)
dump int_status
#---------------------------------------------------------------------
# Getting the int_count for the filed_id = 1
int_status = db_count_general_field @
(int_field_id, int_count)
dump int_status
#---------------------------------------------------------------------
# Getting term_ids and the field_data_lengths from the field_id
# and the count
sys_allocate_array(int_term_id , 1, int_count)
sys_allocate_array(int_field_data_length , 1, int_count)
int_status = db_get_general_field_length @
(int_field_id, @
int_count, @
int_term_id, @
int_field_data_length )
#---------------------------------------------------------------------
# Getting the term_field_ids, term function type and field data
# using the function db_get_general_field().
# This function needs to be executed for each value of int_count
# obtained from function db_count_general_field()
int_status = db_get_general_field( @
int_field_id, @
int_term_id(int_count), @
int_field_data_length(int_count), @
int_term_field_id, @
int_term_function_type, @
str_field_data)
uil_file_close.goquit()
#---------------------------------------------------------------------
# End of File.
db_get_general_field_length ()
INTEGER fem_create_mesh_surfa_num_nodes
INTEGER fem_create_mesh_surfa_num_elems
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING fem_create_mesh_s_nodes_created[VIRTUAL]
STRING fem_create_mesh_s_elems_created[VIRTUAL]
#----------------------------------------------------------------------
# Open a new database
if(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
endif
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#---------------------------------------------------------------------
# Create Geometric entities
int_status = asm_const_patch_xyz @
( "1", "<2 5 0>", "[0 0 0]", "Coord 0", @
asm_create_patch_xy_created_ids )
dump int_status
#---------------------------------------------------------------------
# Create Finite Element entities
# 219 Nodes IDS = 1:219
# 60 Elements IDS = 1:60
int_status = fem_create_mesh_surf_3 @
( "IsoMesh", 0, "Surface 1 ", 1, @
["0.1"], "Quad8", "1", @
"1", "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 )
dump int_status
mesh_seed_display_mgr.erase( )
Main Index
CHAPTER 2 629
Model
#---------------------------------------------------------------------
# Create a Field - 'field_1'
int_status = fields_create_general @
( "field_1", @
0, 5, 2, "Real", "Coord 0", @
"", 3, 1, 2, 15 )
dump int_status
int_status = fields_create_general_term @
( "field_1", @
0, 0, 0, 30, @
" [ ( 'X + 'Y ) * 'RAD ]" )
dump int_status
#---------------------------------------------------------------------
# Getting the field_id for the field - 'field_1'
int_status = db_get_field_id(str_field,int_field_id)
#---------------------------------------------------------------------
#
int_status = db_count_general_field @
(int_field_id, int_count)
#---------------------------------------------------------------------
# Using the function db_get_general_field_length() to get
# term_ids and the field_data_lengths from the field_id
# and the count
sys_allocate_array(int_term_id , 1, int_count)
sys_allocate_array(int_field_data_length , 1, int_count)
int_status = db_get_general_field_length @
(int_field_id, @
int_count, @
int_term_id, @
int_field_data_length )
uil_file_close.goquit()
#---------------------------------------------------------------------
db_get_model_file_suffix ()
# ( name,
# suffix )
#
# -------------------------------------------------------------------
# Variable Declaration
#
STRING s_name[32]=”MSC.Nastran”
STRING s_suffix[8]
INTEGER i_return_value
# -------------------------------------------------------------------
i_return_value = @
db_get_model_file_suffix @
( s_name, @
s_suffix )
dump i_return_value
# check the suffix of model file associated with analysis code
# ‘MSC.Nastran’
dump s_suffix
# -------------------------------------------------------------------
db_get_next_client_entity_label ()
# -------------------------------------------------------------------
# i_client_label=101
# i_client_type=1001
# i_num_logicals=1
# i_num_integers=1
# i_num_reals=1
# i_num_strings=1
# i_max_string_length=25
#
i_client_label = 101
i_client_type = 1001
i_num_logicals = 1
i_num_integers = 1
i_num_reals = 1
i_num_strings = 1
i_max_string_length = 25
i_return_value = @
db_create_client_data @
( i_id, @
i_client_label, @
i_client_type, @
i_num_logicals, @
i_num_integers, @
i_num_reals, @
i_num_strings, @
i_max_string_length, @
l_logical_data, @
i_integer_data, @
r_real_data, @
s_string_data )
i_return_value = @
db_get_next_client_entity_label @
( i_label )
dump i_label
dump i_return_value
# i_client_label = 102
i_client_label = 102
i_return_value = @
db_create_client_data @
( i_id, @
i_client_label, @
i_client_type, @
i_num_logicals, @
i_num_integers, @
i_num_reals, @
i_num_strings, @
i_max_string_length, @
Main Index
632
Code Examples
l_logical_data, @
i_integer_data, @
r_real_data, @
s_string_data )
# -------------------------------------------------------------------
Main Index
MSC.Acumen, Volume 2: Code Examples
CHAPTER
Files
3
■ Introduction
Main Index
634
Code Examples
3.1 Introduction
This chapter provides code examples for the PCL function described in Volume 1. These
examples are designed so that they can be cut and pasted into a file and, by following the
instructions listed with each example, executed in MSC.Patran.
file_is_directory ()
get_current_dir ()
# Variable Declarations
STRING s_dirname[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the current directory
i_return_value = @
get_current_dir @
( s_dirname )
dump i_return_value
dump s_dirname
#---------------------------------------------------------------------
jou_file_write ()
#---------------------------------------------------------------------
neutral_export2 ()
#
# neutral_export2
# ( fname,
# title,
# entflag,
# grpall,
# ngroups,
# grids )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_fname[128]
STRING s_title[128]
LOGICAL la_entflag(35)=[TRUE , TRUE , TRUE , @
TRUE , TRUE , TRUE , TRUE , TRUE , FALSE, @
TRUE , TRUE , FALSE, FALSE, TRUE , TRUE , @
TRUE , TRUE , FALSE, TRUE , TRUE , TRUE , @
TRUE , TRUE , TRUE , FALSE, FALSE, FALSE, @
FALSE, FALSE, FALSE, FALSE, TRUE , TRUE , @
FALSE, FALSE ]
LOGICAL l_grpall
INTEGER i_ngroups
INTEGER ia_grids(2)=[1,2]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
s_fname = “spool.neutral”
s_title = “MSC.Patran 2.5 Neutral File “
l_grpall = TRUE
i_ngroups = 2
# -------------------------------------------------------------------
# Now export MSC.Patran data to a MSC.Patran 2.5 neutral file.
#
i_return_value = @
neutral_export2 @
(s_fname, @
s_title, @
la_entflag, @
l_grpall, @
i_ngroups, @
ia_grids )
dump i_return_value
nf_write ()
# file.
#
# Before running this session file run spool.ses
# to create spool.db
#
# This file can be run by starting a session of
# MSC.Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function nf_write()
# has the following arguments:
#
# nf_write
# ( fname,
# title,
# pfea )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_fname[128]
STRING s_title[128]
LOGICAL l_pfea
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
s_fname = “spool.neutral”
s_title = “MSC.Patran 2.5 Neutral file”
l_pfea = FALSE
i_return_value = @
nf_write @
(s_fname, @
s_title, @
l_pfea )
dump i_return_value
s_fname = “spool.pfea.neutral”
s_title = “MSC.Patran 2.5 (PFEA) Neutral file”
l_pfea = TRUE
i_return_value = @
nf_write @
( s_fname, @
s_title, @
l_pfea )
dump i_return_value
Main Index
638
Code Examples
nf_write2 ()
s_pname = “spool.pfea.neutral2”
s_title = “PFEA Neutral File”
l_pfea = TRUE
l_grp_all = TRUE
i_return_value = @
nf_write2 @
(s_pname, @
s_title, @
Main Index
CHAPTER 3 639
Files
l_pfea, @
la_entflag, @
l_grp_all, @
i_ngroups, @
ia_grids )
dump i_return_value
p3_ps_get_xmt ()
INTEGER uil_file_import_paras_num_parts
INTEGER i_status
STRING filename[1024](1)
#---------------------------------------------------------------------
# Open a database
IF(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
ENDIF
#---------------------------------------------------------------------
# The following 2 functions are required to initialise the function
# p3_ps_get_xmt().
p3_ps_open_ug_v2( "clip.prt", @
[1, 1], [0], @
["Attributes", "2", "*", @
"*", "I", "0","Components", "0"], @
uil_file_import_paras_num_parts )
#---------------------------------------------------------------------
# Using the function p3_ps_get_xmt() to get the filename from
# the current directory.
i_status = p3_ps_get_xmt(filename)
Main Index
640
Code Examples
dump filename
#----------------------------------------------------------------------
# End of file
set_current_dir ()
s_dirname=””
i_return_value = @
get_current_dir @
(s_dirname )
dump s_dirname
s_dirname=””
i_return_value = @
get_current_dir @
(s_dirname )
dump s_dirname
i_return_value = @
set_current_dir @
(s_savedir )
dump i_return_value
dump s_savedir
#---------------------------------------------------------------------
sf_write_disable ()
# Call pcl_func1()
pcl_func1()
# Call pcl_func1()
pcl_func1()
Main Index
642
Code Examples
ugi_export_iges_v1 ()
# i_nlknt = 2
# s_product_id[64] = “MSC.Patran IGES Export”
# s_author[32] = “Sudarshan N Mogasale”
# s_author_org[32] = “GSSL,Pune,India”
# s_model_units[16] = “cm”
# l_all_groups = TRUE
# i_ngroups = 2
s_filename = “spool_igs”
s_start_section = “MSC.Patran generated IGES file”
i_nlknt = 2
s_product_id = “MSC.Patran IGES Export”
s_author = “Sudarshan N Mogasale”
s_author_org = “GSSL,Pune,India”
s_model_units = “cm”
l_all_groups = TRUE
i_ngroups = 2
i_return_value = @
ugi_export_iges_v1 @
( s_filename, @
s_start_section, @
ia_nlpos, @
i_nlknt, @
s_product_id, @
s_author, @
s_author_org, @
s_model_units, @
la_entity_toggle_values, @
l_all_groups, @
i_ngroups, @
ia_group_ids, @
ia_patran_summary, @
ia_iges_summary )
dump i_return_value
ugi_import_iges_v3 ()
#
# ugi_import_iges_v3 (filname, @
# ipref142, @
# group_name, @
# entity_toggle_values, @
# color_toggle_values, @
# color_definition_method, @
# color_definition_values, @
# all_levels, @
# level_numbers, @
# num_groups, @
# group_ids, @
# group_entity_values, @
# group_color_values, @
# level_pointers, @
# group_levels, @
# uil_file_import_ige_scale_model, @
# uil_file_import_iges_i_summary, @
# uil_file_import_iges_p_summary )
#
#---------------------------------------------------------------------
# Variable Decleration
STRING filname[32]
INTEGER ipref142
STRING group_name[32]
LOGICAL entity_toggle_values(35)
LOGICAL color_toggle_values(10)
STRING color_definition_method[8]
STRING color_definition_values[8]
LOGICAL all_levels
STRING level_numbers[8]
INTEGER num_groups
INTEGER group_ids(1)
LOGICAL group_entity_values(1,1)
LOGICAL group_color_values(1,1)
INTEGER level_pointers(1)
INTEGER group_levels(1)
REAL uil_file_import_ige_scale_model
INTEGER uil_file_import_iges_i_summary(50)
INTEGER uil_file_import_iges_p_summary(8)
integer i_return_value
string msg[512]
#---------------------------------------------------------------------
# Opening a new data base
$? YES 36000002
#---------------------------------------------------------------------
# Argument Initialization
filname = "geometry.igs.01"
ipref142 = 0
group_name = "default_group"
entity_toggle_values = [TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @
TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @
TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @
FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, @
FALSE, FALSE, FALSE, FALSE, FALSE, @
FALSE, FALSE, @
Main Index
CHAPTER 3 645
Files
color_definition_method = "all"
color_definition_values = ""
all_levels = TRUE
level_numbers = ""
num_groups = 0
group_ids = 0
group_entity_values(1,1) = FALSE
group_color_values(1,1) = FALSE
level_pointers(1) = 0
group_levels(1) = 0
#---------------------------------------------------------------------
# Importing all the entities from file "geometry.igs.01"
i_return_value = @
ugi_import_iges_v3 ( filname, @
ipref142, @
group_name, @
entity_toggle_values, @
color_toggle_values, @
color_definition_method, @
color_definition_values, @
all_levels, @
level_numbers, @
num_groups, @
group_ids, @
group_entity_values, @
group_color_values, @
level_pointers, @
group_levels, @
uil_file_import_ige_scale_model, @
uil_file_import_iges_i_summary, @
uil_file_import_iges_p_summary )
msg_get_string(i_return_value, msg)
#---------------------------------------------------------------------
# Dumped all the outputs and status of the function.
dump uil_file_import_ige_scale_model
dump uil_file_import_iges_i_summary
dump uil_file_import_iges_p_summary
dump i_return_value
dump msg
#---------------------------------------------------------------------
# Closing the patran environment.
# uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
ui_form_to_frame ()
ui_framemaker ()
r_scale = 1.0
i_option = 1
# With i_option =1 the displayed form name will be echoed to
# the history window, which can be used in ui_form_to_frame()
# function.
ui_framemaker @
(i_option, @
r_scale )
s_classname=”MSG”
ui_form_to_frame @
(s_classname, @
r_scale )
i_option = 2
# With i_option =2, whenever a form is displayed using
# ui_form_display() the name will be echoed to History window,
# and a call is automatically made to ui_form_to_frame() function.
ui_framemaker @
(i_option, @
r_scale )
i_option = 0
# With i_option =0, ui_form_display() reverts back to normal
# operation.
ui_framemaker @
(i_option, @
r_scale )
Main Index
648
Code Examples
uil_file_open.open_db ()
sf_pause()
utl_is_locked_file ()
dump i_return_value
#---------------------------------------------------------------------
utl_lock_file ()
utl_unlock_file ()
Main Index
MSC.Acumen, Volume 2: Code Examples
CHAPTER
Graphics
4
■ Introduction
Main Index
654
Code Examples
4.1 Introduction
This chapter provides code examples for the PCL function described in Volume 1. These
examples are designed so that they can be cut and pasted into a file and, by following the
instructions listed with each example, executed in MSC.Patran.
clip_plane_ar_calc ()
s_name = “Clipping_Plane_1”
# Set the axes relative rotations about the x,y and z axes.
r_rotx = 45.0
r_roty = 45.0
r_rotz = 0.0
i_return_value = @
clip_plane_ar_calc @
( s_name, @
r_rotx, @
r_roty, @
r_rotz, @
ra_new_dir, @
ra_new_up )
dump i_return_value
clip_plane_zoom_calc ()
Main Index
CHAPTER 4 657
Graphics
db_get_current_viewport_id ()
#---------------------------------------------------------------------
end_vrml_animation ()
INTEGER fem_create_mesh_surfa_num_nodes
INTEGER fem_create_mesh_surfa_num_elems
INTEGER int_status
STRING fem_create_mesh_s_nodes_created[VIRTUAL]
STRING fem_create_mesh_s_elems_created[VIRTUAL]
STRING asm_create_patch_xy_created_ids[VIRTUAL]
INTEGER res_create_demo_mcid
INTEGER res_create_demo_scid
INTEGER res_create_demo_rcid
INTEGER res_create_demo_layerposid
INTEGER res_create_demo_rtid
Main Index
658
Code Examples
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#----------------------------------------------------------------------
# Create the surface 1
int_status = asm_const_patch_xyz( @
"1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
dump int_status
#----------------------------------------------------------------------
# Create the finite elements
# Create 121 nodes and 100 elements for Surface 1.
int_status = fem_create_mesh_surf_3( @
"IsoMesh", @
16384, @
"Surface 1", @
1, @
["0.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 )
mesh_seed_display_mgr.erase( )
dump int_status
#----------------------------------------------------------------------
# Creating a dummy Result case for demonstration of
# animation.
db_drop_res_index( )
res_db_create_subcase_c( 2, @
"demo", @
res_create_demo_scid, @
res_create_demo_rcid )
Main Index
CHAPTER 4 659
Graphics
res_db_createlayerpos_c( 0, @
0, @
res_create_demo_layerposid )
#----------------------------------------------------------------------
# Starting the animation recording.
start_vrml_animation(filename,"Increment")
#----------------------------------------------------------------------
# The animation parameters are defined here
db_post_results_load( )
res_display_tool_unpost( "Deformation", @
"default_Deformation" )
res_data_load_dbresult( 0, @
"Nodal", @
"Scalar", @
"Default case", @
"demo", @
"Nodal Vector", @
"Demo Result1", @
"(NON-LAYERED)", @
"XX", @
"Default", @
"DeriveAverage", @
"All", @
"ShapeFunc" )
res_data_title( 0, "Nodal", "Scalar",1, @
["Default case, demo: Nodal Vector,Demo Result1-(NON-LAYERED) (XX)"] )
#----------------------------------------------------------------------
# Using the function end_vrml_animation to stop the animation.
end_vrml_animation()
#----------------------------------------------------------------------
# Closing the file new.db
Main Index
660
Code Examples
uil_file_close.goquit()
# End of file
#----------------------------------------------------------------------
ga_clip_plane_clip_planes_get ()
ga_clip_plane_create
ga_clip_plane_delete ()
ga_clip_plane_delete @
( s_name )
dump i_return_value
ga_clip_plane_direction_get ()
dump i_return_value
dump ra_value
ga_clip_plane_direction_set ()
ga_clip_plane_icon_get ()
ga_clip_plane_icon_set ()
uil_file_open.go(“spool.db”)
ga_clip_plane_location_get ()
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
REAL ra_value(3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
ga_clip_plane_location_set ()
#
# The function ga_clip_plane_location_set()
# has the following arguments:
#
# ga_clip_plane_location_set
# ( name,
# value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[16]
REAL ra_value(3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
ga_clip_plane_movement_get ()
# Get flag value for clipping plane movement along with the model
i_return_value = @
ga_clip_plane_movement_get @
( s_name, @
i_value )
dump i_return_value
dump i_value
Main Index
CHAPTER 4 671
Graphics
ga_clip_plane_movement_set ()
# Flag value
dump i_value
# Change the status for the clipping plane allowing it to move along
# with the model.
i_value = 1
i_return_value = @
ga_clip_plane_movement_set @
( s_name, @
i_value )
dump i_return_value
ga_clip_plane_nclip_planes_get ()
“default_viewport”, 1, [“default_group”] )
# Initialize saa_clip_plane_list
saa_clip_plane_list = [“Clipping_Plane_1” , @
“Clipping_Plane_2” , @
“Clipping_Plane_3” ]
ga_clip_plane_nposted_get ()
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_naclips
STRING saa_clip_plane_list[16](3)
INTEGER i_count
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Initialize saa_clip_plane_list
saa_clip_plane_list = [“Clipping_Plane_1” , @
“Clipping_Plane_2” , @
“Clipping_Plane_3” ]
ga_clip_plane_post ()
ga_clip_plane_posted_get ()
# to create spool.db
#
# This file can be run by starting a session of
# MSC.Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function ga_clip_plane_posted_get()
# has the following arguments:
#
# ga_clip_plane_posted_get
# ( clip_plane_list ),
#
#---------------------------------------------------------------------
# Variable Declarations
STRING saa_clip_plane_list[16](3)
STRING saa_cp_post_list[16](3)
INTEGER i_count
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# Initialize saa_clip_plane_list
saa_clip_plane_list = [“Clipping_Plane_1” , @
“Clipping_Plane_2” , @
“Clipping_Plane_3” ]
Main Index
CHAPTER 4 677
Graphics
ga_clip_plane_unpost ()
ga_clip_plane_up_set ()
ga_elem_scalar_create ()
dump i_ncases,iv_lcids,iv_nsub
dump i_return_value
i_return_value = @
ga_elem_scalar_create @
( s_title, @
i_nbr_elems, @
iv_elem_ids, @
iv_nbr_values, @
i_max_vals, @
rv_scalars, @
i_id )
dump i_return_value, i_id
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_elem_ids)
sys_free_array(iv_nbr_values)
sys_free_array(rv_scalars)
Main Index
CHAPTER 4 681
Graphics
ga_elem_scalar_single_create ()
““,i_dtype,i_resloc,i_nbr_elems,iv_elem_ids,iv_nbr_values, @
rv_scalars, ia_minloc,ia_maxloc)
dump i_return_value
sys_allocate_array(iv_nbr_nodes,1,i_nbr_elems)
FOR(i_index = 1 TO i_nbr_elems)
iv_nbr_nodes(i_index) = 4 /* QUAD4 elements */
END FOR
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_elem_ids)
sys_free_array(iv_nbr_values)
sys_free_array(iv_nbr_nodes)
sys_free_array(rv_scalars)
ga_error ()
# Variable Declarations
LOGICAL l_return_value
#---------------------------------------------------------------------
#
# Post the default_group.
uil_viewport_post_groups.posted_groups(“default_viewport”, @
1,[“default_group”])
l_return_value = ga_error()
dump l_return_value
l_return_value = ga_error()
dump l_return_value
#---------------------------------------------------------------------
ga_light_attenuation_get ()
sys_allocate_array(sav_light_list,1,i_nlights)
# Get the list of lights posted to the graphics window
i_return_value = @
ga_light_posted_get @
( sav_light_list )
dump i_return_value
Main Index
684
Code Examples
dump sav_light_list
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_attenuation_set ()
i_return_value = @
ga_light_attenuation_get @
( s_name, @
r_old_value )
dump i_return_value
dump r_old_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_color_get ()
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_color_set ()
sys_allocate_array(sav_light_list,1,i_nlights)
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_create ()
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_nlights,i_return_value
STRING s_name[32],sav_light_list[32](VIRTUAL)
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
sys_allocate_array(sav_light_list,1,i_nlights)
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_delete ()
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_nlights,i_return_value
STRING s_name[32],sav_light_list[32](VIRTUAL)
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
sys_allocate_array(sav_light_list,1,i_nlights)
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_direction_get ()
sys_allocate_array(sav_light_list,1,i_nlights)
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
Main Index
CHAPTER 4 691
Graphics
ga_light_direction_set ()
sys_allocate_array(sav_light_list,1,i_nlights)
ra_value )
dump i_return_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_icon_get ()
sys_allocate_array(sav_light_list,1,i_nlights)
i_return_value = @
ga_light_icon_get @
( s_name, @
i_value )
dump i_return_value
dump i_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_icon_set ()
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_intensity_get ()
sys_allocate_array(sav_light_list,1,i_nlights)
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_intensity_set ()
sys_allocate_array(sav_light_list,1,i_nlights)
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_lights_get ()
INTEGER i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
sys_allocate_array(sav_light_list,1,i_nlights)
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_location_get ()
sys_allocate_array(sav_light_list,1,i_nlights)
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_location_set ()
sys_allocate_array(sav_light_list,1,i_nlights)
ga_light_posted_get @
( sav_light_list )
dump i_return_value
dump sav_light_list
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_movement_get ()
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
sys_allocate_array(sav_light_list,1,i_nlights)
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_movement_set ()
i_return_value = @
ga_light_nposted_get @
( i_nlights )
dump i_return_value
dump i_nlights
sys_allocate_array(sav_light_list,1,i_nlights)
ga_view_aa_set(-157.,34.,0.)
ga_view_aa_set(23.,-34.,0.)
ga_view_aa_set(-157.,34.,0.)
ga_view_aa_set(23.,-34.,0.)
i_value = i_old_value
i_return_value = @
ga_light_movement_set @
( s_name, @
i_value )
dump i_return_value
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_nlights_get ()
ga_light_nposted_get ()
#
# The function ga_light_nposted_get()
# has the following arguments:
#
# ga_light_nposted_get
# ( nlights )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_nlights
INTEGER i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
ga_light_post ()
s_name=”directional_new”
ga_light_location_set(s_name,r_loc)
ga_light_direction_set(s_name,r_dir)
ga_light_attenuation_set(s_name,r_att)
ga_light_intensity_set(s_name,r_int)
ga_light_color_set(s_name,i_clr)
ga_light_movement_set(s_name,i_move)
ga_light_type_set(s_name,s_type)
i_return_value = @
ga_light_post @
( s_name )
dump i_return_value
ga_light_posted_get ()
#
# ga_light_posted_get
# ( light_list )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING sav_light_list[32](VIRTUAL)
INTEGER i_nlights
INTEGER i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_type_get ()
sys_allocate_array(sav_light_list,1,i_nlights)
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_type_set ()
STRING s_name[32],sav_light_list[32](VIRTUAL)
STRING s_value[32],s_old_value[32]
INTEGER i_nlights,i_return_value
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
sys_allocate_array(sav_light_list,1,i_nlights)
sys_free_array(sav_light_list)
#---------------------------------------------------------------------
ga_light_unpost ()
#
# Make “sphere.ses” available in the current
# directory.
#
# This file can be run by starting a session of
# MSC.Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function ga_light_unpost()
# has the following arguments:
#
# ga_light_unpost
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_return_value
REAL r_loc(3),r_dir(3),r_int,r_att
INTEGER i_clr,i_move
STRING s_name[32],s_type[32]
#---------------------------------------------------------------------
# The file “sphere.ses” opens a new database and creates a spherical
# surface in it.
sf_play(“sphere.ses”)
# Initialise attributes
# r_loc=[1.,-1.,1.] : location [x,y,z]
# r_dir=[1.,-1.,-1.] : direction
# r_int= 0.8 : Intensity (0.0-1.0)
# r_att= 0.0 : No Attenuation
# s_type = “DIRECTIONAL” : Directional
# i_clr = 5 : color
# i_move = 0 : Don’t move with
# : model
r_loc=[1.,-1.,1.]
r_dir=[1.,-1.,-1.]
r_int= 0.8
r_att= 0.0
s_type = “DIRECTIONAL”
i_clr = 5
i_move = 0
s_name=”directional_new”
ga_light_location_set(s_name,r_loc)
ga_light_direction_set(s_name,r_dir)
ga_light_attenuation_set(s_name,r_att)
ga_light_intensity_set(s_name,r_int)
ga_light_color_set(s_name,i_clr)
ga_light_movement_set(s_name,i_move)
ga_light_type_set(s_name,s_type)
i_return_value = @
ga_light_post @
( s_name )
dump i_return_value
ga_lookup_colors_get ()
SYS_ALLOCATE_ARRAY(ra_rgb,1,i_number,1,3)
# Get the RGB components of the colors in the current lookup table
i_return_value = @
ga_lookup_colors_get @
( s_name, @
ra_rgb )
dump i_return_value
Main Index
710
Code Examples
dump ra_rgb
SYS_FREE_ARRAY(ra_rgb)
ga_lookup_colors_set ()
SYS_ALLOCATE_ARRAY(ra_rgb,1,i_number,1,3)
# Get the RGB components of the colors in the current lookup table
i_return_value = @
ga_lookup_colors_get @
( s_name, @
Main Index
CHAPTER 4 711
Graphics
ra_rgb )
dump i_return_value
dump ra_rgb
# Set the RGB components of the colors in the current lookup table
i_offset = 0
i_return_value = @
ga_lookup_colors_set @
( s_name, @
i_offset, @
i_number, @
ra_rgb )
dump i_return_value
# Get the RGB components of the colors in the current lookup table
i_return_value = @
ga_lookup_colors_get @
( s_name, @
ra_rgb )
dump i_return_value
dump ra_rgb
# Reset the RGB components of the colors in the current lookup table
i_offset =0
i_return_value = @
ga_lookup_colors_set @
( s_name, @
i_offset, @
i_number, @
ra_rgb )
dump i_return_value
SYS_FREE_ARRAY(ra_rgb)
Main Index
712
Code Examples
ga_lookup_create ()
i_return_value = @
ga_lookup_create @
( s_name, @
i_number, @
ra_rgb )
dump i_return_value
( s_old_name )
dump i_return_value
ga_lookup_current_get ()
Main Index
714
Code Examples
ga_lookup_current_set ()
i_return_value = @
ga_lookup_create @
( s_name, @
i_number, @
ra_rgb )
dump i_return_value
ga_lookup_delete ()
i_return_value = @
ga_lookup_create @
( s_name, @
i_number, @
ra_rgb )
dump i_return_value
Main Index
716
Code Examples
ga_lookup_ncolors_get ()
dump s_name
ga_lookup_ntables_get ()
Main Index
718
Code Examples
ga_lookup_rename ()
s_old_name = s_name
s_new_name = “New_LUT”
i_return_value = @
ga_lookup_rename @
( s_old_name, @
s_new_name )
dump i_return_value
ga_lookup_current_get @
( s_name )
dump s_name
ga_lookup_tables_get ()
SYS_ALLOCATE_ARRAY(sa_tables,1,i_ntables)
SYS_FREE_ARRAY(sa_tables)
Main Index
720
Code Examples
ga_node_deform_create ()
Main Index
CHAPTER 4 721
Graphics
dump i_return_value
i_return_value = @
ga_group_node_deform_set @
( “fem_model”, @
i_id )
dump i_return_value
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
ga_range_contour_get ()
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Number of ranges
dump i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# List of ranges
dump sav_ranges
ga_range_contour_set ()
# Number of ranges
dump i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
# List of ranges
dump sav_ranges
s_name = sav_ranges(1)
# Set the old display type flag for the first range.
i_flag = i_old_flag
i_return_value = @
ga_range_contour_set @
( s_name, @
i_flag )
dump i_return_value
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_create
sys_allocate_array(sav_ranges,1,i_nranges)
s_old_name = sav_ranges(1)
sys_free_array(sav_ranges)
sys_allocate_array(sav_ranges,1,i_nranges)
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_delete ()
sys_allocate_array(sav_ranges,1,i_nranges)
s_old_name = sav_ranges(1)
( s_name, @
i_number )
dump i_return_value
sys_free_array(sav_ranges)
sys_allocate_array(sav_ranges,1,i_nranges)
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
Main Index
728
Code Examples
ga_range_exist_get ()
sys_allocate_array(sav_ranges,1,i_nranges)
ga_range_exist_get @
( s_name, @
i_flag )
dump i_return_value, i_flag
#---------------------------------------------------------------------
ga_range_nranges_get ()
ga_range_nvalues_get ()
sys_allocate_array(sav_ranges,1,i_nranges)
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_ranges_get ()
sys_allocate_array(sav_ranges,1,i_nranges)
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_rename ()
#
# This file can be run by starting a session of
# MSC.Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function ga_range_rename() has the following arguments:
#
# ga_range_rename
# ( old_name,
# new_name )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32],s_old_name[32], s_new_name[32]
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
sys_allocate_array(sav_ranges,1,i_nranges)
i_return_value = @
ga_range_rename @
( s_old_name, @
s_new_name )
dump i_return_value
i_return_value = @
ga_range_rename @
( s_old_name, @
Main Index
CHAPTER 4 733
Graphics
s_new_name )
dump i_return_value
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_startend_set ()
sys_allocate_array(sav_ranges,1,i_nranges)
sys_allocate_array(ra_from,1,i_number)
sys_allocate_array(ra_to,1,i_number)
sys_allocate_array(ra_mid,1,i_number)
sys_allocate_array(ra_old_from,1,i_number)
sys_allocate_array(ra_old_to,1,i_number)
sys_allocate_array(ra_old_mid,1,i_number)
sys_free_array(ra_from)
sys_free_array(ra_to)
sys_free_array(ra_mid)
sys_free_array(ra_old_from)
sys_free_array(ra_old_to)
sys_free_array(ra_old_mid)
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_threshold_set ()
sys_allocate_array(sav_ranges,1,i_nranges)
sys_allocate_array(ra_from,1,i_number)
sys_allocate_array(ra_to,1,i_number)
sys_allocate_array(ra_mid,1,i_number)
sys_allocate_array(ra_old_from,1,i_number)
sys_allocate_array(ra_old_to,1,i_number)
sys_allocate_array(ra_old_mid,1,i_number)
ga_viewport_range_set(““,s_name)
i_return_value = @
ga_range_threshold_set @
( s_name, @
r_start, @
r_end, @
i_sthf, @
r_sth, @
i_ethf, @
r_eth )
dump i_return_value
sys_free_array(ra_from)
sys_free_array(ra_to)
sys_free_array(ra_mid)
sys_free_array(ra_old_from)
sys_free_array(ra_old_to)
sys_free_array(ra_old_mid)
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_values_get ()
( i_nranges )
dump i_return_value, i_nranges
sys_allocate_array(sav_ranges,1,i_nranges)
sys_allocate_array(ra_from,1,i_number)
sys_allocate_array(ra_to,1,i_number)
sys_allocate_array(ra_mid,1,i_number)
sys_free_array(ra_from)
sys_free_array(ra_to)
sys_free_array(ra_mid)
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_range_values_set ()
#
#
# The function ga_range_values_set() has the following arguments:
#
# ga_range_values_set
# ( name,
# from,
# to,
# mid )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL ra_from(VIRTUAL),ra_to(VIRTUAL),ra_mid(VIRTUAL)
REAL ra_old_from(VIRTUAL),ra_old_to(VIRTUAL),ra_old_mid(VIRTUAL)
INTEGER i_number
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges, i_index
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
sys_allocate_array(sav_ranges,1,i_nranges)
sys_allocate_array(ra_from,1,i_number)
sys_allocate_array(ra_to,1,i_number)
sys_allocate_array(ra_mid,1,i_number)
sys_allocate_array(ra_old_from,1,i_number)
sys_allocate_array(ra_old_to,1,i_number)
sys_allocate_array(ra_old_mid,1,i_number)
FOR(i_index= 1 TO i_number)
ra_from(i_index) = (i_index-1) * 10000
ra_to(i_index) = (i_index) * 10000
Main Index
740
Code Examples
sys_free_array(ra_from)
sys_free_array(ra_to)
sys_free_array(ra_mid)
sys_free_array(ra_old_from)
sys_free_array(ra_old_to)
sys_free_array(ra_old_mid)
sys_free_array(sav_ranges)
#---------------------------------------------------------------------
ga_spectrum_colors_get ()
sys_allocate_array(iv_colors,1,i_number)
sys_free_array(iv_colors)
ga_spectrum_colors_set ()
sys_allocate_array(iv_old_colors,1,i_old_number)
i_number =i_old_number
i_return_value = @
ga_spectrum_colors_set @
( s_name, @
i_offset, @
i_number, @
iv_old_colors )
dump i_return_value
ga_spectrum_continuous_get ()
ga_spectrum_continuous_set ()
( s_name, @
i_value )
dump i_return_value
ga_spectrum_create ()
dump i_return_value
dump i_nspectrums
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
# Create a spectrum
s_name = “new_spectrum”
i_number = 16
ia_colors= [0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_create @
( s_name, @
i_number, @
ia_colors )
dump i_return_value
sys_free_array(sav_spectrums)
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
sys_free_array(sav_spectrums)
Main Index
CHAPTER 4 747
Graphics
#---------------------------------------------------------------------
ga_spectrum_current_get ()
i_return_value = @
ga_spectrum_current_get @
( s_name )
dump i_return_value
dump s_name
ga_spectrum_current_set ()
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# This file can be run by starting a session of
# MSC.Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function ga_spectrum_current_set()
# has the following arguments:
#
# ga_spectrum_current_set
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_old_name[32],s_name[32]
INTEGER i_number
INTEGER ia_colors(16)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
# Create a spectrum
s_name = “new_spectrum”
i_number = 16
ia_colors= [0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_create @
( s_name, @
i_number, @
ia_colors )
dump i_return_value
dump i_return_value
# Session file paused. Press “Resume” to continue..
sf_pause()
Main Index
CHAPTER 4 749
Graphics
ga_spectrum_delete ()
# Create a spectrum
s_name = “new_spectrum”
i_number = 16
ia_colors= [0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_create @
( s_name, @
i_number, @
ia_colors )
dump i_return_value
sys_allocate_array(sav_spectrums,1,i_nspectrums)
dump i_return_value
sys_free_array(sav_spectrums)
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
sys_free_array(sav_spectrums)
#---------------------------------------------------------------------
ga_spectrum_interpolation_get ()
#
# Before running this session file run spool.ses
# to create spool.db. Follow the instructions in
# spool.ses and create spool.op2 and spool.jbr.
# Make “spool_res.ses” available in the current
# working directory.
#
# This file can be run by starting a session of
# MSC.Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function ga_spectrum_interpolation_get()
# has the following arguments:
#
# ga_spectrum_interpolation_get
# ( name,
# factor )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
REAL r_factor
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
ga_spectrum_interpolation_set ()
Main Index
CHAPTER 4 753
Graphics
ga_spectrum_ncolors_get ()
ga_spectrum_nspectrums_get ()
ga_spectrum_rename ()
# new_name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32], s_old_name[32], s_new_name[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
ga_spectrum_spectrums_get ()
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
sys_free_array(sav_spectrums)
ga_title_color_get ()
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[256]
STRING sav_list[256](VIRTUAL)
INTEGER i_posted
INTEGER i_color
INTEGER i_return_value
#---------------------------------------------------------------------
# This file opens the database “new.db” and creates some titles
sf_play(“titles.ses”)
sys_allocate_array(sav_list,1,i_posted)
sys_free_array(sav_list)
ga_title_color_set ()
# ga_title_color_set
# ( name,
# color )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[256]
STRING sav_list[256](VIRTUAL)
INTEGER i_posted
INTEGER i_index
INTEGER i_color
INTEGER i_return_value
#---------------------------------------------------------------------
# This file opens the database “new.db” and creates some titles
sf_play(“titles.ses”)
sys_allocate_array(sav_list,1,i_posted)
sys_free_array(sav_list)
Main Index
CHAPTER 4 759
Graphics
ga_title_create ()
( s_name )
ga_title_delete ()
ga_title_delete @
( s_name )
ga_title_font_size_get ()
sys_allocate_array(sav_list,1,i_posted)
dump i_size
sys_free_array(sav_list)
ga_title_font_size_set ()
sys_allocate_array(sav_list,1,i_posted)
sys_free_array(sav_list)
ga_title_list_get ()
ga_title_num_get @
( i_ntitles )
dump i_return_value
dump i_ntitles
sys_allocate_array(sav_list,1,i_ntitles)
sys_free_array(sav_list)
ga_title_loc_get ()
sys_allocate_array(sav_list,1,i_posted)
sys_free_array(sav_list)
ga_title_loc_set ()
sf_play(“titles.ses”)
sys_allocate_array(sav_list,1,i_posted)
sys_free_array(sav_list)
ga_title_nposted_get ()
i_return_value = @
ga_title_nposted_get @
( i_nposted )
dump i_return_value
dump i_nposted
ga_title_num_get ()
i_return_value = @
ga_title_num_get @
( i_ntitles )
dump i_return_value
dump i_ntitles
uil_file_close.go()
#---------------------------------------------------------------------
ga_title_posted_get ()
sys_allocate_array(sav_list,1,i_posted)
sys_free_array(sav_list)
Main Index
CHAPTER 4 769
Graphics
ga_title_rename ()
s_new_name )
dump i_return_value
ga_vector_create ()
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
dump i_return_value
sys_allocate_array(iv_vect_ent_types,1,i_nvectors)
sys_allocate_array(iv_vect_ent_ids,1,i_nvectors)
sys_allocate_array(rv_vect_locs,1,i_nvectors,1,3)
sys_allocate_array(iv_vect_types,1,i_nvectors)
sys_allocate_array(iv_anchor_styles,1,i_nvectors)
sys_allocate_array(iv_vect_colors,1,i_nvectors)
sys_allocate_array(iv_sub_ids,1,i_nvectors)
FOR(i_index = 1 TO i_nvectors)
iv_vect_ent_types(i_index) = 123 /* from dbtypes.h */
iv_vect_ent_ids(i_index) = iv_node_ids(i_index)
iv_vect_types(i_index) = 1
iv_anchor_styles(i_index) = 1
iv_vect_colors(i_index) = 0
iv_sub_ids(i_index) = 0
END FOR
i_return_value = @
ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
iv_vect_ent_types, @
iv_vect_ent_ids, @
rv_vect_locs, @
rv_deform, @
iv_vect_types, @
iv_anchor_styles, @
iv_vect_colors, @
iv_sub_ids, @
Main Index
772
Code Examples
i_id )
dump i_return_value, i_id
sys_free_array(iv_vect_ent_types)
sys_free_array(iv_vect_ent_ids)
sys_free_array(rv_vect_locs)
sys_free_array(iv_vect_types)
sys_free_array(iv_anchor_styles)
sys_free_array(iv_vect_colors)
sys_free_array(iv_sub_ids)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
ga_vector_get ()
# anchor_styles,
# vect_colors,
# sub_ids )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_title[32]
INTEGER i_ncases, i_nbr_nodes, i_index
INTEGER iv_lcids(VIRTUAL),iv_nsub(VIRTUAL), iv_node_ids(VIRTUAL)
REAL rv_deform(VIRTUAL)
INTEGER i_dtype,ia_minloc(6),ia_maxloc(6), ia_resids(5)
INTEGER i_comp_vect_flag,i_sym_flag,i_nvectors
INTEGER iv_vect_ent_types(VIRTUAL), iv_vect_ent_ids(VIRTUAL)
REAL rv_vect_locs(VIRTUAL)
INTEGER iv_vect_types(VIRTUAL), iv_anchor_styles(VIRTUAL)
INTEGER iv_vect_colors(VIRTUAL), iv_sub_ids(VIRTUAL)
INTEGER i_id, i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
dump i_return_value
sys_allocate_array(iv_vect_ent_types,1,i_nvectors)
sys_allocate_array(iv_vect_ent_ids,1,i_nvectors)
sys_allocate_array(rv_vect_locs,1,i_nvectors,1,3)
sys_allocate_array(iv_vect_types,1,i_nvectors)
sys_allocate_array(iv_anchor_styles,1,i_nvectors)
sys_allocate_array(iv_vect_colors,1,i_nvectors)
sys_allocate_array(iv_sub_ids,1,i_nvectors)
FOR(i_index = 1 TO i_nvectors)
iv_vect_ent_types(i_index) = 123 /* from dbtypes.h */
iv_vect_ent_ids(i_index) = iv_node_ids(i_index)
iv_vect_types(i_index) = 1
iv_anchor_styles(i_index) = 1
iv_vect_colors(i_index) = 0
Main Index
774
Code Examples
iv_sub_ids(i_index) = 0
END FOR
i_return_value = @
ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
iv_vect_ent_types, @
iv_vect_ent_ids, @
rv_vect_locs, @
rv_deform, @
iv_vect_types, @
iv_anchor_styles, @
iv_vect_colors, @
iv_sub_ids, @
i_id )
dump i_return_value, i_id
sys_free_array(iv_vect_ent_types)
sys_free_array(iv_vect_ent_ids)
sys_free_array(rv_vect_locs)
sys_free_array(rv_deform)
sys_free_array(iv_vect_types)
sys_free_array(iv_anchor_styles)
sys_free_array(iv_vect_colors)
sys_free_array(iv_sub_ids)
sys_allocate_array(iv_vect_ent_types,1,i_nvectors)
sys_allocate_array(iv_vect_ent_ids,1,i_nvectors)
sys_allocate_array(rv_vect_locs,1,i_nvectors,1,3)
sys_allocate_array(rv_deform,1,i_nvectors,1,3)
sys_allocate_array(iv_vect_types,1,i_nvectors)
sys_allocate_array(iv_anchor_styles,1,i_nvectors)
sys_allocate_array(iv_vect_colors,1,i_nvectors)
sys_allocate_array(iv_sub_ids,1,i_nvectors)
iv_vect_ent_ids, @
rv_vect_locs, @
rv_deform, @
iv_vect_types, @
iv_anchor_styles, @
iv_vect_colors, @
iv_sub_ids )
dump i_return_value
dump s_title, i_comp_vect_flag,i_sym_flag
sys_free_array(iv_vect_ent_types)
sys_free_array(iv_vect_ent_ids)
sys_free_array(rv_vect_locs)
sys_free_array(iv_vect_types)
sys_free_array(iv_anchor_styles)
sys_free_array(iv_vect_colors)
sys_free_array(iv_sub_ids)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
ga_vector_number_get ()
dump i_return_value
sys_allocate_array(iv_vect_ent_types,1,i_nvectors)
sys_allocate_array(iv_vect_ent_ids,1,i_nvectors)
sys_allocate_array(rv_vect_locs,1,i_nvectors,1,3)
sys_allocate_array(iv_vect_types,1,i_nvectors)
sys_allocate_array(iv_anchor_styles,1,i_nvectors)
sys_allocate_array(iv_vect_colors,1,i_nvectors)
sys_allocate_array(iv_sub_ids,1,i_nvectors)
FOR(i_index = 1 TO i_nvectors)
iv_vect_ent_types(i_index) = 123 /* from dbtypes.h */
iv_vect_ent_ids(i_index) = iv_node_ids(i_index)
iv_vect_types(i_index) = 1
iv_anchor_styles(i_index) = 1
iv_vect_colors(i_index) = 0
iv_sub_ids(i_index) = 0
END FOR
i_return_value = @
ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
iv_vect_ent_types, @
iv_vect_ent_ids, @
rv_vect_locs, @
rv_deform, @
iv_vect_types, @
Main Index
CHAPTER 4 777
Graphics
iv_anchor_styles, @
iv_vect_colors, @
iv_sub_ids, @
i_id )
dump i_return_value, i_id
sys_free_array(iv_vect_ent_types)
sys_free_array(iv_vect_ent_ids)
sys_free_array(rv_vect_locs)
sys_free_array(iv_vect_types)
sys_free_array(iv_anchor_styles)
sys_free_array(iv_vect_colors)
sys_free_array(iv_sub_ids)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
ga_view_normal_get ()
# view_vector )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_viewport[16]
REAL ra_vector(3)
INTEGER i_return_value = 5
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Setting the view to isometric.
#---------------------------------------------------------------------
# Getting the view vector.
s_viewport = ""
i_return_value = @
ga_view_normal_get @
( s_viewport, @
ra_vector )
dump i_return_value
dump ra_vector
#---------------------------------------------------------------------
gm_conv_device_to_subject ()
gm_convert_name ()
s_orig_name=”/one/two/three/four”
dump s_new_name
#---------------------------------------------------------------------
gm_database_current ()
i_return_value = @
gm_database_current @
( s_dbname )
dump i_return_value, s_dbname
#---------------------------------------------------------------------
gm_draw_entity ()
# Variable Declarations
STRING asm_create_patch_xy_created_ids[VIRTUAL]
INTEGER segment_id
INTEGER color_id
INTEGER entity_type
INTEGER entity_id
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new data base.
#---------------------------------------------------------------------
# Create a 2-D patch.
#---------------------------------------------------------------------
# Argument Initialization.
color_id = 5
entity_type = 3
entity_id = 1
#---------------------------------------------------------------------
# Create the segment id.
gm_segment_create(segment_id)
#---------------------------------------------------------------------
# Draw the selected entity.
#---------------------------------------------------------------------
# Dump the output of the function
dump i_return_value
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
gm_fit_view ()
gm_fullcolor_mode ()
i_return_value = gm_fullcolor_mode()
dump i_return_value
#---------------------------------------------------------------------
Main Index
CHAPTER 4 783
Graphics
gm_graphics_off ()
#---------------------------------------------------------------------
gm_graphics_on ()
#---------------------------------------------------------------------
gm_hilight_clear ()
ui_exec_function(“hilight”, “display”)
Main Index
CHAPTER 4 785
Graphics
#---------------------------------------------------------------------
gm_hilight_entity ()
i_id = 2
gm_hilight_entity @
( i_type, @
i_id, @
i_color )
# Unhighlight surface 1
i_id = 1
i_color= 0
gm_hilight_entity @
( i_type, @
i_id, @
i_color )
#---------------------------------------------------------------------
gm_hilight_string ()
STRING asm_create_patch_xy_created_ids[VIRTUAL]
INTEGER color_id
STRING entities[80]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new data base.
#---------------------------------------------------------------------
# Create a 2-D patch.
#---------------------------------------------------------------------
# Argument Initialization.
#---------------------------------------------------------------------
# Hilight all the selected entities.
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
gm_hilight_widget ()
uil_file_open.go(“spool.db”)
ui_exec_function(“hilight”,”display”)
gm_lookup_write ()
INTEGER i_ncolors
REAL ra_colors(16,3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
i_return_value = @
gm_lookup_write @
( i_start, @
i_ncolors, @
ra_colors )
dump i_return_value
#---------------------------------------------------------------------
gm_mpeg_pause_recording ()
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING asm_delete_any_deleted_ids[VIRTUAL]
STRING file_name[80]
STRING file_version[80]
Main Index
790
Code Examples
REAL x
REAL y
REAL width
REAL height
INTEGER quality
INTEGER maxframes
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new data base.
#---------------------------------------------------------------------
# Argument Initialization.
file_name = "./new.mpg"
file_version = "Increment"
x = 0.
y = 0.
width = 1.0
height = 1.0
quality = 90
maxframes = 1000
#---------------------------------------------------------------------
# Start the recording of .mpeg images file named "./new.mpg".
i_return_value = gm_mpeg_start_recording(file_name, @
file_version, @
x, @
y, @
width, @
height, @
quality, @
maxframes)
#---------------------------------------------------------------------
# Dump the output of the function
dump i_return_value
#---------------------------------------------------------------------
# Create a 2-D patch.
ga_viewport_location_set( "default_viewport", @
0.049213, 3.592520, 1 )
#---------------------------------------------------------------------
# Pause the recording .mpeg images file named "./new.mpg".
gm_mpeg_pause_recording( )
#---------------------------------------------------------------------
# Create the second 2-D patch.
#---------------------------------------------------------------------
# Resume the recording .mpeg images file named "./new.mpg".
gm_mpeg_resume_recording( )
#---------------------------------------------------------------------
# Delete the second 2-D patch.
#---------------------------------------------------------------------
# Stop the recording .mpeg images file named "./new.mpg".
gm_mpeg_stop_recording( )
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
gm_mpeg_resume_recording ()
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING asm_delete_any_deleted_ids[VIRTUAL]
STRING file_name[80]
STRING file_version[80]
REAL x
Main Index
792
Code Examples
REAL y
REAL width
REAL height
INTEGER quality
INTEGER maxframes
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new data base.
#---------------------------------------------------------------------
# Argument Initialization.
file_name = "./new.mpg"
file_version = "Increment"
x = 0.
y = 0.
width = 1.0
height = 1.0
quality = 90
maxframes = 1000
#---------------------------------------------------------------------
# Start the recording of .mpeg images file named "./new.mpg".
i_return_value = gm_mpeg_start_recording(file_name, @
file_version, @
x, @
y, @
width, @
height, @
quality, @
maxframes)
#---------------------------------------------------------------------
# Dump the output of the function
dump i_return_value
#---------------------------------------------------------------------
# Create a 2-D patch.
ga_viewport_location_set( "default_viewport", @
0.049213, 3.592520, 1 )
#---------------------------------------------------------------------
# Pause the recording .mpeg images file named "./new.mpg".
gm_mpeg_pause_recording( )
#---------------------------------------------------------------------
# Create the second 2-D patch.
#---------------------------------------------------------------------
Main Index
CHAPTER 4 793
Graphics
gm_mpeg_resume_recording( )
#---------------------------------------------------------------------
# Delete the second 2-D patch.
#---------------------------------------------------------------------
# Stop the recording .mpeg images file named "./new.mpg".
gm_mpeg_stop_recording( )
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
gm_mpeg_start_recording ()
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING asm_delete_any_deleted_ids[VIRTUAL]
STRING file_name[80]
STRING file_version[80]
REAL x
REAL y
Main Index
794
Code Examples
REAL width
REAL height
INTEGER quality
INTEGER maxframes
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new data base.
#---------------------------------------------------------------------
# Argument Initialization.
file_name = "./new.mpg"
file_version = "Increment"
x = 0.
y = 0.
width = 1.0
height = 1.0
quality = 90
maxframes = 1000
#---------------------------------------------------------------------
# Start the recording of .mpeg images file named "./new.mpg".
i_return_value = gm_mpeg_start_recording(file_name, @
file_version, @
x, @
y, @
width, @
height, @
quality, @
maxframes)
#---------------------------------------------------------------------
# Dump the output of the function
dump i_return_value
#---------------------------------------------------------------------
# Create a 2-D patch.
ga_viewport_location_set( "default_viewport", @
0.049213, 3.592520, 1 )
#---------------------------------------------------------------------
# Pause the recording .mpeg images file named "./new.mpg".
gm_mpeg_pause_recording( )
#---------------------------------------------------------------------
# Create the second 2-D patch.
#---------------------------------------------------------------------
# Resume the recording .mpeg images file named "./new.mpg".
Main Index
CHAPTER 4 795
Graphics
gm_mpeg_resume_recording( )
#---------------------------------------------------------------------
# Delete the second 2-D patch.
#---------------------------------------------------------------------
# Stop the recording .mpeg images file named "./new.mpg".
gm_mpeg_stop_recording( )
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
gm_mpeg_stop_recording ()
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING asm_delete_any_deleted_ids[VIRTUAL]
STRING file_name[80]
STRING file_version[80]
REAL x
REAL y
REAL width
Main Index
796
Code Examples
REAL height
INTEGER quality
INTEGER maxframes
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new data base.
#---------------------------------------------------------------------
# Argument Initialization.
file_name = "./new.mpg"
file_version = "Increment"
x = 0.
y = 0.
width = 1.0
height = 1.0
quality = 90
maxframes = 1000
#---------------------------------------------------------------------
# Start the recording of .mpeg images file named "./new.mpg".
i_return_value = gm_mpeg_start_recording(file_name, @
file_version, @
x, @
y, @
width, @
height, @
quality, @
maxframes)
#---------------------------------------------------------------------
# Dump the output of the function
dump i_return_value
#---------------------------------------------------------------------
# Create a 2-D patch.
ga_viewport_location_set( "default_viewport", @
0.049213, 3.592520, 1 )
#---------------------------------------------------------------------
# Pause the recording .mpeg images file named "./new.mpg".
gm_mpeg_pause_recording( )
#---------------------------------------------------------------------
# Create the second 2-D patch.
#---------------------------------------------------------------------
# Resume the recording .mpeg images file named "./new.mpg".
Main Index
CHAPTER 4 797
Graphics
gm_mpeg_resume_recording( )
#---------------------------------------------------------------------
# Delete the second 2-D patch.
#---------------------------------------------------------------------
# Stop the recording .mpeg images file named "./new.mpg".
gm_mpeg_stop_recording( )
#---------------------------------------------------------------------
# closing the patran environment.
uil_file_close.goquit( )
#---------------------------------------------------------------------
# End of File.
gm_viewport_hardware_mode_get ()
gm_viewport_hardware_mode_get @
( i_hard_flag )
#---------------------------------------------------------------------
gm_viewport_hardware_mode_set ()
#
# Before running this session file run spool.ses
# to create spool.db
#
# This file can be run by starting a session of
# MSC.Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function gm_viewport_hardware_mode_set()
# has the following arguments:
#
# gm_viewport_hardware_mode_set
# ( hard_flag )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_hard_flag
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
#---------------------------------------------------------------------
gm_viewport_id_to_name ()
#---------------------------------------------------------------------
gm_viewport_limits_get ()
#---------------------------------------------------------------------
gm_viewport_ncolors_get ()
gm_viewport_ncolors_get @
( i_ncolors )
dump i_ncolors
#---------------------------------------------------------------------
gm_viewport_refresh_off ()
# Force repaint
repaint_graphics()
# Force repaint
repaint_graphics()
#---------------------------------------------------------------------
gm_viewport_refresh_on ()
Main Index
802
Code Examples
gm_viewport_refresh_status ()
gm_viewport_view_corners ()
# lr,
# cent_x,
# cent_y,
# zoom )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_id
INTEGER ia_ul(2), ia_br(2)
INTEGER i_ulx,i_uly,i_brx,i_bry,i_ppi
REAL r_cent_x, r_cent_y, r_zoom
REAL r_width, r_height
INTEGER i_return_value
STRING s_name[32]
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
i_return_value = @
gm_viewport_view_corners @
( i_id, @
ia_ul, @
ia_br, @
r_cent_x, @
r_cent_y, @
r_zoom )
dump i_return_value, r_cent_x, r_cent_y, r_zoom
# Zoom in
ga_view_center_set(r_cent_x,r_cent_y)
ga_view_zoom_set(r_zoom)
#---------------------------------------------------------------------
Main Index
804
Code Examples
gm_visibility_all ()
#---------------------------------------------------------------------
gm_visibility_widget ()
gm_visibility_all(TRUE)
#---------------------------------------------------------------------
gm_write_image ()
# quality )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING fem_create_mesh_s_nodes_created[VIRTUAL]
STRING fem_create_mesh_s_elems_created[VIRTUAL]
INTEGER fem_create_mesh_surfa_num_nodes
INTEGER fem_create_mesh_surfa_num_elems
INTEGER i_return_value
#----------------------------------------------------------------------
# Open a new database
if(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
endif
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#----------------------------------------------------------------------
# Create the geometry - SURFACE 1
#
i_return_value = asm_const_patch_xyz @
( "1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
dump i_return_value
#----------------------------------------------------------------------
# Create finite element entities
# Creating 36 nodes and 25 elements for Surface 1.
i_return_value = fem_create_mesh_surf_3( @
"IsoMesh", @
0, @
"Surface 1 ", @
1, @
["0.2"], @
"Quad4", @
"1", @
"1", @
"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 )
dump i_return_value
mesh_seed_display_mgr.erase( )
#----------------------------------------------------------------------
# Create loads/boundary conditions
# Creating set 'fixed_nodes' on L.H.S. of the model
Main Index
CHAPTER 4 807
Graphics
i_return_value = loadsbcs_create2( @
"fixed_nodes", @
"Displacement", @
"Nodal", @
"", @
"Static", @
[" Node 1 31"], @
"FEM", @
"Coord 0", @
"1.", @
["<0,0,0>", @
"<0,0,0>"], @
["", ""] )
dump i_return_value
i_return_value = loadsbcs_create2( @
"Load_at_ends", @
"Force", @
"Nodal", @
"", @
"Static", @
[" Node 36 6"], @
"FEM", @
"Coord 0", @
"1.", @
["<0,-50,0>", @
"<0,0,0>"], @
["", ""] )
dump i_return_value
#----------------------------------------------------------------------
# Using the function gm_write_image() to dump the output of the
# window into a file image_0.bmp
i_return_value = gm_write_image( @
"ppm", @
"image.ppm", @
"", @
0, @
0, @
1, @
1, @
0 )
dump i_return_value
#----------------------------------------------------------------------
# Closing the file new.db
uil_file_close.goquit()
#----------------------------------------------------------------------
# End of file
gm_write_vrml
INTEGER fem_create_mesh_surfa_num_nodes
INTEGER fem_create_mesh_surfa_num_elems
INTEGER int_status
STRING fem_create_mesh_s_nodes_created[VIRTUAL]
STRING fem_create_mesh_s_elems_created[VIRTUAL]
STRING asm_create_patch_xy_created_ids[VIRTUAL]
STRING filename[256] = "image.wrl"
#----------------------------------------------------------------------
# Open a new database
if(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
endif
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#----------------------------------------------------------------------
# Create the surface 1
int_status = asm_const_patch_xyz( @
"1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
dump int_status
#----------------------------------------------------------------------
# Create the finite elements
# Create 121 nodes and 100 elements for Surface 1.
int_status = fem_create_mesh_surf_3( @
"IsoMesh", @
16384, @
"Surface 1", @
1, @
["0.1"], @
"Quad4", @
"#", @
"#", @
"Coord 0", @
"Coord 0", @
fem_create_mesh_surfa_num_nodes, @
fem_create_mesh_surfa_num_elems, @
fem_create_mesh_s_nodes_created, @
Main Index
CHAPTER 4 809
Graphics
fem_create_mesh_s_elems_created )
mesh_seed_display_mgr.erase( )
dump int_status
#----------------------------------------------------------------------
# Using the function gm_write_vrml() to send the output of screen to
# the file image_0.wrl
# The function returns 1 for success and 0 for failure
int_status = gm_write_vrml(filename,"Overwrite")
dump int_status
#----------------------------------------------------------------------
# Closing the file "new.db"
uil_file_close.goquit()
# End of file
#----------------------------------------------------------------------
ga_lookup_create ()
i_return_value = @
Main Index
810
Code Examples
ga_lookup_create @
( s_name, @
i_number, @
ra_rgb )
dump i_return_value
SYS_ALLOCATE_ARRAY(sa_tables,1,i_ntables)
SYS_FREE_ARRAY(sa_tables)
ga_lookup_current_set ()
uil_file_open.go(“spool.db”)
i_return_value = @
ga_lookup_create @
( s_name, @
i_number, @
ra_rgb )
dump i_return_value
ga_lookup_delete ()
# to create spool.db
#
# This file can be run by starting a session of
# MSC.Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function ga_lookup_delete()
# has the following arguments:
#
# ga_lookup_delete
# ( name )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sa_tables[32](VIRTUAL)
INTEGER i_number
INTEGER i_ntables
REAL ra_rgb(8,3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
i_return_value = @
ga_lookup_create @
( s_name, @
i_number, @
ra_rgb )
dump i_return_value
SYS_ALLOCATE_ARRAY(sa_tables,1,i_ntables)
SYS_FREE_ARRAY(sa_tables)
SYS_ALLOCATE_ARRAY(sa_tables,1,i_ntables)
SYS_FREE_ARRAY(sa_tables)
ga_range_create ()
Main Index
814
Code Examples
sys_allocate_array(sav_ranges,1,i_nranges)
sys_free_array(sav_ranges)
sys_allocate_array(sav_ranges,1,i_nranges)
#---------------------------------------------------------------------
ga_range_delete ()
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_name[32]
STRING sav_ranges[32](VIRTUAL)
INTEGER i_nranges
INTEGER i_number
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
sys_allocate_array(sav_ranges,1,i_nranges)
sys_free_array(sav_ranges)
sys_allocate_array(sav_ranges,1,i_nranges)
#---------------------------------------------------------------------
Main Index
816
Code Examples
ga_spectrum_colors_set ()
sys_allocate_array(iv_old_colors,1,i_old_number)
sys_allocate_array(iv_colors,1,iv_number)
sys_free_array(iv_colors)
sys_allocate_array(iv_colors,1,iv_number)
dump iv_colors
#---------------------------------------------------------------------
ga_spectrum_continuous_set ()
#---------------------------------------------------------------------
ga_spectrum_create ()
# Create a spectrum
s_name = “new_spectrum”
i_number = 16
Main Index
820
Code Examples
ia_colors= [0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_create @
( s_name, @
i_number, @
ia_colors )
dump i_return_value
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
sys_free_array(sav_spectrums)
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
sys_free_array(sav_spectrums)
#---------------------------------------------------------------------
ga_spectrum_current_set ()
# Create a spectrum
s_name = “new_spectrum”
i_number = 16
ia_colors= [0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_create @
( s_name, @
i_number, @
ia_colors )
dump i_return_value
( s_old_name )
dump i_return_value
ga_spectrum_delete ()
# Create a spectrum
s_name = “new_spectrum”
i_number = 16
ia_colors= [0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8]
i_return_value = @
ga_spectrum_create @
( s_name, @
i_number, @
ia_colors )
Main Index
CHAPTER 4 823
Graphics
dump i_return_value
sys_allocate_array(sav_spectrums,1,i_nspectrums)
sys_free_array(sav_spectrums)
sys_allocate_array(sav_spectrums,1,i_nspectrums)
i_return_value = @
ga_spectrum_spectrums_get @
( sav_spectrums )
dump i_return_value
dump sav_spectrums
sys_free_array(sav_spectrums)
#---------------------------------------------------------------------
ga_spectrum_interpolation_set ()
(s_name, @
r_factor )
dump i_return_value
ga_title_create ()
i_return_value = @
ga_title_num_get @
( i_ntitles )
dump i_return_value
dump i_ntitles
sys_allocate_array(sav_list,1,i_ntitles)
sys_free_array(sav_list)
#---------------------------------------------------------------------
ga_title_delete ()
sys_allocate_array(sav_list,1,i_ntitles)
sys_free_array(sav_list)
i_return_value = @
ga_title_delete @
( s_name )
dump i_return_value
#---------------------------------------------------------------------
start_vrml_animation ()
INTEGER fem_create_mesh_surfa_num_nodes
INTEGER fem_create_mesh_surfa_num_elems
INTEGER int_status
STRING fem_create_mesh_s_nodes_created[VIRTUAL]
STRING fem_create_mesh_s_elems_created[VIRTUAL]
STRING asm_create_patch_xy_created_ids[VIRTUAL]
INTEGER res_create_demo_mcid
INTEGER res_create_demo_scid
INTEGER res_create_demo_rcid
INTEGER res_create_demo_layerposid
INTEGER res_create_demo_rtid
STRING filename[256] = "animate.wrl"
#----------------------------------------------------------------------
# Open a new database
if(!db_is_open())THEN
uil_file_new.go("","new.db")
$? YES 36000002
endif
#----------------------------------------------------------------------
# Setting the preference to MSC.Nastran.
Main Index
CHAPTER 4 829
Graphics
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#----------------------------------------------------------------------
# Create the surface 1
int_status = asm_const_patch_xyz( @
"1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
dump int_status
#----------------------------------------------------------------------
# Create the finite elements
# Create 121 nodes and 100 elements for Surface 1.
int_status = fem_create_mesh_surf_3( @
"IsoMesh", @
16384, @
"Surface 1", @
1, @
["0.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 )
mesh_seed_display_mgr.erase( )
dump int_status
#----------------------------------------------------------------------
# Creating a dummy Result case for demonstration of
# animation.
db_drop_res_index( )
res_db_create_subcase_c( 2, @
"demo", @
res_create_demo_scid, @
res_create_demo_rcid )
res_db_createlayerpos_c( 0, @
0, @
res_create_demo_layerposid )
#----------------------------------------------------------------------
# Using the function start_vrml_animation to start the animation recording
start_vrml_animation(filename,"Increment")
#----------------------------------------------------------------------
# The animation parameters are defined here
db_post_results_load( )
res_display_tool_unpost( "Deformation", @
"default_Deformation" )
res_data_load_dbresult( 0, @
"Nodal", @
"Scalar", @
"Default case", @
"demo", @
"Nodal Vector", @
"Demo Result1", @
"(NON-LAYERED)", @
"XX", @
"Default", @
"DeriveAverage", @
"All", @
"ShapeFunc" )
res_data_title( 0, "Nodal", "Scalar",1, @
["Default case, demo: Nodal Vector,Demo Result1-(NON-LAYERED) (XX)"] )
#----------------------------------------------------------------------
# Ending the animation.
end_vrml_animation()
#----------------------------------------------------------------------
# Closing the file new.db
uil_file_close.goquit()
# End of file
#----------------------------------------------------------------------
Main Index
CHAPTER 4 831
Graphics
verify_boundaries_display_mgr.erase ()
verify_boundaries_display_mgr.initialize ()
verify_boundaries_display_mgr.plot ()
# (displ_type)
#
#---------------------------------------------------------------------
# Variable declaration
STRING s_displ_type[32]
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
Main Index
834
Code Examples
Main Index
MSC.Acumen, Volume 2: Code Examples
CHAPTER
User Interface
5
■ Introduction
Main Index
836
Code Examples
5.1 Introduction
This chapter provides code examples for the PCL function described in Volume 1. These
examples are designed so that they can be cut and pasted into a file and, by following the
instructions listed with each example, executed in MSC.Patran.
app_count_list ()
# -------------------------------------------------------------------
# Calling the function with item type LP_SUBLIST_POINT. List
# processor will count the points in the input list.
# The relevant integer value for the particular item type can be
# found in file “lpenums.i”
#
i_type = 4 /* For LP_SUBLIST_POINT from “lpenums.i” */
s_list = “Node 1:25 Point 1:6 Curve 1:4”
l_domesg = TRUE
i_return_value = @
app_count_list @
( i_type, @
s_list, @
l_domesg, @
i_status )
i_return_value = @
app_count_list @
( i_type, @
s_list, @
l_domesg, @
i_status )
# -------------------------------------------------------------------
# Calling the function with item type LP_SUBLIST_NODE. List
# processor will count the number of NODES in the list supplied.
#
i_type = 512 /* For LP_SUBLIST_NODE from “lpenums.i” */
i_return_value = @
app_count_list @
( i_type, @
s_list, @
l_domesg, @
i_status )
app_count_list ()
# -------------------------------------------------------------------
# Calling the function with item type LP_SUBLIST_POINT. List
# processor will count the points in the input list.
# The relevant integer value for the particular item type can be
# found in file “lpenums.i”
#
i_type = 4 /* For LP_SUBLIST_POINT from “lpenums.i” */
s_list = “Node 1:25 Point 1:6 Curve 1:4”
l_domesg = TRUE
i_return_value = @
app_count_list @
( i_type, @
s_list, @
l_domesg, @
i_status )
i_return_value = @
app_count_list @
( i_type, @
s_list, @
l_domesg, @
i_status )
# -------------------------------------------------------------------
# Calling the function with item type LP_SUBLIST_NODE. List
# processor will count the number of NODES in the list supplied.
#
i_type = 512 /* For LP_SUBLIST_NODE from “lpenums.i” */
i_return_value = @
app_count_list @
( i_type, @
s_list, @
l_domesg, @
i_status )
app_db_err_msg ()
# -------------------------------------------------------------------
# Call the function with db_routine=db_get_pref(), status code
# 13000088 and id=DISPLAYMETHOD. Id of the item causing error can be
# found in the file “P3_HOME/customization/pref_names.i”. In this
# file, DISPLAYMETHOD has been defined a value of 501.
# ( When db_get_pref() is called with pref_id=DISPLAYMETHOD, if
Main Index
840
Code Examples
l_domesg = TRUE
s_db_routine = “db_get_pref”
s_caller = “uil_primary.default_graphics”
i_status = 13000088 /* return value of db_get_pref() */
DISPLAYMETHOD = 501 /* from “pref_names.i” */
i_id = DISPLAYMETHOD
app_db_err_msg @
( l_domesg, @
s_db_routine, @
s_caller, @
i_status, @
i_id )
# -------------------------------------------------------------------
app_ids_to_vstring ()
# -------------------------------------------------------------------
# Calling the function with List Processor type LpCURVE. List
# processor will consider input idarray as array of Curve ids.
# The relevant integer value for the particular List Processor type
# can be found in file “lpkeywords.i”
#
i_numval=4 /* Number of id values supplied */
i_type = 3 /* For LpCURVE from “lpkeywords.i” */
i_return_value = @
app_ids_to_vstring @
( i_idarray, @
Main Index
CHAPTER 5 841
User Interface
i_numval, @
i_type, @
s_appstr )
i_return_value = @
app_ids_to_vstring @
( i_idarray, @
i_numval, @
i_type, @
s_appstr )
# -------------------------------------------------------------------
# Calling the function with List Processor type LpSURFACE. List
# processor will consider input idarray as array of Surface ids.
#
i_type = 5 /* For LpSURFACE from “lpkeywords.i” */
i_return_value = @
app_ids_to_vstring @
( i_idarray, @
i_numval, @
i_type, @
s_appstr )
sys_free_string(s_appstr)
# -------------------------------------------------------------------
Main Index
842
Code Examples
app_int_array_to_vstring ()
# -------------------------------------------------------------------
# Calling the function with prefix = “Point”
#
s_prefix=”Point”
i_numval=4 /* Number of id values supplied */
i_return_value = @
app_int_array_to_vstring @
( s_prefix, @
i_numval, @
i_inlist, @
s_virtsym )
i_return_value = @
app_int_array_to_vstring @
( s_prefix, @
i_numval, @
i_inlist, @
Main Index
CHAPTER 5 843
User Interface
s_virtsym )
sys_free_string(s_virtsym)
# -------------------------------------------------------------------
appcode ()
# -------------------------------------------------------------------
i_return_value = @
appcode @
( i_status )
dump i_return_value
# -------------------------------------------------------------------
asm_u_coord_global_to_local ()
# Purpose : This file provides an example of a call to the
# function asm_u_coord_global_to_local()
#
# This function transforms points from global
# coordinates to a local coordinate frame.
# This file transforms a given point from
# global coordinates to local coordinates.
#
# This file can be run by starting a session of
# MSC.Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function asm_u_coord_global_to_local()
Main Index
844
Code Examples
uil_pref_analysis.set_analysis_pref( "MSC.Nastran", @
"Structural", @
"", @
".op2" )
#---------------------------------------------------------------------
# The rotation matrix interchanges the x and y axis of the
# present coordinate system to get the local coordinate system.
# i_itype = 1 (rectangular coordinate frame )
i_itype = 1
i_npts = 1
i_npts = 1
asm_u_coord_global_to_local @
( ra_p, @
ra_t, @
ra_r, @
i_itype, @
i_npts )
uil_file_close.goquit()
#---------------------------------------------------------------------
# End of File.
asm_u_lp_get_entity_label ()
# Purpose : This file provides an example of a call to the
# function asm_u_lp_get_entity_label()
#
# This file can be run by starting a session of
# MSC.Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function asm_u_lp_get_entity_label() has the following
# arguments:
# asm_u_lp_get_entity_label
# ( label_handle,
# list,
# last_supplied_label,
# domesg,
Main Index
CHAPTER 5 845
User Interface
# label,
# status )
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_label_handle
STRING s_list[128]
LOGICAL l_last_supplied_label,l_domesg
INTEGER i_label, i_status
INTEGER i_method,i_count
INTEGER i_return_value
#---------------------------------------------------------------------
# Call lp_eval() to initialize the list processor with
# LP_EVAL_FOR_TOKENS as evaluation method.
l_last_supplied_label = FALSE
l_domesg = TRUE
i_count = 0
dump i_count
dump i_status
dump i_label
write (“ “)
i_count = i_count + 1
END WHILE
lp_eval_cleanup(i_label_handle)
#---------------------------------------------------------------------
asm_u_lp_get_point ()
# asm_u_lp_get_point
# ( point_list
# do_message
# point_coords
# status )
#
# -------------------------------------------------------------------
# Variable Declaration
#
STRING s_point_list[32]
LOGICAL l_do_message
REAL r_point_coords(3)
INTEGER i_status
STRING asm_create_grid_xyz_created_ids[VIRTUAL]
# -------------------------------------------------------------------
# Open a new database. Creating FOUR points by calling the function
# asm_const_grid_xyz(). Function assigns default id numbers to the
# created points.
#
uil_file_new.go(““,”new.db”)
$? YES 36000002
asm_const_grid_xyz @
( ““, @
“[5 10 0]”, @
“Coord 0”, @
asm_create_grid_xyz_created_ids )
# -------------------------------------------------------------------
# Call the function with point_list=”Point 1” to get the coordinates
# of the point 1.
#
s_point_list=”Point 1”
l_do_message=TRUE
asm_u_lp_get_point @
( s_point_list, @
l_do_message, @
r_point_coords, @
i_status )
asm_u_lp_get_vector ()
# -------------------------------------------------------------------
# Open a new database. Create a VECTOR by calling the function
# sgm_const_vector_magnitude().
#
uil_file_new.go(““,”new.db”)
$? YES 36000002
sgm_const_vector_magnitude @
( “1”, @
“1.0”, @
“<4 2 4>”, @
“[0 0 0]”, @
“Coord 0”, @
sgm_create_vector_m_created_ids )
sf_pause()
# -------------------------------------------------------------------
# Call the function with vector list “Vector 1” to get the
# coordinates of the Vector 1.
#
s_vector=”Vector 1”
l_do_message=TRUE
asm_u_lp_get_vector @
( s_vector, @
l_do_message, @
r_vector_coords, @
i_status )
Main Index
848
Code Examples
lp_eval_cleanup ()
# -------------------------------------------------------------------
# Initializing List Processor to process a List.
#
s_list=”Point 1 3 5 8 9 Node 1:10” /* Input list */
i_method=4 /* from lpenums.i for LP_EVAL_FOR_ID */
i_return_value = @
lp_eval @
( s_list, @
i_method, @
i_handle )
i_return_value = @
lp_sublist_count @
( i_handle, @
i_filter, @
i_count )
Main Index
CHAPTER 5 849
User Interface
i_return_value = @
lp_sublist_count @
( i_handle, @
i_filter, @
i_count )
# -------------------------------------------------------------------
lp_geometry_text ()
# -------------------------------------------------------------------
# Calling the function with geometry type “Point”. geo_keyword for
# point from “lpkeywords.i” is 1.
#
i_geo_keyword=1 /* from lpkeywords.i for LpPOINT */
i_geo_id_count=4 /* Number of id values supplied */
i_text_len_max=32
i_return_value = @
lp_geometry_text @
( i_geo_keyword, @
i_geo_id_count, @
i_geo_id_list, @
Main Index
850
Code Examples
i_text_len_max, @
s_text )
i_return_value = @
lp_geometry_text @
( i_geo_keyword, @
i_geo_id_count, @
i_geo_id_list, @
i_text_len_max, @
s_text )
lp_keyword_text ()
STRING s_text[32]
INTEGER i_return_value
# -------------------------------------------------------------------
# Calling the function with family “LpGEOMETRY” and keyword “LpPOINT”
# Both from “lpkeywords.i”
#
i_keyword=1 /* from lpkeywords.i for LpPOINT */
i_family =3 /* from lpkeywords.i for LpGEOMETRY */
i_return_value = @
lp_keyword_text @
( i_keyword, @
i_family, @
s_text )
i_return_value = @
lp_keyword_text @
( i_keyword, @
i_family, @
s_text )
msg_format_string ()
# msg_format_string
# ( msgcode
# ints
# reals
# chars
# string )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_msgcode,i_ints(1)
REAL r_reals(1)
STRING s_chars[128],s_op_string[128]
INTEGER i_return_value
# -------------------------------------------------------------------
# Call the standard MSC.Patran message(from messages.database)
# To know the message related to i_msgcode, call msg_get_string()
# as follows.
# i_msgcode=36000003 (From utility FILE)
#
i_msgcode=36000003
msg_get_string(i_msgcode,s_op_string)
dump s_op_string
# Session file paused. Observe the string and press “Resume” to
# continue.
sf_pause()
i_ints(1)=0
r_reals(1)=0.0
s_chars=”new.db”
i_return_value = @
msg_format_string @
( i_msgcode, @
i_ints, @
r_reals, @
s_chars, @
s_op_string )
dump i_return_value
dump s_op_string
# Compare this formatted output with the previous one.
# Press “Resume” to continue session file.
sf_pause()
# -------------------------------------------------------------------
# Call the user message from user_message.database
# Again to know the message related to i_msgcode, call
# msg_get_string() as follows.
# i_msgcode=1000000001
#
i_msgcode=1000000001
msg_get_string(i_msgcode,s_op_string)
dump s_op_string
i_ints(1)=10
r_reals(1)=10.0
s_chars=”new.db”
i_return_value = @
msg_format_string @
( i_msgcode, @
i_ints, @
r_reals, @
s_chars, @
s_op_string )
dump i_return_value
dump s_op_string
msg_get_application ()
# -------------------------------------------------------------------
i_return_value = @
msg_get_application @
( i_msgcode )
dump i_return_value
# -------------------------------------------------------------------
Main Index
854
Code Examples
msg_string_more ()
# -------------------------------------------------------------------
# Call the message with msg_code=36000001 from the messages.database
# Format the message using the following parameters.
# i_msgcode=36000001
# i_msgtype=4 ( value 4 stands for error message )
# i_appcode=36000000
# i_ints(1)=0
# r_reals(1)=0.0
# s_chars=”new.db”
#
i_msgcode=36000001
i_msgtype=4
i_appcode=36000000
i_ints(1)=10
r_reals(1)=10.0
s_chars=”new.db”
msg_to_form @
( i_msgcode, @
i_msgtype, @
i_appcode, @
i_ints, @
r_reals, @
s_chars )
i_return_value = @
msg_to_string @
( i_msgcode, @
i_msgtype, @
i_appcode, @
i_ints, @
r_reals, @
s_chars, @
s_op_string )
dump i_return_value
Main Index
CHAPTER 5 855
User Interface
dump s_op_string
WHILE ( 0 != i_return_value )
i_return_value = @
msg_string_more @
( s_op_string )
dump i_return_value
dump s_op_string
END WHILE
# Note that function msg_string_more() gets the next piece of message
# string till the end of the message.
# -------------------------------------------------------------------
msg_to_file ()
# -------------------------------------------------------------------
# Call the message with msg_code=36000001 from the messages.database
# Format the message using the following parameters.
# i_msgcode=36000001
# i_msgtype=4 ( value 4 stands for error message )
# i_appcode=36000000
# i_ints(1)=0
# r_reals(1)=0.0
# s_chars=”new.db”
# i_maxout = 1
#
i_msgcode=36000001
i_msgtype=4
Main Index
856
Code Examples
i_appcode=36000000
i_ints(1)=0
r_reals(1)=0.0
s_chars=”new.db”
i_maxout = 1
msg_to_form @
( i_msgcode, @
i_msgtype, @
i_appcode, @
i_ints, @
r_reals, @
s_chars )
i_return_value=text_open(“msg.file”,”NOWA”,0,0,i_chan)
dump i_return_value
i_return_value = @
msg_to_file @
( i_msgcode, @
i_msgtype, @
i_appcode, @
i_ints, @
r_reals, @
s_chars, @
i_maxout, @
i_chan )
dump i_return_value
text_close(i_chan,””)
# -------------------------------------------------------------------
msg_to_string ()
STRING s_chars[128],s_op_string[128]
INTEGER i_return_value
# -------------------------------------------------------------------
# Call the message with msg_code=36000001 from the messages.database
# Format the message using the following parameters.
# i_msgcode=36000001
# i_msgtype=4 ( value 4 stands for error message )
# i_appcode=36000000
# i_ints(1)=0
# r_reals(1)=0.0
# s_chars=”new.db”
#
i_msgcode=36000001
i_msgtype=4
i_appcode=36000000
i_ints(1)=10
r_reals(1)=10.0
s_chars=”new.db”
msg_to_form @
( i_msgcode, @
i_msgtype, @
i_appcode, @
i_ints, @
r_reals, @
s_chars )
i_return_value = @
msg_to_string @
( i_msgcode, @
i_msgtype, @
i_appcode, @
i_ints, @
r_reals, @
s_chars, @
s_op_string )
dump i_return_value
dump s_op_string
WHILE ( 0 != i_return_value )
i_return_value = @
msg_string_more @
( s_op_string )
dump i_return_value
dump s_op_string
END WHILE
# -------------------------------------------------------------------
Main Index
858
Code Examples
notemessage.text ()
# -------------------------------------------------------------------
# Assign values to the variables.
# s_label = “Warning”
# s_message = “You are closing the current database.” // @
# “Do you really want to?”
#
s_label = “Warning”
s_message = “You are closing the current database.” // @
“ Do you really want to?”
notemessage.text @
( s_label, s_message )
# -------------------------------------------------------------------
ui_add_help ()
ui_exec_function(“USER_FORM”,”display”)
#---------------------------------------------------------------------
# Create a frame maker file by calling ui_form_to_frame().This will
# create a file “USER_FORM.mif” in the working directory. To execute
# this function, USER_FORM should be displayed.
ui_form_to_frame(“USER_FORM”)
s_keyword = “user_form_help”
ui_register_help( w_form_id,s_keyword )
s_path = “./USER_FORM.mif”
s_marker = “framemaker_hypertext_marker”
i_return_value = @
ui_add_help @
( s_keyword, @
s_path, @
s_marker )
# After seeing the help file, Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
ui_clear_focus ()
ui_exec_function(“USER_FORM”, “display”)
# The form “USER_FORM” is displayed.
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Call the function get_widget_ids()to get the widget id of the
# databox widget. This function is in user_form.pcl
#
USER_FORM.get_widget_ids(w_wid_ids)
#---------------------------------------------------------------------
ui_exec_command ()
ui_form_delete ()
# Purpose : This file provides an example of a call to the
# function ui_form_delete()
#
# First a medium width half height sized form,
# “USER_FORM”, which contains several widgets is
# created using user_form.pcl. Then the form is
# deleted using ui_form_delete().
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# This file can be run by starting a session of
# MSC.Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
Main Index
862
Code Examples
ui_exec_function(“USER_FORM”, “display”)
# Session file paused to observe the form.
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Delete the form by calling ui_form_delete()
#
s_class = “USER_FORM”
ui_form_delete @
( s_class )
#---------------------------------------------------------------------
ui_form_exists ()
# Purpose : This file provides an example of a call to the
# function ui_form_exists()
#
# First a medium width half height sized form,
# “USER_FORM”, which contains several widgets is
# created using user_form.pcl.Then the function
# ui_form_exists() is called to check whether
# the form exists.
#
# The user_form.pcl contains an include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# This file can be run by starting a session of
# MSC.Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function ui_form_exists() has the following arguments:
# ui_form_exists
# ( class )
#---------------------------------------------------------------------
# Variable Declarations
STRING s_class[128]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC.Patran
Main Index
CHAPTER 5 863
User Interface
s_class = “USER_FORM”
#---------------------------------------------------------------------
# Call the function ui_form_exits() with s_class=”USER_FORM” to check
# whether the USER_CLASS exists or not.
#
l_return_value = @
ui_form_exists @
( s_class )
dump l_return_value
l_return_value = @
ui_form_exists @
( s_class )
dump l_return_value
ui_wid_exit()
#---------------------------------------------------------------------
# Call the function ui_form_exists() to check whether USER_FORM
# exists now.
l_return_value = @
ui_form_exists @
( s_class )
dump l_return_value
ui_form_is_displayed ()
s_class = “USER_FORM”
dump l_return_value
ui_exec_function(s_class, “display”)
#---------------------------------------------------------------------
# Call the function to check whether the form is displayed or not.
#
l_return_value = @
Main Index
CHAPTER 5 865
User Interface
ui_form_is_displayed @
( s_class )
dump l_return_value
dump l_return_value
dump l_return_value
#---------------------------------------------------------------------
ui_form_is_displayed ()
ui_exec_function(“USER_FORM”, “display”)
#---------------------------------------------------------------------
# Call the function to check whether the form is displayed or not.
#
s_class = “user_form”
l_return_value = @
ui_form_is_displayed @
( s_class )
Main Index
CHAPTER 5 867
User Interface
ui_get_client ()
# The X Client is
dump s_client_info
#---------------------------------------------------------------------
ui_get_help ()
ui_exec_function(“USER_FORM”,”display”)
#---------------------------------------------------------------------
# Create a frame maker file by calling ui_form_to_frame().This will
# create a file “USER_FORM.mif” in the working directory. To execute
# this function, USER_FORM should be displayed.
ui_form_to_frame(“USER_FORM”)
s_help = “user_form_help”
ui_register_help @
( w_wid, @
s_help )
s_help = ““
ui_get_help @
( w_wid, @
s_help )
#---------------------------------------------------------------------
# Add a record to the help table, providing the connection between
# keyword and the help file.Here the help file “USER_FORM.mif” is
# in the working directory.
s_path = “./USER_FORM.mif”
s_marker = “hypertext_marker”
i_return_value = @
ui_add_help @
( s_help, @
s_path, @
s_marker )
dump i_return_value
#---------------------------------------------------------------------
ui_get_server ()
# X Server is:
dump s_server_info
#---------------------------------------------------------------------
ui_graph_create ()
ui_exec_function(“USER_GRAPH”, “display”)
ui_graph_create ()
# name,
# x,
# y,
# width,
# height )
#
#---------------------------------------------------------------------
# Compile and make the functions in user_graph.pob available to
# MSC.Patran
ui_exec_function(“USER_GRAPH”, “display”)
ui_is_initialized ()
dump l_is_initialised
#---------------------------------------------------------------------
ui_register_help ()
ui_exec_function(“USER_FORM”,”display”)
#---------------------------------------------------------------------
# Create a frame maker file by calling ui_form_to_frame().This will
# create a file “USER_FORM.mif” in the working directory. To execute
# this function, USER_FORM should be displayed.
ui_form_to_frame(“USER_FORM”)
s_help = “user_form_help”
ui_register_help @
( w_wid, @
s_help )
#---------------------------------------------------------------------
# Add a record to the help table, providing the connection between
# keyword and the help file.Here the help file “USER_FORM.mif” is
# in the working directory.
Main Index
CHAPTER 5 873
User Interface
s_path = “./USER_FORM.mif”
s_marker = “hypertext_marker”
i_return_value = @
ui_add_help @
( s_help, @
s_path, @
s_marker )
ui_write(s_info)
#---------------------------------------------------------------------
ui_sys_command ()
l_return_value = @
ui_sys_command @
( s_cmd )
xf_write_stdout(“-----------------------------------------------”)
Main Index
874
Code Examples
ui_sys_return ()
ui_text_select ()
Main Index
CHAPTER 5 875
User Interface
ui_exec_function(“USER_FORM”, “display”)
#---------------------------------------------------------------------
# The form “USER_FORM” is displayed.Cursor select the text in the
# text widget. Press “Resume” to continue the session file.
sf_pause()
# As the function call informs, the text widget is the second element
# in w_wid_ids. Assigning this value to w_textwid
#
w_textwid = w_wid_ids(2)
#---------------------------------------------------------------------
# Call the function to return the text selected and its left and
# right position in the string in which it resides.
#
ui_text_select @
( w_textwid, @
i_left, @
i_right, @
s_vstr )
sys_free_array(w_wid_ids)
# Press “OK” to delete the form “USER_FORM”.
#---------------------------------------------------------------------
ui_text_select ()
ui_exec_function(“USER_FORM”, “display”)
#---------------------------------------------------------------------
# The form “USER_FORM” is displayed.Cursor select the text in the
# text widget. Press “Resume” to continue the session file.
sf_pause()
# As the function call informs, the text widget is the second element
# in w_wid_ids. Assigning this value to w_textwid
#
w_textwid = w_wid_ids(2)
dump str_length(s_vstr)
#---------------------------------------------------------------------
# Call the function to return the text selected and its left and
# right position in the string in which it resides.
#
ui_text_select @
( w_textwid, @
i_left, @
i_right, @
s_vstr )
sys_free_array(w_wid_ids)
sys_free_string(s_vstr)
#
#---------------------------------------------------------------------
ui_wid_exit ()
ui_exec_function(“USER_FORM”, “display”)
#---------------------------------------------------------------------
# Session file paused. Observe the form and press “Resume” to
# continue.
sf_pause()
ui_wid_exit()
#---------------------------------------------------------------------
ui_wid_hide_forms ()
ui_exec_function(“USER_FORM”, “display”)
# Session file paused to notice the form. Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Calling the function with s_parm=”NONMODAL” to hide all non modal
# forms. Note that form “USER_FORM” is an non modal form.
#
s_parm = “NONMODAL”
ui_wid_hide_forms @
( s_parm )
ui_form_display(“USER_FORM”)
#---------------------------------------------------------------------
ui_wid_restore_widget ()
#
# The user_form.pcl contains a include file.
# To expand the symbols defined in the included
# file and to create a file “user_form.pob”
# C preprocessor should be used. A command line
# command such as : cpp -I$P3_HOME/customization
# user_form.pcl user_form.pob can be used to
# generate a file user_form.pob.
# See the Part 9:PCL and Customization Chapter 3
# C Preprocessor for more information.
#
# This file can be run by starting a session of
# MSC.Patran and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function ui_wid_save_widget() has the following arguments:
# ui_wid_restore_widget
# ( wid )
#
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_wid,w_lbox_id,w_text_id
LOGICAL l_return_value
STRING sa_list[16](2) = [“First”,”Second”]
INTEGER i_listcnt
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC.Patran
!!COMPILE user_form.pob user_form.plb
!!LIBRARY ADD user_form.plb
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the form widget is the first element
# in wa_wid_ids. Similarly, list box widget is the forth element in
# wa_wid_ids.Assigning these values
#
w_wid = wa_wid_ids(1)
w_text_id = wa_wid_ids(2)
w_lbox_id = wa_wid_ids(4)
l_return_value = @
ui_wid_save_widget @
( w_wid )
dump l_return_value
sf_pause()
#---------------------------------------------------------------------
# Change the values of the widgets.
# New text is set in text widget. List box items deleted.
ui_wid_set @
( w_text_id, @
“VALUE”, @
“Changed Text” )
uil_utils_listbox.delete_item_list @
( w_lbox_id, @
i_listcnt, @
sa_list)
sf_pause()
#---------------------------------------------------------------------
# Restore the original values of USER_FORM
l_return_value = @
ui_wid_restore_widget @
( w_wid )
dump l_return_value
ui_wid_save_widget ()
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_wid,w_lbox_id,w_text_id
LOGICAL l_return_value
STRING sa_list[16](2) = [“First”,”Second”]
INTEGER i_listcnt
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC.Patran
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the form widget is the first element
# in wa_wid_ids. Similarly, list box widget is the forth element in
# wa_wid_ids.Assigning these values
#
w_wid = wa_wid_ids(1)
w_text_id = wa_wid_ids(2)
w_lbox_id = wa_wid_ids(4)
l_return_value = @
ui_wid_save_widget @
( w_wid )
dump l_return_value
sf_pause()
#---------------------------------------------------------------------
# Change the values of the widgets.
# New text is set in text widget. List box items deleted.
ui_wid_set @
( w_text_id, @
“VALUE”, @
“Changed Text” )
uil_utils_listbox.delete_item_list @
( w_lbox_id, @
i_listcnt, @
sa_list)
sf_pause()
#---------------------------------------------------------------------
# Restore the original values of USER_FORM
l_return_value = @
ui_wid_restore_widget @
( w_wid )
dump l_return_value
uid_get_border_sizes ()
uid_get_border_sizes @
( i_type, @
l_pos_is_frame, @
i_leftoffset, @
i_topoffset, @
i_rightoffset, @
i_bottomoffset )
# Setting of PositionIsFrame
dump l_pos_is_frame
# -------------------------------------------------------------------
uid_get_font_heights ()
uid_get_font_heights @
( i_font_h, @
i_textfont_h, @
i_spreadfont_h )
# -------------------------------------------------------------------
uid_get_screen_info ()
uid_get_screen_info @
( i_xpix, @
i_ypix, @
i_xpixperinch, @
i_ypixperinch, @
i_value )
uid_set_sys_pix ()
uid_set_sys_pix @
( r_pix_per_inch, @
r_new_disp_factor )
#---------------------------------------------------------------------
INTEGER i_xpix,i_ypix
INTEGER i_xpixperinch,i_ypixperinch
INTEGER i_value
# -------------------------------------------------------------------
# Call the function to get the screen information.
uid_get_screen_info @
( i_xpix, @
i_ypix, @
i_xpixperinch, @
i_ypixperinch, @
i_value )
uil_app_analysis.get_real_name
uil_file_open.go(“spool.db”)
# db_get_default_anal_code().
#
db_get_default_anal_code( s_user_name )
# The current analysis code name is
dump s_user_name
i_return_value = @
uil_app_analysis.get_real_name @
( s_user_name, @
s_real_name )
uil_pcntcomplete.close
#---------------------------------------------------------------------
# Initializing the scale.
uil_pcntcomplete.initlz(label)
uil_pcntcomplete.update(40.0)
#---------------------------------------------------------------------
# Using the function uil_pcntcomplete.close() to close the scale.
uil_pcntcomplete.close()
#----------------------------------------------------------------------
# End of file
uil_pcntcomplete.initlz
#
# The function uil_pcntcomplete.initlz()
# has the following arguments:
#
# uil_pcntcomplete.initlz
# (
# label )
#
#---------------------------------------------------------------------
# Variable Initialization
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Using the function uil_pcntcomplete.initlz() to start the ruler
# scale.
uil_pcntcomplete.initlz(label)
uil_pcntcomplete.update(40.0)
#---------------------------------------------------------------------
# Closes the scale to be used for the label 'My_scale'.
# uil_pcntcomplete.close()
#----------------------------------------------------------------------
# End of file
uil_primary.get_menubar_id ()
dump w_return_value
#---------------------------------------------------------------------
Main Index
888
Code Examples
uil_utils_listbox.append_list ()
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 2
uil_utils_listbox.create_list @
( w_lbox_id, @
Main Index
CHAPTER 5 889
User Interface
sa_labellist_c, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Append the list by calling uil_utils_listbox.append_list().
#
i_listcnt = 1
uil_utils_listbox.append_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
sys_free_array(wa_wid_ids)
# Press “OK” to delete the USER_FORM
#---------------------------------------------------------------------
uil_utils_listbox.create_list ()
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 2
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
# Session file paused to observe the List box widget in USER_FORM
# Press “Resume” to continue.
sf_pause()
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.delete_item ()
# ( lbox_id,
# name )
#---------------------------------------------------------------------
# Variable Declarations
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt
STRING sa_labellist[8](3)=[“List 1”,”List 2”,”List 3”]
STRING s_name[16]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC.Patran
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
l_return_value = @
uil_utils_listbox.delete_item @
( w_lbox_id, @
s_name )
Main Index
892
Code Examples
uil_utils_listbox.delete_item_list ()
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
Main Index
CHAPTER 5 893
User Interface
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
i_nitems = 2
l_return_value = @
uil_utils_listbox.delete_item_list @
( w_lbox_id, @
i_nitems , @
sa_itemlist)
dump l_return_value
# Observe the item deleted and remaining in the List Box widget.
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.delete_selected ()
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist_c, @
i_listcnt )
i_listcnt = 2
l_return_value = @
uil_utils_listbox.select_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
dump l_return_value
# Session file stopped to observe the selected items in the List Box
# Widget.Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Get the selected items in the list box.
uil_utils_listbox.delete_selected @
( w_lbox_id )
Main Index
CHAPTER 5 895
User Interface
uil_utils_listbox.get_all ()
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist_c, @
Main Index
896
Code Examples
i_listcnt )
sys_allocate_string(svv_items, 16)
sys_allocate_array(svv_items,1,3)
uil_utils_listbox.get_all @
( w_lbox_id, @
svv_items, @
i_num )
#---------------------------------------------------------------------
uil_utils_listbox.get_selected ()
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt, i_num
STRING sa_labellist_c[8](3) = [“List 1”,”List 2”,”List 3”]
STRING sa_labellist[8](2) = [“List 2”, “List 3”]
STRING sav_items[16](VIRTUAL)
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC.Patran
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist_c, @
i_listcnt )
i_listcnt = 2
l_return_value = @
uil_utils_listbox.select_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
dump l_return_value
# Session file stopped to observe the selected items in the List Box
# Widget.Press “Resume” to continue.
sf_pause()
#---------------------------------------------------------------------
# Get the selected items in the list box.
uil_utils_listbox.get_selected @
( w_lbox_id, @
sav_items, @
i_num )
dump sav_items
uil_utils_listbox.get_unselected ()
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist_c, @
i_listcnt )
i_listcnt = 2
l_return_value = @
uil_utils_listbox.select_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
dump l_return_value
uil_utils_listbox.get_unselected @
( w_lbox_id, @
sav_items, @
i_num )
uil_utils_listbox.select ()
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
l_return_value = @
uil_utils_listbox.select @
( w_lbox_id, @
s_label )
Main Index
CHAPTER 5 901
User Interface
dump l_return_value
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.select_all ()
WIDGET wa_wid_ids(VIRTUAL),w_lbox_id
INTEGER i_listcnt
STRING sa_labellist[8](3) = [“List 1”,”List 2”,”List 3”]
LOGICAL l_return_value
#---------------------------------------------------------------------
# Compile and make the functions in user_form.pob available to MSC.Patran
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
Main Index
902
Code Examples
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
uil_utils_listbox.select_all @
( w_lbox_id )
uil_utils_listbox.select_list ()
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist_c, @
i_listcnt )
i_listcnt = 2
l_return_value = @
uil_utils_listbox.select_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
dump l_return_value
# Press “OK” to delete the form.
sys_free_array(wa_wid_ids)
#---------------------------------------------------------------------
uil_utils_listbox.select_none ()
ui_exec_function(“USER_FORM”, “display”)
# As the function call informs, the list box widget is the forth
# element in wa_wid_ids. Assigning this value to w_lbox_id
#
w_lbox_id = wa_wid_ids(4)
#---------------------------------------------------------------------
# Create a list by calling the function.
#
i_listcnt = 3
uil_utils_listbox.create_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
l_return_value = @
uil_utils_listbox.select_list @
( w_lbox_id, @
sa_labellist, @
i_listcnt )
dump l_return_value
# Session file paused to observe the selected items in list box
# widget. Press “Resume to continue”
Main Index
CHAPTER 5 905
User Interface
sf_pause()
#---------------------------------------------------------------------
# Clear all selected (Highlighted) items in the list box.
l_return_value = @
uil_utils_listbox.select_none @
( w_lbox_id )
user_message ()
# -------------------------------------------------------------------
# Call the user_message() with following parameters :
# s_type = “C_YN_Y”
# i_appcode=1000000101
# s_appname=”FILE”
# s_message = “Database does not exist. Do you wish to “ // @
# “ create a new database? “
#
s_type = “C_YN_Y”
i_appcode = 1000000101
s_appname = “FILE”
s_message = “Database does not exist. Do you wish to “ // @
“ create a new database? “
i_return_value = @
user_message @
( s_type, @
i_appcode, @
s_appname, @
s_message )
dump i_return_value
Main Index
906
Code Examples
# Note that the i_return_value depends upon your answer YES/NO to the
# question in the form displayed.This can be used further in any
# application.( A sample is given below )
# -------------------------------------------------------------------
Main Index
MSC.Acumen, Volume 2: Code Examples
CHAPTER
Group
6
■ Introduction
Main Index
908
Code Examples
6.1 Introduction
This chapter provides code examples for the PCL function described in Volume 1. These
examples are designed so that they can be cut and pasted into a file and, by following the
instructions listed with each example, executed in MSC.Patran.
asm_db_count_asm_in_group ()
asm_db_count_asm_in_group @
( i_groupId, @
i_count, @
i_status )
# Checking the success of the call
dump i_status
asm_db_count_asm_in_group @
( i_groupId, @
i_count, @
i_status )
# -------------------------------------------------------------------
asm_db_get_grids_in_group ()
asm_db_count_asm_in_group @
( i_groupId, @
i_count, @
i_status )
i_count_c = i_count(1)
#Allocate memory
SYS_ALLOCATE_ARRAY(i_gridLabels,1,i_count_c)
SYS_ALLOCATE_ARRAY(r_xyzCoordinates,1,3*i_count_c)
# Get the grid labels for the grids of the default group.
dump i_gridLabels
# Get the xyz coordinates for the grids of the default group.
dump r_xyzCoordinates
SYS_FREE_ARRAY( i_gridLabels )
SYS_FREE_ARRAY( r_xyzCoordinates )
# -------------------------------------------------------------------
asm_db_get_hpats_in_group ()
INTEGER i_groupid,i_status
INTEGER i_hpatlabels( 1 )
INTEGER i_hpatvertexIds( 8 )
REAL r_geometriccoeff(192)
STRING s_asm_create_hpat[ VIRTUAL ]
# -------------------------------------------------------------------
#
# opening a new database new.db
uil_file_new.go(““,”new.db”)
$? YES 36000002
# Get the labels ,vertex ids and xyz coordinates of the line entity.
asm_db_get_hpats_in_group @
( i_groupid, @
i_hpatlabels, @
i_hpatvertexIds, @
r_geometriccoeff, @
i_status )
#
# Get the success or error code.
dump i_status
# Get the hpat labels for the hpats of the default group.
dump i_hpatlabels
# Get the hpat labels for the hpats of the default group.
dump i_hpatvertexIds
# Get the xyz coordinates for the hpats of the default group.
dump r_geometriccoeff
SYS_FREE_STRING(s_asm_create_hpat )
# -------------------------------------------------------------------
asm_db_get_lines_in_group ()
#i_count_c = i_count(2)
i_count_c = i_count(2)
#Allocate memory
SYS_ALLOCATE_ARRAY(i_linelabels,1,i_count_c)
asm_db_get_lines_in_group @
( i_groupid, @
i_linelabels, @
r_geometriccoefficients, @
i_status )
#
dump i_status
# Get the line labels for the lines of the default group.
dump i_linelabels
# Get the xyz coordinates for the lines of the default group.
dump r_geometriccoefficients
SYS_FREE_ARRAY( i_linelabels )
SYS_FREE_ARRAY( r_geometriccoefficients )
# -------------------------------------------------------------------
Main Index
CHAPTER 6 913
Group
asm_db_get_patches_in_group ()
# Get the patch labels for the patches of the default group.
dump i_patchlabels
# Get the xyz coordinates for the patches of the default group.
dump r_geometriccoefficients
SYS_FREE_STRING(s_asm_create_patch)
# -------------------------------------------------------------------
Main Index
914
Code Examples
count_orphan_elements ()
i_grp_id = 2
i_return_value = @
count_orphan_elements @
( i_count )
#
dump i_return_value
# The number of orphan elements are
dump i_count
ga_group_entity_add( s_name,”Element 1:250” )
Main Index
CHAPTER 6 915
Group
i_return_value = @
count_orphan_elements @
( i_count )
#
dump i_return_value
# The number of orphan elements are
dump i_count
count_orphan_nodes ()
STRING s_name[32]
INTEGER i_return_value
# -------------------------------------------------------------------
#
# opening a existing database spool.db
uil_file_open.go(“spool.db”)
i_grp_id = 2
i_return_value = @
count_orphan_nodes @
( i_count )
#
dump i_return_value
# The number of orphan nodes are
dump i_count
i_return_value = @
count_orphan_nodes @
( i_count )
#
dump i_return_value
# The number of orphan nodes are
dump i_count
# -------------------------------------------------------------------
Main Index
CHAPTER 6 917
Group
db_add_mpc_to_group ()
uil_file_open.go(“mpc.db”)
# The database mpc.db has eight MPCs.
# There are five groups in the database mpc.db.
# There is one MPC entity in the second group.
# We add one more entity to it.
l_visible = TRUE
i_gid = 2
db_get_group_name @
( i_gid, @
s_name )
dump i_count
# i_mpc_id = 4
i_mpc_id = 4
# Add a MPC entity to the group
i_return_value = @
db_add_mpc_to_group @
( i_mpc_id, @
i_gid, @
l_visible )
dump i_return_value
db_count_entities_in_group @
( s_name, @
i_type, @
i_count )
# Compare the two counts and see the effect of addition
dump i_count
# -------------------------------------------------------------------
db_count_entities_in_group ()
# -------------------------------------------------------------------
# open the existing database spool.db
uil_file_open.go(“spool.db”)
# get the current group id (fem group)
db_get_current_group_id( i_grp_id )
db_get_group_name @
( i_grp_id, @
s_name )
dump i_return_value
Main Index
CHAPTER 6 919
Group
# -------------------------------------------------------------------
db_count_groups_for_entity ()
# -------------------------------------------------------------------
# open the existing database spool.db
uil_file_open.go(“spool.db”)
#i_id = 1
i_id = 1
i_return_value = @
db_count_groups_for_entity @
( i_id, @
i_type, @
i_count )
dump i_return_value
# The node entity is only in the fem_model group. i.e. just one group.
dump i_count
# -------------------------------------------------------------------
Main Index
920
Code Examples
db_count_groups_using_mpc ()
# -------------------------------------------------------------------
#
# opening a existing database mpc.db
uil_file_open.go(“mpc.db”)
# i_nmpc = 3
# i_mpcid = [4,3,6]
# memory allocation
SYS_ALLOCATE_ARRAY(i_mpcid,1,3)
SYS_ALLOCATE_ARRAY(i_ngroup,1,3)
i_nmpc = 3
i_mpcid = [4,3,6]
i_return_value = @
db_count_groups_using_mpc @
( i_nmpc, @
i_mpcid, @
i_ngroup, @
i_flag )
#
dump i_return_value
dump i_flag
# the number of groups using MPC id 4,3,6.
dump i_ngroup
SYS_FREE_ARRAY(i_mpcid)
SYS_FREE_ARRAY(i_ngroup)
# -------------------------------------------------------------------
Main Index
CHAPTER 6 921
Group
db_count_orphan_curves ()
uil_file_open.go(“spool.db”)
i_return_value = @
db_count_curve @
( i_count )
dump i_return_value
dump i_count
i_return_value = @
db_count_orphan_curves @
( i_count )
#
dump i_return_value
# The number of orphan curves are
dump i_count
i_grp_id = 1
# Now remove some of the curves from the group, increasing the
# number of orphan curves.
#
i_return_value = db_get_group_name( i_grp_id,s_name )
dump i_return_value
dump s_name
Main Index
922
Code Examples
i_return_value = @
db_count_curve @
( i_count )
dump i_return_value
dump i_count
i_return_value = @
db_count_orphan_curves @
( i_count )
#
dump i_return_value
# The number of orphan curves are
dump i_count
i_return_value = @
db_count_curve @
( i_count )
dump i_return_value
dump i_count
i_return_value = @
db_count_orphan_curves @
( i_count )
#
dump i_return_value
# The number of orphan curves are
dump i_count
# -------------------------------------------------------------------
db_count_orphan_curves ()
uil_file_open.go(“spool.db”)
i_return_value = @
db_count_curve @
( i_count )
dump i_return_value
dump i_count
i_return_value = @
db_count_orphan_curves @
( i_count )
#
dump i_return_value
# The number of orphan curves are
dump i_count
i_grp_id = 1
# Now remove some of the curves from the group, increasing the
# number of orphan curves.
#
i_return_value = db_get_group_name( i_grp_id,s_name )
dump i_return_value
dump s_name
i_return_value = @
db_count_curve @
( i_count )
dump i_return_value
dump i_count
i_return_value = @
db_count_orphan_curves @
( i_count )
#
dump i_return_value
# The number of orphan curves are
dump i_count
i_return_value = @
db_count_curve @
( i_count )
dump i_return_value
dump i_count
i_return_value = @
db_count_orphan_curves @
( i_count )
#
dump i_return_value
# The number of orphan curves are
dump i_count
# -------------------------------------------------------------------
db_count_orphan_mpcs ()
i_return_value = @
db_count_orphan_mpcs @
( i_count )
#
dump i_return_value
dump i_count
i_return_value = @
db_count_orphan_mpcs @
( i_count )
#
dump i_return_value
dump i_count
i_return_value = @
db_count_orphan_mpcs @
( i_count )
#
dump i_return_value
dump i_count
ga_group_entity_add( s_name,”MPC 3:3” )
ga_group_entity_add( s_name0,”MPC 3:3” )
# -------------------------------------------------------------------
db_count_orphan_points ()
#
# Before running this file the database should be
# created by running the session file “spool.ses”
# To run this session file,first start a session
# of MSC.Patran,then run this session file by
# “File”,”Session”,”Play” pulldown menus on the
# menu bar.
#
# The db_count_orphan_points has the following arguments:
# db_count_orphan_points
# ( count )
#
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_count
INTEGER i_return_value
# -------------------------------------------------------------------
#
# opening a existing database spool.db
uil_file_open.go(“spool.db”)
i_return_value = @
db_count_orphan_points @
( i_count )
#
dump i_return_value
# the number of orphan points are
dump i_count
ga_group_entity_add(“default_group”,”Point 9:10”)
# -------------------------------------------------------------------
db_count_orphan_solids ()
#
INTEGER i_count
STRING s_created_ids[VIRTUAL]
INTEGER i_return_value
# -------------------------------------------------------------------
#open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
SYS_ALLOCATE_STRING(s_created_ids,32)
# Create a solid in this new database
asm_const_hpat_xyz(“1”,”<1 1 1>”,”[0 0 0]”,”coord 0”,s_created_ids)
i_return_value = @
db_count_orphan_solids @
( i_count )
#
dump i_return_value
# The number of orphan solids are
dump i_count
SYS_FREE_STRING(s_created_ids)
# -------------------------------------------------------------------
db_count_orphan_surfaces ()
uil_file_open.go(“spool.db”)
i_return_value = @
db_count_orphan_surfaces @
( i_count )
#
dump i_return_value
# the number of orphan surfaces are
dump i_count
ga_group_entity_add(“default_group”,”Surface 3:4”)
# -------------------------------------------------------------------
db_get_group_name ()
# -------------------------------------------------------------------
# open the existing database spool.db
uil_file_open.go(“spool.db”)
# get the current group (fem_model group)
db_get_current_group_id( i_grp_id )
i_return_value = @
db_get_group_name @
( i_grp_id, @
s_name )
#
dump i_return_value
# dumps the current group i.e fem_model
dump s_name
# -------------------------------------------------------------------
Main Index
CHAPTER 6 929
Group
db_get_groups_for_entity ()
# -------------------------------------------------------------------
# open the existing database spool.db
uil_file_open.go(“spool.db”)
#i_id = 1
i_id = 1
# get the count of the groups having a id ‘1’ and type node.
# this will be used for allocation of memory to group_list.
db_count_groups_for_entity @
( i_id, @
i_type, @
i_count )
SYS_ALLOCATE_ARRAY( i_group_list,1,i_count )
i_return_value = @
db_get_groups_for_entity @
( i_id, @
i_type, @
i_count, @
i_group_list )
dump i_return_value
# group list contains the group id having node entity and entity id 1
Main Index
930
Code Examples
# the fem_model group contains this entity and has the id =2.
dump i_group_list
SYS_FREE_ARRAY(i_group_list)
# -------------------------------------------------------------------
db_get_groups_using_mpc ()
# -------------------------------------------------------------------
#
# opening a existing database mpc.db
uil_file_open.go(“mpc.db”)
# i_nmpc = 3
# i_maxgrp = 2
# i_mpcid = [1,2,3]
# memory allocation
SYS_ALLOCATE_ARRAY(i_mpcid,1,3)
SYS_ALLOCATE_ARRAY(i_ngroup,1,3)
# array size for i_gid is i_maxgrp x i_nmpc.
SYS_ALLOCATE_ARRAY(i_gid,1,6)
i_nmpc = 3
i_maxgrp = 2
i_mpcid = [1,2,3]
i_return_value = @
Main Index
CHAPTER 6 931
Group
db_get_groups_using_mpc @
( i_nmpc, @
i_mpcid, @
i_maxgrp, @
i_ngroup, @
i_gid )
#
dump i_return_value
# the number of groups using MPC id 1,2,3.
dump i_ngroup
# The ids of the groups contaning these MPC ids.There are two spaces
# allocated for groups per MPCs.
dump i_gid
SYS_FREE_ARRAY(i_mpcid)
SYS_FREE_ARRAY(i_ngroup)
SYS_FREE_ARRAY(i_gid)
# -------------------------------------------------------------------
db_get_orphan_curves ()
uil_file_open.go(“spool.db”)
i_return_value = @
db_count_orphan_curves @
( i_count )
dump i_return_value
Main Index
932
Code Examples
dump i_count
#
# allocate memory
SYS_ALLOCATE_ARRAY(i_entity_id,1,i_count)
# -------------------------------------------------------------------
db_get_orphan_mpcs ()
uil_file_open.go(“mpc.db”)
db_count_orphan_mpcs @
( i_count )
#
dump i_count
i_return_value = @
db_get_orphan_mpcs @
( i_count, @
i_entity_id )
#
dump i_return_value
# Orphan entity ids are
dump i_entity_id
ga_group_entity_add( s_name,”MPC 1:2” )
SYS_FREE_ARRAY( i_entity_id )
# -------------------------------------------------------------------
db_get_orphan_points ()
uil_file_open.go(“spool.db”)
Main Index
934
Code Examples
i_return_value = @
db_get_orphan_points @
( i_count, @
i_entity_id )
dump i_return_value
# get the ids of the orphan points
dump i_entity_id
SYS_FREE_ARRAY(i_entity_id)
ga_group_entity_add(“default_group”,”Point 9:10”)
# -------------------------------------------------------------------
db_get_orphan_solids ()
SYS_ALLOCATE_STRING(s_created_ids,32)
dump i_return_value
# the ids of orphan solids are
dump i_entity_id
SYS_FREE_STRING(s_created_ids)
SYS_FREE_ARRAY(i_entity_id)
# -------------------------------------------------------------------
db_get_orphan_surfaces ()
uil_file_open.go(“spool.db”)
i_return_value = @
db_get_orphan_surfaces @
( i_count, @
i_entity_id )
dump i_return_value
# get the ids of the orphan surfaces
dump i_entity_id
SYS_FREE_ARRAY(i_entity_id)
ga_group_entity_add(“default_group”,”Surface 3:4”)
# -------------------------------------------------------------------
ga_group_color_get ()
# s_name=fem_model
s_name = “fem_model”
dump i_return_value
dump i_color
coloring_method(2)
# -------------------------------------------------------------------
ga_group_color_set ()
[“fem_model”])
# s_name=fem_model
s_name = “fem_model”
# i_color = 4
i_color = 4
dump i_return_value
coloring_method(2)
# -------------------------------------------------------------------
ga_group_current_get ()
i_return_value = @
ga_group_current_get @
( s_name )
dump i_return_value
# current group name is
dump s_name
# s_name=fem_model
s_name = “fem_model”
dump i_return_value
# current group name is
dump s_name
ga_group_current_set @
( “default_group” )
# -------------------------------------------------------------------
ga_group_deform_get ()
sf_play(“spool_res_deform.ses”)
coloring_method(2)
# s_name=fem_model
s_name = “fem_model”
dump i_return_value
# Deform flag is
dump i_flag
dump i_return_value
# Deform flag is
dump i_flag
# -------------------------------------------------------------------
ga_group_deform_set ()
#
# -------------------------------------------------------------------
# Variable Declaration
#
STRING s_name[32]
INTEGER i_flag,i_flag_c
INTEGER i_return_value
# -------------------------------------------------------------------
# Open the database “spool.db”
#uil_file_open.go(“spool.db”)
sf_play(“spool_res_deform.ses”)
coloring_method(2)
# s_name=fem_model
s_name = “fem_model”
dump i_return_value
ga_group_display_get ()
# s_name=fem_model
s_name = “fem_model”
dump i_return_value
dump s_dname_c
coloring_method(2)
ga_group_display_set @
( s_name, @
s_dname )
dump i_return_value
dump s_dname_c
ga_group_display_set @
( s_name, @
s_dname )
# -------------------------------------------------------------------
Main Index
CHAPTER 6 943
Group
ga_group_elem_scalar_get ()
# s_name = “fem_model”
s_name = “fem_model”
ga_group_current_set(“fem_model”)
db_get_current_group_id(i_cur_group_id)
ga_elem_scalar_create @
( s_title, @
i_nbr_elems, @
i_elem_ids, @
i_nbr_values, @
i_max_vals, @
r_scalars, @
i_id )
i_return_value = @
ga_group_elem_scalar_get @
( s_name, @
i_scalar_id )
dump i_return_value
# The Id of the scalar table got using the function
dump i_scalar_id
ga_elem_scalar_delete( i_id )
#---------------------------------------------------------------------
ga_group_elem_scalar_set ()
# s_name = “fem_model”
s_name = “fem_model”
ga_group_current_set(“fem_model”)
db_get_current_group_id(i_cur_group_id)
ga_elem_scalar_create @
( s_title, @
i_nbr_elems, @
i_elem_ids, @
i_nbr_values, @
i_max_vals, @
r_scalars, @
i_id )
dump i_return_value
Main Index
946
Code Examples
ga_elem_scalar_delete( i_id )
#---------------------------------------------------------------------
ga_group_entities_get ()
#
# Purpose : This file gives an example of a call to the
# function ga_group_entities_get()
#
# This function gets the sorted list of entities
# contained in a group.This file opens a database
# spool.db which has two groups “default_group”
# and “fem_model”group.The database has 600 node
# entities.This file gets the sorted list of
# nodes from 101 to 120.Then we remove entity 105
# and 111 and get the sorted list of the node
# entity.
#
# Before running this file the database should be
# created by running the session file “spool.ses”
# To run this session file, first start
# a session of MSC.Patran,then run this session
# file by “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The ga_group_entities_get has the following arguments:
# ga_group_entities_get
# ( name,
# type,
# range,
# number,
# entities )
# -------------------------------------------------------------------
# Variable Declaration
#
INTEGER i_type,i_number,i_range(3)
STRING s_name[32],s_entities[VIRTUAL]
INTEGER i_return_value
# -------------------------------------------------------------------
# opening the existing database spool.db
uil_file_open.go(“spool.db”)
# s_name=fem_model
s_name = “fem_model”
# get the sorted list of node entity associated with the group.
i_return_value = @
ga_group_entities_get @
( s_name, @
i_type, @
i_range, @
i_number, @
s_entities )
dump i_return_value
dump s_entities
# get the sorted list of node entity associated with the group.
i_return_value = @
ga_group_entities_get @
( s_name, @
i_type, @
i_range, @
i_number, @
s_entities )
dump i_return_value
dump s_entities
SYS_FREE_STRING( s_entities )
# -------------------------------------------------------------------
ga_group_exist_get ()
INTEGER i_flag
STRING s_name[32]
INTEGER i_return_value
# -------------------------------------------------------------------
# opening the existing database spool.db
uil_file_open.go(“spool.db”)
# s_name=fem_model
s_name = “fem_model”
dump i_return_value
dump i_flag
# s_name=non_existing_group
s_name = “non_existing_group”
dump i_return_value
dump i_flag
# -------------------------------------------------------------------
ga_group_groups_get ()
i_return_value = @
ga_group_groups_get @
Main Index
CHAPTER 6 949
Group
( s_group_list )
dump i_return_value
# -------------------------------------------------------------------
ga_group_label_get ()
uil_viewport_post_groups.posted_groups(“default_viewport”,1, @
[“default_group”])
coloring_method(2)
# s_name = default_group
s_name = “default_group”
ga_group_label_set(s_name,1)
dump i_return_value
# Label flag is
dump i_flag
Main Index
950
Code Examples
dump i_return_value
# Label flag is
dump i_flag
# -------------------------------------------------------------------
ga_group_label_set ()
uil_viewport_post_groups.posted_groups(“default_viewport”,1, @
[“default_group”])
coloring_method(2)
# s_name = default_group
s_name = “default_group”
i_return_value = @
ga_group_label_set @
( s_name, @
i_flag )
dump i_return_value
# Label flag is
dump i_flag_c
i_return_value = @
ga_group_label_set @
( s_name, @
i_flag )
dump i_return_value
# Label flag is
dump i_flag_c
# -------------------------------------------------------------------
ga_group_load_vector_get ()
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_title[32],s_name[32]
INTEGER i_comp_vect_flag,i_sym_flag,i_nvectors
INTEGER ia_vect_ent_types(1), ia_vect_ent_ids(1)
REAL ra_vect_locs(1),ra_normals(1)
INTEGER ia_anchor_styles(1),ia_vect_types(1)
INTEGER ia_vect_colors(1), ia_sub_ids(1)
INTEGER i_vector_id, i_vector_id_old, i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
ia_vect_ent_types, @
ia_vect_ent_ids, @
ra_vect_locs, @
ra_normals, @
ia_vect_types, @
ia_anchor_styles, @
ia_vect_colors, @
ia_sub_ids, @
i_vector_id_old )
dump i_vector_id_old
i_return_value = @
ga_group_load_vector_get @
( s_name, @
i_vector_id )
dump i_return_value
dump i_vector_id
ga_vector_delete @
( i_vector_id_old )
#---------------------------------------------------------------------
Main Index
CHAPTER 6 953
Group
ga_group_load_vector_set ()
ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
ia_vect_ent_types, @
ia_vect_ent_ids, @
ra_vect_locs, @
ra_normals, @
ia_vect_types, @
Main Index
954
Code Examples
ia_anchor_styles, @
ia_vect_colors, @
ia_sub_ids, @
i_vector_id )
dump i_vector_id
dump i_return_value
ga_group_load_vector_get @
( s_name, @
i_vector_id_c )
dump i_vector_id_c
ga_vector_delete @
( i_vector_id )
#---------------------------------------------------------------------
ga_group_load_vector_set ()
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# from dbtypes.h
ia_vect_ent_types(1) = 123
ia_vect_ent_ids(1) = 10
ia_vect_types(1) = 1
ia_anchor_styles(1) = 1
ia_vect_colors(1) = 0
ia_sub_ids(1) = 0
ra_normals(1) = 150.0
i_return_value = ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
ia_vect_ent_types, @
ia_vect_ent_ids, @
ra_vect_locs, @
ra_normals, @
ia_vect_types, @
ia_anchor_styles, @
ia_vect_colors, @
ia_sub_ids, @
i_vector_id )
dump i_return_value
dump i_vector_id
dump i_return_value
i_return_value = ga_group_load_vector_get @
( s_name, @
i_vector_id_c )
dump i_return_value
dump i_vector_id_c
#---------------------------------------------------------------------
Main Index
956
Code Examples
ga_group_load_vector_set ()
# from dbtypes.h
ia_vect_ent_types(1) = 123
ia_vect_ent_ids(1) = 10
ia_vect_types(1) = 1
ia_anchor_styles(1) = 1
ia_vect_colors(1) = 0
ia_sub_ids(1) = 0
ra_normals(1) = 150.0
i_return_value = ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
Main Index
CHAPTER 6 957
Group
i_nvectors, @
ia_vect_ent_types, @
ia_vect_ent_ids, @
ra_vect_locs, @
ra_normals, @
ia_vect_types, @
ia_anchor_styles, @
ia_vect_colors, @
ia_sub_ids, @
i_vector_id )
dump i_return_value
dump i_vector_id
i_return_value = ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
ia_vect_ent_types, @
ia_vect_ent_ids, @
ra_vect_locs, @
ra_normals, @
ia_vect_types, @
ia_anchor_styles, @
ia_vect_colors, @
ia_sub_ids, @
i_vector_id_b )
dump i_return_value
dump i_vector_id_b
s_name = “fem_model”
i_return_value = @
ga_group_load_vector_set @
( s_name, @
i_vector_id )
dump i_return_value
i_return_value = ga_vector_delete @
( (i_vector_id - 1) )
dump i_return_value
END IF
s_name = “fem_model”
i_return_value = @
Main Index
958
Code Examples
ga_group_load_vector_set @
( s_name, @
i_vector_id_b )
dump i_return_value
i_return_value = ga_vector_delete @
( (i_vector_id_b - 1) )
dump i_return_value
END IF
i_return_value = ga_group_load_vector_get @
( s_name, @
i_vector_id_c )
dump i_return_value
dump i_vector_id_c
#---------------------------------------------------------------------
ga_group_nentities_get ()
# s_name = “fem_model”
s_name = “fem_model”
Main Index
CHAPTER 6 959
Group
i_return_value = @
ga_group_nentities_get @
( s_name, @
i_type, @
i_number )
dump i_return_value
# The number of node entities in group fem_model are
dump i_number
# -------------------------------------------------------------------
ga_group_node_deform_set ()
# Secondary Result ID = 1
# Layer ID = 1
# node_list = “Node 1:#” (All nodes )
# derivation = ““
# coord_id = ““
ia_resids(1) = iv_lcids(1)
ia_resids(2) = 1
ia_resids(3) = 2
ia_resids(4) = 1
ia_resids(5) = 1
res_utl_extract_nodal_results(ia_resids,” Node 1:#”,””,””, @
i_dtype,i_nbr_nodes,iv_node_ids,rv_deform,ia_minloc,ia_maxloc)
dump i_return_value
dump i_deform_id
dump i_return_value
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
#---------------------------------------------------------------------
ga_group_node_deform_set ()
# deform_id )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_title[80]
INTEGER i_nbr_nodes
INTEGER i_ncases, iv_lcids(VIRTUAL),iv_nsub(VIRTUAL)
INTEGER iv_node_ids(VIRTUAL)
REAL rv_deform(VIRTUAL)
INTEGER i_dtype,ia_minloc(6),ia_maxloc(6), ia_resids(5)
INTEGER i_deform_id
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the deformation results
sf_play(“spool_res_deform.ses”)
dump i_return_value
i_return_value = res_utl_extract_nodal_results @
(ia_resids,” Node 1:#”,””,””, @
i_dtype,i_nbr_nodes,iv_node_ids,rv_deform, @
ia_minloc,ia_maxloc)
dump i_return_value
dump i_return_value
dump i_deform_id
dump i_return_value
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
#---------------------------------------------------------------------
Main Index
962
Code Examples
ga_group_precision_get ()
uil_viewport_post_groups.posted_groups(“default_viewport”,1, @
[“default_group”])
coloring_method(2)
# s_name = default_group
s_name = “default_group”
ga_group_style_set(s_name,”SHADED”)
dump i_return_value
# Precision flag is
dump i_flag
dump i_return_value
# Precision flag is
dump i_flag
ga_group_style_set(s_name,”WIREFRAME”)
# -------------------------------------------------------------------
ga_group_result_vector_get ()
sys_allocate_array(iv_vect_ent_types,1,i_nvectors)
sys_allocate_array(iv_vect_ent_ids,1,i_nvectors)
sys_allocate_array(rv_vect_locs,1,i_nvectors,1,3)
sys_allocate_array(iv_vect_types,1,i_nvectors)
sys_allocate_array(iv_anchor_styles,1,i_nvectors)
sys_allocate_array(iv_vect_colors,1,i_nvectors)
sys_allocate_array(iv_sub_ids,1,i_nvectors)
FOR(i_index = 1 TO i_nvectors)
iv_vect_ent_types(i_index) = 123 /* from dbtypes.h */
iv_vect_ent_ids(i_index) = iv_node_ids(i_index)
iv_vect_types(i_index) = 1
iv_anchor_styles(i_index) = 1
iv_vect_colors(i_index) = 0
iv_sub_ids(i_index) = 0
END FOR
ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
iv_vect_ent_types, @
iv_vect_ent_ids, @
rv_vect_locs, @
rv_deform, @
iv_vect_types, @
iv_anchor_styles, @
iv_vect_colors, @
iv_sub_ids, @
i_vector_id_old )
dump i_vector_id_old
i_return_value = @
ga_group_result_vector_get @
Main Index
CHAPTER 6 965
Group
( s_name, @
i_vector_id )
dump i_return_value
dump i_vector_id
ga_vector_delete @
( i_vector_id_old )
sys_free_array(iv_vect_ent_types)
sys_free_array(iv_vect_ent_ids)
sys_free_array(rv_vect_locs)
sys_free_array(iv_vect_types)
sys_free_array(iv_anchor_styles)
sys_free_array(iv_vect_colors)
sys_free_array(iv_sub_ids)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
#---------------------------------------------------------------------
ga_group_result_vector_get ()
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
dump i_return_value
sys_allocate_array(iv_vect_ent_types,1,i_nvectors)
sys_allocate_array(iv_vect_ent_ids,1,i_nvectors)
sys_allocate_array(rv_vect_locs,1,i_nvectors,1,3)
sys_allocate_array(iv_vect_types,1,i_nvectors)
sys_allocate_array(iv_anchor_styles,1,i_nvectors)
sys_allocate_array(iv_vect_colors,1,i_nvectors)
sys_allocate_array(iv_sub_ids,1,i_nvectors)
FOR(i_index = 1 TO i_nvectors)
iv_vect_ent_types(i_index) = 123 /* from dbtypes.h */
iv_vect_ent_ids(i_index) = iv_node_ids(i_index)
iv_vect_types(i_index) = 1
iv_anchor_styles(i_index) = 1
iv_vect_colors(i_index) = 0
iv_sub_ids(i_index) = 0
END FOR
i_return_value = ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
iv_vect_ent_types, @
iv_vect_ent_ids, @
rv_vect_locs, @
rv_deform, @
iv_vect_types, @
iv_anchor_styles, @
iv_vect_colors, @
iv_sub_ids, @
i_vector_id_old )
dump i_return_value
Main Index
CHAPTER 6 967
Group
dump i_vector_id_old
dump i_return_value
i_return_value = @
ga_group_result_vector_get @
( s_name, @
i_vector_id )
dump i_return_value
dump i_vector_id
sys_free_array(iv_vect_ent_types)
sys_free_array(iv_vect_ent_ids)
sys_free_array(rv_vect_locs)
sys_free_array(iv_vect_types)
sys_free_array(iv_anchor_styles)
sys_free_array(iv_vect_colors)
sys_free_array(iv_sub_ids)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
#---------------------------------------------------------------------
ga_group_result_vector_set ()
STRING s_title[32],s_name[32]
INTEGER i_ncases, i_nbr_nodes, i_index
INTEGER iv_lcids(VIRTUAL),iv_nsub(VIRTUAL), iv_node_ids(VIRTUAL)
REAL rv_deform(VIRTUAL)
INTEGER i_dtype,ia_minloc(6),ia_maxloc(6), ia_resids(5)
INTEGER i_comp_vect_flag,i_sym_flag,i_nvectors
INTEGER iv_vect_ent_types(VIRTUAL), iv_vect_ent_ids(VIRTUAL)
REAL rv_vect_locs(VIRTUAL)
INTEGER iv_vect_types(VIRTUAL), iv_anchor_styles(VIRTUAL)
INTEGER iv_vect_colors(VIRTUAL), iv_sub_ids(VIRTUAL)
INTEGER i_vector_id, i_vector_id_c, i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
sys_allocate_array(iv_vect_ent_types,1,i_nvectors)
sys_allocate_array(iv_vect_ent_ids,1,i_nvectors)
sys_allocate_array(rv_vect_locs,1,i_nvectors,1,3)
sys_allocate_array(iv_vect_types,1,i_nvectors)
sys_allocate_array(iv_anchor_styles,1,i_nvectors)
sys_allocate_array(iv_vect_colors,1,i_nvectors)
sys_allocate_array(iv_sub_ids,1,i_nvectors)
FOR(i_index = 1 TO i_nvectors)
iv_vect_ent_types(i_index) = 123 /* from dbtypes.h */
iv_vect_ent_ids(i_index) = iv_node_ids(i_index)
iv_vect_types(i_index) = 1
iv_anchor_styles(i_index) = 1
iv_vect_colors(i_index) = 0
iv_sub_ids(i_index) = 0
END FOR
ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
iv_vect_ent_types, @
iv_vect_ent_ids, @
rv_vect_locs, @
rv_deform, @
Main Index
CHAPTER 6 969
Group
iv_vect_types, @
iv_anchor_styles, @
iv_vect_colors, @
iv_sub_ids, @
i_vector_id )
dump i_vector_id
dump i_return_value
ga_group_result_vector_get @
( s_name, @
i_vector_id_c )
dump i_vector_id_c
ga_vector_delete @
( i_vector_id )
sys_free_array(iv_vect_ent_types)
sys_free_array(iv_vect_ent_ids)
sys_free_array(rv_vect_locs)
sys_free_array(iv_vect_types)
sys_free_array(iv_anchor_styles)
sys_free_array(iv_vect_colors)
sys_free_array(iv_sub_ids)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
#---------------------------------------------------------------------
ga_group_result_vector_set ()
#
# ga_group_result_vector_set
# ( name,
# vector_id )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_title[32],s_name[32]
INTEGER i_ncases, i_nbr_nodes, i_index
INTEGER iv_lcids(VIRTUAL),iv_nsub(VIRTUAL), iv_node_ids(VIRTUAL)
REAL rv_deform(VIRTUAL)
INTEGER i_dtype,ia_minloc(6),ia_maxloc(6), ia_resids(5)
INTEGER i_comp_vect_flag,i_sym_flag,i_nvectors
INTEGER iv_vect_ent_types(VIRTUAL), iv_vect_ent_ids(VIRTUAL)
REAL rv_vect_locs(VIRTUAL)
INTEGER iv_vect_types(VIRTUAL), iv_anchor_styles(VIRTUAL)
INTEGER iv_vect_colors(VIRTUAL), iv_sub_ids(VIRTUAL)
INTEGER i_vector_id, i_vector_id_c, i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db” and read the results
sf_play(“spool_res.ses”)
dump i_return_value
dump i_return_value
sys_allocate_array(iv_vect_ent_types,1,i_nvectors)
sys_allocate_array(iv_vect_ent_ids,1,i_nvectors)
sys_allocate_array(rv_vect_locs,1,i_nvectors,1,3)
sys_allocate_array(iv_vect_types,1,i_nvectors)
sys_allocate_array(iv_anchor_styles,1,i_nvectors)
sys_allocate_array(iv_vect_colors,1,i_nvectors)
sys_allocate_array(iv_sub_ids,1,i_nvectors)
FOR(i_index = 1 TO i_nvectors)
iv_vect_ent_types(i_index) = 123 /* from dbtypes.h */
iv_vect_ent_ids(i_index) = iv_node_ids(i_index)
iv_vect_types(i_index) = 1
iv_anchor_styles(i_index) = 1
iv_vect_colors(i_index) = 0
Main Index
CHAPTER 6 971
Group
iv_sub_ids(i_index) = 0
END FOR
i_return_value = ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
iv_vect_ent_types, @
iv_vect_ent_ids, @
rv_vect_locs, @
rv_deform, @
iv_vect_types, @
iv_anchor_styles, @
iv_vect_colors, @
iv_sub_ids, @
i_vector_id )
dump i_return_value
dump i_vector_id
dump i_return_value
i_return_value = ga_group_result_vector_get @
( s_name, @
i_vector_id_c )
dump i_return_value
dump i_vector_id_c
sys_free_array(iv_vect_ent_types)
sys_free_array(iv_vect_ent_ids)
sys_free_array(rv_vect_locs)
sys_free_array(iv_vect_types)
sys_free_array(iv_anchor_styles)
sys_free_array(iv_vect_colors)
sys_free_array(iv_sub_ids)
sys_free_array(iv_lcids)
sys_free_array(iv_nsub)
sys_free_array(iv_node_ids)
sys_free_array(rv_deform)
#---------------------------------------------------------------------
ga_group_selectable_get ()
uil_viewport_post_groups.posted_groups(“default_viewport”,1, @
[“default_group”])
coloring_method(2)
# s_name = default_group
s_name = “default_group”
ga_group_selectable_set(s_name,1)
dump i_return_value
# Selectable flag is
dump i_flag
dump i_return_value
# Selectable flag is
dump i_flag
ga_group_selectable_set(s_name,1)
# -------------------------------------------------------------------
ga_group_selectable_set ()
uil_viewport_post_groups.posted_groups(“default_viewport”,1, @
[“default_group”])
coloring_method(2)
# s_name = default_group
s_name = “default_group”
# i_flag = 1
i_flag = 1
dump i_return_value
# Selectable flag is
dump i_flag_c
Main Index
974
Code Examples
i_return_value = @
ga_group_selectable_set @
( s_name, @
i_flag )
dump i_return_value
# Selectable flag is
dump i_flag_c
ga_group_selectable_set(s_name,1)
# -------------------------------------------------------------------
ga_group_style_get ()
INTEGER i_return_value
# -------------------------------------------------------------------
# opening the existing database spool.db
uil_file_open.go(“spool.db”)
uil_viewport_post_groups.posted_groups(“default_viewport”,1, @
[“default_group”])
coloring_method(2)
# s_name = default_group
s_name = “default_group”
dump i_return_value
# Render style is
dump s_style
dump i_return_value
# Render style is
dump s_style
# -------------------------------------------------------------------
ga_group_style_set ()
# s_name = default_group
s_name = “default_group”
i_return_value = @
ga_group_style_set @
(s_name, @
s_style )
dump i_return_value
# Render style is
dump s_style_c
i_return_value = @
ga_group_style_set @
(s_name, @
s_style )
dump i_return_value
# Render style is
dump s_style_c
Main Index
CHAPTER 6 977
Group
# -------------------------------------------------------------------
ga_group_vector_load_get ()
uil_viewport_post_groups.posted_groups(“default_viewport”,1, @
[“default_group”])
coloring_method(2)
# s_name = default_group
s_name = “default_group”
dump i_return_value
# Load vector flag is
dump i_flag
Main Index
978
Code Examples
dump i_return_value
# Load vector flag is
dump i_flag
# -------------------------------------------------------------------
ga_group_vector_load_set ()
uil_viewport_post_groups.posted_groups(“default_viewport”,1, @
[“default_group”])
coloring_method(2)
# s_name=default_group
s_name = “default_group”
Main Index
CHAPTER 6 979
Group
dump i_return_value
# -------------------------------------------------------------------
ga_group_vector_result_get ()
INTEGER i_return_value
# -------------------------------------------------------------------
# Open the database “spool.db” and reads the results.
sf_play(“spool_res_vector.ses”)
coloring_method(2)
# s_name = fem_model
s_name = “fem_model”
dump i_return_value
dump i_return_value
ga_group_vector_result_get ()
# flag )
#
# -------------------------------------------------------------------
# Variable Declaration
#
STRING s_name[32]
INTEGER i_flag, i_method
INTEGER i_return_value
INTEGER i_preference_id, i_data_type, i_preference
LOGICAL l_preference
REAL r_preference
STRING s_preference[32]
# -------------------------------------------------------------------
# Open the database “spool.db” and reads the results.
sf_play(“spool_res_vector.ses”)
i_preference_id = 501
i_data_type = 1
# s_name = fem_model
s_name = “fem_model”
dump i_return_value
dump i_return_value
dump i_return_value
# -------------------------------------------------------------------
Main Index
982
Code Examples
ga_group_vector_result_set ()
coloring_method(2)
# s_name=fem_model
s_name = “fem_model”
dump i_return_value
ga_group_vector_result_get @
( s_name, @
i_flag_c )
ga_group_vector_result_set ()
i_preference_id = 501
i_data_type = 1
# s_name = fem_model
s_name = “fem_model”
dump i_return_value
dump i_return_value
dump i_return_value
# -------------------------------------------------------------------
ga_groups_load_vector_set ()
# vector_id )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_title[32],s_name[32]
INTEGER i_ngroups, ia_group_ids(2)
INTEGER i_comp_vect_flag,i_sym_flag,i_nvectors
INTEGER ia_vect_ent_types(1), ia_vect_ent_ids(1)
REAL ra_vect_locs(1),ra_normals(1)
INTEGER ia_anchor_styles(1),ia_vect_types(1)
INTEGER ia_vect_colors(1), ia_sub_ids(1)
INTEGER i_vector_id, i_vector_id_c, i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
ia_vect_ent_types, @
ia_vect_ent_ids, @
ra_vect_locs, @
ra_normals, @
ia_vect_types, @
ia_anchor_styles, @
ia_vect_colors, @
ia_sub_ids, @
i_vector_id )
dump i_vector_id
dump i_return_value
dump i_vector_id_c
dump i_vector_id_c
ga_vector_delete @
( i_vector_id )
#---------------------------------------------------------------------
ga_groups_load_vector_set ()
i_nvectors = 1
ia_vect_ent_types(1) = 123 /* from dbtypes.h */
ia_vect_ent_ids(1) = 10
ia_vect_types(1) = 1
ia_anchor_styles(1) = 1
ia_vect_colors(1) = 0
ia_sub_ids(1) = 0
ra_normals(1) = 150.0
i_return_value = ga_vector_create @
( s_title, @
i_comp_vect_flag, @
i_sym_flag, @
i_nvectors, @
ia_vect_ent_types, @
ia_vect_ent_ids, @
ra_vect_locs, @
ra_normals, @
ia_vect_types, @
ia_anchor_styles, @
ia_vect_colors, @
ia_sub_ids, @
i_vector_id )
dump i_return_value
dump i_vector_id
dump i_return_value
dump i_return_value
dump i_vector_id_c
dump i_return_value
dump i_vector_id_c
#---------------------------------------------------------------------
Main Index
988
Code Examples
get_orphan_elements ()
# Now remove the elements 1 to 250 from group group two ( fem_model)
i_grp_id = 2
db_get_group_name( i_grp_id,s_name )
ga_group_entity_remove( s_name,”Element 1:250” )
count_orphan_elements @
( i_count )
#
# Allocate memory
SYS_ALLOCATE_ARRAY( i_idlist,1,i_count)
i_return_value = @
get_orphan_elements @
( i_count, @
i_idlist )
dump i_return_value
# The list of orphan elements
dump i_idlist
# -------------------------------------------------------------------
get_orphan_nodes ()
count_orphan_nodes @
( i_count )
#
# Allocate memory
SYS_ALLOCATE_ARRAY( i_idlist,1,i_count)
i_return_value = @
get_orphan_nodes @
( i_count, @
i_idlist )
dump i_return_value
Main Index
990
Code Examples
# -------------------------------------------------------------------
sgm_db_count_iges_in_group ()
# -------------------------------------------------------------------
Main Index
CHAPTER 6 991
Group
sgm_db_get_iges_in_group ()
# Allocate memory
# i_count(12) is the count of surface of revolution IGES entity.
SYS_ALLOCATE_ARRAY(i_entityids,1,i_count(12))
SYS_FREE_ARRAY(i_entityids)
# -------------------------------------------------------------------
sgm_db_get_iges_in_group ()
# Allocate memory
# i_count(12) is the count of surface of revolution IGES entity.
SYS_ALLOCATE_ARRAY(i_entityids,1,i_count(12))
i_item_count )
#
dump i_item_count
dump i_entityids
dump i_return_value
SYS_FREE_ARRAY(i_entityids)
# -------------------------------------------------------------------
uil_entity_group_members_get ()
# -------------------------------------------------------------------
# open the existing database spool.db
uil_file_open.go(“spool.db”)
# Allocate memory
SYS_ALLOCATE_STRING( s_members,32)
db_get_current_group_id @
( i_grp_id )
Main Index
994
Code Examples
db_get_group_name @
( i_grp_id, @
s_group )
i_return_value = @
uil_entity_group_members_get @
( s_group, @
i_entity_type, @
s_members )
dump i_return_value
# gets the group members of node type from fem_model group.
dump s_members
SYS_FREE_STRING(s_members)
# -------------------------------------------------------------------
Main Index
MSC.Acumen, Volume 2: Code Examples
CHAPTER
Geometry
7
■ Introduction
Main Index
996
Code Examples
7.1 Introduction
This chapter provides code examples for the PCL function described in Volume 1. These
examples are designed so that they can be cut and pasted into a file and, by following the
instructions listed with each example, executed in MSC.Patran.
app_db_get_ref_cid ()
# l_domesg = TRUE
l_domesg = TRUE
i_return_value = @
app_db_get_ref_cid @
( l_domesg, @
s_cord_frame )
dump i_return_value
dump s_cord_frame
SYS_FREE_STRING(sv_asm_create_cord_created_ids)
#---------------------------------------------------------------------
asm_const_curve_2d_arc2point_v2 ()
l_flip_center_point = TRUE
i_arc_angle = 1
s_plane_list = "Coord 0.3"
s_center_point_list = "[0 0 0]"
s_start_point_list = "[1 0 0]"
s_end_point_list = "[0 1 0]"
l_project_flag = TRUE
#---------------------------------------------------------------------
# Creating two curves in plane parallel to X-Y plane passing through
# start point, center point and the end point.
i_return_value = @
asm_const_curve_2d_arc2point_v2 @
( s_output_ids, @
i_num_curve, @
i_arc_method, @
r_radius, @
l_create_center, @
l_flip_center_point, @
i_arc_angle, @
s_plane_list, @
s_center_point_list, @
s_start_point_list, @
s_end_point_list, @
l_project_flag, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
sys_free_string(sv_created_ids)
#---------------------------------------------------------------------
asm_const_curve_2d_arc3point_v1 ()
INTEGER i_num_curve
LOGICAL l_create_center
STRING s_plane_list[16]
STRING s_start_list[16]
STRING s_mid_list[16]
STRING s_end_list[16]
LOGICAL l_project_flag
STRING sv_created_ids[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Variable Initialization.
s_output_ids = "1"
i_num_curve = 1
l_create_center = TRUE
s_plane_list = "Coord 0.3"
s_start_list = "[0 0 1]"
s_mid_list = "[1 4 1]"
s_end_list = "[3 3 0]"
l_project_flag = TRUE
#---------------------------------------------------------------------
# Creating two curves in plane from three points.
i_return_value = @
asm_const_curve_2d_arc3point_v1 @
( s_output_ids, @
i_num_curve, @
l_create_center, @
s_plane_list, @
s_start_list, @
s_mid_list, @
s_end_list, @
l_project_flag, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
sys_free_string(sv_created_ids)
#---------------------------------------------------------------------
asm_const_curve_2d_circle_v1 ()
# radius,
# plane_list,
# radius_point_list,
# center_point_list,
# project_flag,
# created_ids )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_output_ids[16]
INTEGER i_num_curves
INTEGER i_radius_method
REAL r_radius
STRING s_plane_list[16]
STRING s_radius_point_list[16]
STRING s_center_point_list[16]
LOGICAL l_project_flag
STRING sv_created_ids[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Enabling the curve and point labeling.
curve_label(TRUE)
point_label(TRUE)
#---------------------------------------------------------------------
# Calling function to create two circles and project them on a plane.
# Circles are created by giving radius value.
s_output_ids = "#"
i_num_curves = 5
i_radius_method = 1
r_radius = 1.45
s_plane_list = "Coord 0.3"
s_center_point_list = "[0 0 3]"
l_project_flag = TRUE
i_return_value = @
asm_const_curve_2d_circle_v1 @
( s_output_ids, @
i_num_curves, @
i_radius_method, @
r_radius, @
s_plane_list, @
s_radius_point_list, @
s_center_point_list, @
l_project_flag, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
sys_free_string(sv_created_ids)
#---------------------------------------------------------------------
asm_const_curve_project_v1 ()
#---------------------------------------------------------------------
# Creating a projected curve on the surface without deleting the old.
s_output_ids = "#"
s_curve_list = "Curve 1"
s_entity_list = "Surface 1"
i_entity_type = 1
l_delete_org = FALSE
s_coord_frame = "Coord 0"
i_ncvprj = 2
r_geotol = 0.0001
i_return_value = @
asm_const_curve_project_v1 @
( s_output_ids, @
s_curve_list, @
s_entity_list, @
i_entity_type, @
l_delete_org, @
i_project_method, @
s_vector, @
s_coord_frame, @
i_ncvprj, @
r_geotol, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
sys_free_string(sv_created_ids)
sys_free_string(sv_sgm_create_surface_crtd_ids)
sys_free_string(sv_asm_line_3point_created_ids)
#---------------------------------------------------------------------
asm_db_create_grid ()
LOGICAL l_yesall
LOGICAL l_noall
LOGICAL l_yesall_dup
LOGICAL l_noall_dup
REAL r_xyz_out(3)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
point_label(TRUE)
#---------------------------------------------------------------------
# Creating the grid with the help of the point.
asm_db_create_grid( @
r_xyz, @
i_grid_label, @
l_yesall, @
l_noall, @
l_yesall_dup, @
l_noall_dup, @
i_return_value )
dump i_grid_label
dump i_return_value
#---------------------------------------------------------------------
# Getting back the point.
sgm_db_get_point( @
i_grid_label, @
r_xyz_out, @
i_return_value )
dump r_xyz_out
dump i_return_value
#---------------------------------------------------------------------
asm_db_get_curve_geo ()
#
# The function asm_db_get_curve_geo()
# has the following arguments:
#
# asm_db_get_curve_geo
# ( curve_id,
# geo_coefs,
# status )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_curve_id
REAL ra_geo_coefs(12)
INTEGER i_label
INTEGER i_status
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# i_label = 1
i_label = 1
dump i_curve_id
asm_db_get_curve_geo @
( i_curve_id, @
ra_geo_coefs, @
i_status )
dump i_status
#---------------------------------------------------------------------
asm_db_get_next_cord_label ()
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL l_domessage
INTEGER i_integerlabel
STRING sv_asm_create_cord_created_ids[VIRTUAL]
STRING s_stringlabel[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
asm_db_get_next_cord_label @
( l_domessage, @
i_integerlabel, @
s_stringlabel )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_cord_created_ids)
#---------------------------------------------------------------------
asm_db_get_next_grid_label ()
# stringlabel )
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL l_domessage
INTEGER i_integerlabel
STRING s_stringlabel[64]
INTEGER i_groupid,i_status,i_count(7),i_count_c
INTEGER i_gridLabels( VIRTUAL )
REAL r_xyzCoordinates( VIRTUAL )
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
i_count_c = i_count(1)
dump i_count_c
dump i_status
# Allocate memory
SYS_ALLOCATE_ARRAY(i_gridLabels,1,i_count_c)
SYS_ALLOCATE_ARRAY(r_xyzCoordinates,1,3*i_count_c)
# Get the grid labels for the grids of the default group.
dump i_gridLabels
dump r_xyzCoordinates
dump i_status
i_return_value = @
asm_db_get_next_grid_label @
( l_domessage, @
i_integerlabel, @
s_stringlabel )
dump i_return_value
SYS_FREE_ARRAY( i_gridLabels )
SYS_FREE_ARRAY( r_xyzCoordinates )
#---------------------------------------------------------------------
Main Index
CHAPTER 7 1007
Geometry
asm_db_get_next_hpat_label ()
# l_domessage = TRUE
l_domessage = TRUE
i_return_value = @
asm_db_get_next_hpat_label @
( l_domessage, @
i_integerlabel, @
s_stringlabel )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_hpat)
#---------------------------------------------------------------------
Main Index
1008
Code Examples
asm_db_get_next_line_label ()
# l_domessage = TRUE
l_domessage = TRUE
i_return_value = @
asm_db_get_next_line_label @
( l_domessage, @
i_integerlabel, @
s_stringlabel )
dump i_return_value
#---------------------------------------------------------------------
asm_db_get_next_patch_label
# l_domessage = TRUE
l_domessage = TRUE
i_return_value = @
asm_db_get_next_patch_label @
( l_domessage, @
i_integerlabel, @
s_stringlabel )
dump i_return_value
asm_u_coord_global_to_local ()
# t,
# r,
# itype,
# npts )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL ra_p(3) = [2, 3, 0]
REAL ra_t(3) = [1, 1, 1]
REAL ra_r(9) = [0, 1, 0, 1, 0, 0, 0, 0, 1]
INTEGER i_itype
INTEGER i_npts
#---------------------------------------------------------------------
# The rotation matrix interchanges the x and y axis of the
# present coordinate system to get the local coordinate system.
# i_itype = 1 (rectangular coordinate frame )
i_itype = 1
# i_npts = 1
i_npts = 1
asm_u_coord_global_to_local @
( ra_p, @
ra_t, @
ra_r, @
i_itype, @
i_npts )
asm_u_coord_local_to_global ()
asm_u_coord_local_to_global @
( ra_p, @
ra_t, @
ra_r, @
i_itype, @
i_npts )
curve_arc_to_parm ()
#---------------------------------------------------------------------
# Creating the curve
i_return_value = @
asm_const_line_xyz @
( "1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_line_xyz_created_ids )
Main Index
1012
Code Examples
dump i_return_value
#---------------------------------------------------------------------
# Getting the curve length
i_curve_label = 1
i_return_value = @
sgm_get_curve_length(i_curve_label, @
r_curve_length)
dump i_return_value, r_curve_length
#---------------------------------------------------------------------
# Getting the parameter values for the curve for the
# given arc lengths.
i_num_parameter = 2
sys_allocate_array(ra_arc_length,1,i_num_parameter)
sys_allocate_array(ra_parameter_values,1,i_num_parameter)
curve_arc_to_parm @
( i_curve_label, @
i_num_parameter, @
ra_arc_length, @
ra_parameter_values, @
i_return_value )
dump i_return_value
dump ra_parameter_values
#---------------------------------------------------------------------
sys_free_array(ra_arc_length)
sys_free_array(ra_parameter_values)
sys_free_string(asm_create_line_xyz_created_ids)
#---------------------------------------------------------------------
curve_parm_to_arc ()
INTEGER i_num_parameter
REAL r_curve_length
REAL ra_arc_length(VIRTUAL)
REAL ra_parameter_values(VIRTUAL)
STRING asm_create_line_xyz_created_ids[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Creating the curve
i_return_value = @
asm_const_line_xyz @
( "1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_line_xyz_created_ids )
dump i_return_value
#---------------------------------------------------------------------
# Getting the curve length
i_curve_label = 1
i_return_value = @
sgm_get_curve_length(i_curve_label, @
r_curve_length)
dump i_return_value, r_curve_length
#---------------------------------------------------------------------
# Using the function to get the curve lengths for the
# given parameters.
i_num_parameter = 2
sys_allocate_array(ra_arc_length,1,i_num_parameter)
sys_allocate_array(ra_parameter_values,1,i_num_parameter)
curve_parm_to_arc @
( i_curve_label, @
i_num_parameter, @
ra_parameter_values, @
ra_arc_length, @
i_return_value )
dump i_return_value
dump ra_arc_length
#---------------------------------------------------------------------
sys_free_array(ra_arc_length)
sys_free_array(ra_parameter_values)
sys_free_string(asm_create_line_xyz_created_ids)
#---------------------------------------------------------------------
Main Index
1014
Code Examples
db_check_coord_frame_exist ()
# i_id = 100
i_id = 100
l_return_value = @
db_check_coord_frame_exist @
( i_id )
dump l_return_value
# i_id = 500
i_id = 500
l_return_value = @
db_check_coord_frame_exist @
( i_id )
SYS_FREE_STRING(sv_asm_create_cord_created_ids)
#---------------------------------------------------------------------
Main Index
CHAPTER 7 1015
Geometry
db_count_coordinate_frame ()
i_return_value = @
db_count_coordinate_frame @
( i_count )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_cord_created_ids)
#---------------------------------------------------------------------
db_count_curve ()
i_return_value = @
db_count_curve @
( i_count )
dump i_return_value
#---------------------------------------------------------------------
db_count_curves_for_point ()
INTEGER i_count
STRING sv_asm_line_2point_created_ids[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# i_id = 1
i_id = 1
i_return_value = @
db_count_curves_for_point @
( i_id, @
i_count )
dump i_return_value
SYS_FREE_STRING(sv_asm_line_2point_created_ids)
#---------------------------------------------------------------------
db_count_point ()
uil_file_open.go(“spool.db”)
i_return_value = @
db_count_point @
( i_count )
dump i_return_value
#---------------------------------------------------------------------
db_count_solid ()
i_return_value = @
db_count_solid @
( i_count )
dump i_return_value
Main Index
CHAPTER 7 1019
Geometry
db_count_solids_for_surface ()
# i_id = 1
i_id = 1
i_return_value = @
db_count_solids_for_surface @
( i_id, @
i_count )
dump i_return_value
# i_id = 4
i_id = 4
i_return_value = @
db_count_solids_for_surface @
( i_id, @
i_count )
Main Index
1020
Code Examples
dump i_return_value
db_count_surface ()
i_return_value = @
db_count_surface @
( i_count )
dump i_return_value
db_count_surfaces_for_edge ()
uil_toolbar.labels_on( )
ga_view_aa_set( 23., -34., 0. )
# i_id = 1
i_id = 1
i_return_value = @
db_count_surfaces_for_edge @
( i_id, @
i_count )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_patch_xy)
#---------------------------------------------------------------------
db_get_all_coord_frame_ids ()
# Create a surface.
asm_const_patch_xyz( “4”, “<1 1 0>”, “[0 0 0]”, “Coord 0”, @
sv_asm_create_patch_xy_created )
Main Index
CHAPTER 7 1023
Geometry
db_get_all_posted_coord ()
# Create a surface.
asm_const_patch_xyz( “4”, “<1 1 0>”, “[0 0 0]”, “Coord 0”, @
sv_asm_create_patch_xy_created )
Main Index
1024
Code Examples
db_get_coord_frame_label ()
# i_id = 100
i_id = 100
i_return_value = @
db_get_coord_frame_label @
Main Index
CHAPTER 7 1025
Geometry
( i_id, @
i_label )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_cord_created_ids)
#---------------------------------------------------------------------
db_get_current_coord ()
i_return_value = @
db_get_current_coord @
( i_coord_label )
dump i_return_value
db_set_current_coord(200)
i_return_value = @
db_get_current_coord @
( i_coord_label )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_cord_created_ids)
#---------------------------------------------------------------------
db_get_curve_coo_and_type ()
# i_label = 1
i_label = 1
i_return_value = @
db_get_curve_coo_and_type @
( i_id, @
Main Index
CHAPTER 7 1027
Geometry
i_coo, @
i_type )
dump i_return_value
db_get_curve_id ()
# i_label = 1
i_label = 1
i_return_value = @
db_get_curve_id @
( i_label, @
i_id )
dump i_return_value
db_get_curve_label ()
# i_id = 4
i_id = 4
i_return_value = @
db_get_curve_label @
( i_id, @
i_label )
dump i_return_value
#---------------------------------------------------------------------
db_get_curves_for_point ()
# i_ptid = 1
i_ptid = 1
db_count_curves_for_point @
( i_ptid, @
i_count )
SYS_ALLOCATE_ARRAY(iv_crvid,1,i_count)
db_get_curves_for_point @
( i_ptid, @
i_count, @
iv_crvid )
SYS_FREE_STRING(sv_asm_line_2point_created_ids)
SYS_FREE_ARRAY(iv_crvid)
#---------------------------------------------------------------------
Main Index
1030
Code Examples
db_get_geom_type ()
# i_id_label = 4
i_id_label = 4
# i_entity_type = 1 (point)
i_entity_type = 1
i_return_value = @
db_get_geom_type @
( i_id_label, @
i_entity_type, @
s_geom_type )
dump i_return_value
#---------------------------------------------------------------------
Main Index
CHAPTER 7 1031
Geometry
db_get_max_coord_label ()
i_return_value = @
db_get_max_coord_label @
( i_label )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_cord_created_ids)
#---------------------------------------------------------------------
db_get_max_curve_label ()
i_return_value = @
db_get_max_curve_label @
( i_label )
dump i_return_value
#---------------------------------------------------------------------
db_get_max_point_label ()
i_return_value = @
db_get_max_point_label @
( i_label )
dump i_return_value
#---------------------------------------------------------------------
db_get_max_solid_label ()
i_return_value = @
db_get_max_solid_label @
( i_label )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_hpat)
#---------------------------------------------------------------------
Main Index
1034
Code Examples
db_get_max_surface_label ()
i_return_value = @
db_get_max_surface_label @
( i_label )
dump i_return_value
db_get_min_coord_label ()
#
# db_get_min_coord_label
# ( label )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_label
STRING sv_asm_create_cord_created_ids[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
db_get_min_coord_label @
( i_label )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_cord_created_ids)
#---------------------------------------------------------------------
db_get_min_curve_label ()
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
i_return_value = @
db_get_min_curve_label @
( i_label )
dump i_return_value
#---------------------------------------------------------------------
db_get_min_point_label ()
i_return_value = @
db_get_min_point_label @
( i_label )
dump i_return_value
#---------------------------------------------------------------------
Main Index
CHAPTER 7 1037
Geometry
db_get_min_solid_label ()
i_return_value = @
db_get_min_solid_label @
( i_label )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_hpat)
#---------------------------------------------------------------------
db_get_min_surface_label ()
# to create spool.db
#
# This file can be run by starting a session of
# MSC.Patran, and running this session file
# through the “File”,”Session”,”Play” pulldown
# menus on the menu bar.
#
# The function db_get_min_surface_label()
# has the following arguments:
#
# db_get_min_surface_label
# ( label )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_label
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
i_return_value = @
db_get_min_surface_label @
( i_label )
dump i_return_value
db_get_next_coord_frame_ids ()
# Create a surface.
asm_const_patch_xyz( “4”, “<1 1 0>”, “[0 0 0]”, “Coord 0”, @
sv_asm_create_patch_xy_created )
db_get_next_posted_coord ()
# Create a surface.
asm_const_patch_xyz( “4”, “<1 1 0>”, “[0 0 0]”, “Coord 0”, @
sv_asm_create_patch_xy_created )
Main Index
CHAPTER 7 1041
Geometry
db_get_point_association_count ()
# i_label = 6
i_label = 6
db_get_point_id @
( i_label, @
i_point_id )
dump i_point_id
i_return_value = @
db_get_point_association_count @
( i_point_id, @
i_assoc_count )
dump i_return_value
#---------------------------------------------------------------------
Main Index
1042
Code Examples
db_get_point_coo_and_type ()
# i_label = 6
i_label = 6
db_get_point_id @
( i_label, @
i_id )
dump i_id
i_return_value = @
db_get_point_coo_and_type @
( i_id, @
i_coo, @
i_type )
dump i_return_value
#---------------------------------------------------------------------
Main Index
CHAPTER 7 1043
Geometry
db_get_point_id ()
# i_label = 9
i_label = 9
i_return_value = @
db_get_point_id @
( i_label, @
i_id )
dump i_return_value
#---------------------------------------------------------------------
db_get_point_label ()
# i_id = 7
i_id = 7
i_return_value = @
db_get_point_label @
( i_id, @
i_label )
dump i_return_value
#---------------------------------------------------------------------
db_get_solid_coo_and_type ()
# i_label = 4
i_label = 4
i_return_value = @
db_get_solid_coo_and_type @
( i_id, @
i_coo, @
i_type )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_hpat)
#---------------------------------------------------------------------
db_get_solid_id ()
# i_label = 4
i_label = 4
i_return_value = @
db_get_solid_id @
( i_label, @
i_id )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_hpat)
#---------------------------------------------------------------------
db_get_solid_label ()
#
# db_get_solid_label
# ( id,
# label )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_id
INTEGER i_label
STRING sv_asm_create_hpat[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# i_id = 1
i_id = 1
i_return_value = @
db_get_solid_label @
( i_id, @
i_label )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_hpat)
#---------------------------------------------------------------------
db_get_solids_for_surface ()
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_srfid
INTEGER i_label
INTEGER i_count
INTEGER iv_solid(VIRTUAL)
STRING sv_asm_create_hpat_xyz[VIRTUAL]
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
SYS_ALLOCATE_ARRAY(iv_solid,1,i_count)
db_get_solids_for_surface @
( i_srfid, @
i_count, @
iv_solid )
# The ids of the solids associated with the surface with ID =1 are
dump iv_solid
SYS_FREE_ARRAY(iv_solid)
SYS_FREE_STRING(sv_asm_create_hpat_xyz)
#---------------------------------------------------------------------
db_get_surface_coo_and_type ()
# ( id,
# coo,
# type )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_id
INTEGER i_coo
INTEGER i_label
INTEGER i_type
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# i_label = 1
i_label = 1
i_return_value = @
db_get_surface_coo_and_type @
( i_id, @
i_coo, @
i_type )
dump i_return_value
db_get_surface_id ()
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_label
INTEGER i_id
INTEGER i_return_value
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# i_label = 1
i_label = 1
i_return_value = @
db_get_surface_id @
( i_label, @
i_id )
dump i_return_value
db_get_surface_label ()
# i_id = 1
i_id = 1
i_return_value = @
Main Index
CHAPTER 7 1051
Geometry
db_get_surface_label @
( i_id, @
i_label )
dump i_return_value
db_get_surfaces_for_edge ()
uil_toolbar.labels_on( )
ga_view_aa_set( 23., -34., 0. )
# i_edgid = 1
i_edgid = 1
db_count_surfaces_for_edge @
( i_edgid, @
i_count )
SYS_ALLOCATE_ARRAY(iv_srfid,1,i_count)
Main Index
1052
Code Examples
db_get_surfaces_for_edge @
( i_edgid, @
i_count, @
iv_srfid )
SYS_FREE_STRING(sv_asm_create_patch_xy)
SYS_FREE_ARRAY(iv_srfid)
#---------------------------------------------------------------------
sgm_associate_nodes_curve ()
STRING fem_create_nodes__nodes_created[VIRTUAL]
STRING asm_create_line_xyz_created_ids[VIRTUAL]
STRING s_node_list[32]
STRING s_curve_list[32]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Creating the nodes.
i_return_value = @
fem_create_nodes_1 @
( "Coord 0", @
"Coord 0", @
2, @
"#", @
"[0 0 0 ]", @
fem_create_nodes__nodes_created )
dump i_return_value
i_return_value = @
fem_create_nodes_1 @
( "Coord 0", @
"Coord 0", @
2, @
"#", @
Main Index
CHAPTER 7 1053
Geometry
dump i_return_value
i_return_value = @
fem_create_nodes_1 @
( "Coord 0", @
"Coord 0", @
2, @
"#", @
"[1.0 1.0 0 ]", @
fem_create_nodes__nodes_created )
dump i_return_value
#---------------------------------------------------------------------
# Creating the curve
i_return_value = @
asm_const_line_xyz @
( "1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_line_xyz_created_ids )
dump i_return_value
#---------------------------------------------------------------------
# Associating the nodes with the curve.
i_return_value = sgm_associate_nodes_curve( @
s_node_list, @
s_curve_list )
dump i_return_value
#---------------------------------------------------------------------
sys_free_string(asm_create_line_xyz_created_ids)
#---------------------------------------------------------------------
sgm_const_curve_project_v1 ()
# entity_type,
# delete_org,
# project_method,
# vector,
# coord_frame,
# prjtol,
# created_ids )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_output_ids[16]
STRING s_curve_list[16]
STRING s_entity_list[16]
INTEGER i_entity_type
LOGICAL l_delete_org
INTEGER i_project_method
STRING s_vector[16]
STRING s_coord_frame[16]
REAL r_prjtol
STRING sv_created_ids[VIRTUAL]
INTEGER i_return_value
STRING sv_sgm_create_surface_crtd_ids[VIRTUAL]
STRING sv_asm_line_3point_created_ids[VIRTUAL]
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Enabling curve and point label.
curve_label(TRUE)
point_label(TRUE)
#---------------------------------------------------------------------
# Creating a surface by giving vertex points.
i_return_value = @
sgm_const_surface_vertex( "1", "[0 0 0]", @
"[4 1 -.5]", "[3.5 2.1 4]", "[-.5 3 2.2]", @
sv_sgm_create_surface_crtd_ids )
dump i_return_value
#---------------------------------------------------------------------
# Creating a curve by specifying three points.
i_return_value = @
asm_const_line_3point( "1", "[1 1 .5]", @
"[.4 -.2 1]", "[3 0 -.1]", 1, 0.5, @
sv_asm_line_3point_created_ids )
dump i_return_value
#---------------------------------------------------------------------
# Changing view for proper view of the surface.
i_return_value = ga_view_aa_set( -20., 70., -160. )
dump i_return_value
#---------------------------------------------------------------------
# Making the surface interior clear on the screen.
dump i_return_value
#---------------------------------------------------------------------
# Creating a projected curve on the surface without deleting the old.
s_output_ids = "#"
s_curve_list = "Curve 1"
s_entity_list = "Surface 1"
i_entity_type = 1
l_delete_org = FALSE
s_coord_frame = "Coord 0"
r_prjtol = 1e-05
i_return_value = @
sgm_const_curve_project_v1 @
Main Index
CHAPTER 7 1055
Geometry
( s_output_ids, @
s_curve_list, @
s_entity_list, @
i_entity_type, @
l_delete_org, @
i_project_method, @
s_vector, @
s_coord_frame, @
r_prjtol, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
#---------------------------------------------------------------------
sys_free_string(sv_created_ids)
sys_free_string(sv_sgm_create_surface_crtd_ids)
sys_free_string(sv_asm_line_3point_created_ids)
#---------------------------------------------------------------------
sgm_construct_solid_brep ()
i_return_value = @
asm_const_patch_xyz( "2", "<1 0 1>", @
"[0 0 0]", "Coord 0", @
sv_asm_patch_created_ids )
i_return_value = @
asm_const_patch_xyz( "3", "<0 1 1>", @
"[0 0 0]", "Coord 0", @
sv_asm_patch_created_ids )
i_return_value = @
asm_const_patch_xyz( "4", "<0 1 1>", @
"[1 0 0]", "Coord 0", @
sv_asm_patch_created_ids )
i_return_value = @
asm_const_patch_xyz( "5", "<1 0 1>", @
"[0 1 0]", "Coord 0", @
sv_asm_patch_created_ids )
i_return_value = @
asm_const_patch_xyz( "6", "<1 1 0>", @
"[0 0 1]", "Coord 0", @
sv_asm_patch_created_ids )
#---------------------------------------------------------------------
# Create the solid from the surfaces.
s_output_ids = "1"
s_surface_list = "Surface 1:6"
l_delete_surface = FALSE
i_return_value = @
sgm_construct_solid_brep( @
s_output_ids, @
s_surface_list, @
l_delete_surface, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
#---------------------------------------------------------------------
sys_free_string( sv_created_ids )
sys_free_string( sv_asm_patch_created_ids)
#---------------------------------------------------------------------~
sgm_construct_solid_volume ()
#
# sgm_construct_solid_volume
# ( output_ids,
# surface_list,
# delete_surface,
# created_ids )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_output_ids[32]
STRING s_surface_list[32]
LOGICAL l_delete_surface
STRING sv_asm_patch_created_ids[VIRTUAL]
STRING sv_created_ids[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database
uil_file_new.go( "", "new.db" )
$? YES 36000002
#---------------------------------------------------------------------
# Show the labels of the surfaces and solids.
surface_label(TRUE)
solid_label(TRUE)
#---------------------------------------------------------------------
ga_view_aa_set(23.,-34.,0.)
uil_toolbar.shaded_smooth( )
#---------------------------------------------------------------------
# Create the patches.
i_return_value = @
asm_const_patch_xyz( "1", "<1 1 0>", @
"[0 0 0]", "Coord 0", @
sv_asm_patch_created_ids )
i_return_value = @
asm_const_patch_xyz( "2", "<1 0 1>", @
"[0 0 0]", "Coord 0", @
sv_asm_patch_created_ids )
i_return_value = @
asm_const_patch_xyz( "3", "<0 1 1>", @
"[0 0 0]", "Coord 0", @
sv_asm_patch_created_ids )
i_return_value = @
asm_const_patch_xyz( "4", "<0 1 1>", @
"[1 0 0]", "Coord 0", @
sv_asm_patch_created_ids )
i_return_value = @
asm_const_patch_xyz( "5", "<1 0 1>", @
"[0 1 0]", "Coord 0", @
sv_asm_patch_created_ids )
i_return_value = @
asm_const_patch_xyz( "6", "<1 1 0>", @
"[0 0 1]", "Coord 0", @
sv_asm_patch_created_ids )
#---------------------------------------------------------------------
# Create the solid from the surfaces.
s_output_ids = "1"
s_surface_list = "Surface 1:6"
l_delete_surface = FALSE
i_return_value = @
sgm_construct_solid_volume( @
Main Index
1058
Code Examples
s_output_ids, @
s_surface_list, @
l_delete_surface, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
#---------------------------------------------------------------------
sys_free_string( sv_created_ids )
sys_free_string( sv_asm_patch_created_ids)
#---------------------------------------------------------------------
sgm_create_curve_on_surface ()
i_return_value = @
ga_view_aa_set( 23., -34., 0. )
dump i_return_value
#---------------------------------------------------------------------
# Enabling the surface and the solid labels.
solid_label(TRUE)
surface_label(TRUE)
#---------------------------------------------------------------------
# Creating a Surface.
Main Index
CHAPTER 7 1059
Geometry
i_return_value = asm_const_patch_xyz( @
"1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
#---------------------------------------------------------------------
# Get the surface id for surface label = 1.
i_label = 1
db_get_surface_id @
( i_label, @
i_surface_id )
dump i_surface_id
# i_entitytype = 3 (surface)
i_entitytype = 3
#---------------------------------------------------------------------
# Get the surface blob size.
sgm_db_get_blob_size @
( i_entitytype, @
i_surface_id, @
i_blobsize, @
i_return_value )
dump i_return_value
SYS_ALLOCATE_ARRAY(rv_surface_blob,1,i_blobsize)
#---------------------------------------------------------------------
# Get the surface blob.
sgm_db_get_surface @
( i_surface_id, @
i_blobsize, @
rv_surface_blob, @
i_return_value )
dump i_return_value
#---------------------------------------------------------------------
# Defining the size of the curve blob
i_curve_blob_size = i_blobsize + 50
sys_allocate_array(ra_curve_blob_out, 1, i_curve_blob_size)
#---------------------------------------------------------------------
# Get the curve blob.
i_direction = 2
r_param_value = 0.3
i_return_value = @
sgm_create_curve_on_surface @
( i_direction, @
r_param_value, @
rv_surface_blob, @
ra_curve_blob_out )
dump i_return_value
dump ra_curve_blob_out
#---------------------------------------------------------------------
sys_free_array(rv_surface_blob)
sys_free_array(ra_curve_blob_out)
#---------------------------------------------------------------------
Main Index
1060
Code Examples
sgm_create_surface_composite_c ()
sv_asm_create_patch_xy_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Create 3 points
i_return_value = @
asm_const_grid_xyz @
( "", "[2 15 0][5 13 0][8 15 0]", @
"Coord 0", @
sv_asm_create_grid_xyz_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Create one line passing through the 3 points created.
i_return_value = @
asm_const_line_3point( "1", "Point 5 ", @
"Point 6 ", "Point 7 ", 1, 0.5, @
sv_asm_line_3point_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Create the surface using the two curves.
i_return_value = @
sgm_const_surface_2curve( "2", @
"Surface 1.2", "Curve 1 ", @
sv_sgm_surface_2curve_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Mirror the surface
i_return_value = @
sgm_transform_mirror( "3", "surface", @
"Coord 0.2", 5.0, TRUE, FALSE, @
"Surface 2 ", sv_sgm_transform_surf_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Create the composite surface using Surface 3 1 2. Surface 4 will
# be created in place of Surfaces 3 1 2 and the old surfaces are
# deleted.
#
s_output_labels= "4"
s_surface_list = "Surface 3 1 2"
i_flag = 0
r_cleantol = 0.1
r_gaptol = 0.005
i_curve_start_label = 5
i_loop_id = 1
s_add_list = ""
s_remove_list = ""
s_inner_loop_list = ""
s_vertex_list = ""
l_delete_cons = TRUE
l_implicit_topology = TRUE
if (!sgm_create_surface_comptrim.is_inter_active() ) then
flag1 = i_flag + 0x0100
status =
sgm_reg_get_free_edge_list(s_surface_list,s_inner_loop_list,flag1,@
i_curve_start_label, tol1)
flag1 = 0x0100
status = sgm_reg_mod_free_edge_list( s_add_list,s_remove_list,seg,flag1)
if (l_implicit_topology) then
status = sgm_reg_load_vertex_list(" ",i_flag)
else
status = sgm_reg_load_vertex_list(s_vertex_list,i_flag)
end if
flag1 = i_flag + 0x0100
status = sgm_create_surface_comptrim.check_cb(r_cleantol,flag1, i_loop_id
)
end if
Main Index
1062
Code Examples
i_return_value = @
sgm_create_surface_composite_c @
( s_output_labels, @
s_surface_list, @
i_flag, @
r_gaptol, @
l_delete_cons, @
l_implicit_topology, @
sv_created_labels )
$? YES 38000219
dump i_return_value
#---------------------------------------------------------------------
# Created Labels
dump sv_created_labels
sgm_create_surface_comptrim_v1 ()
LOGICAL l_delete_ocurve
LOGICAL l_delete_icurve
LOGICAL l_implicit_topo
STRING sv_created_ids[VIRTUAL]
INTEGER i_return_value
INTEGER i_sgm_create_curve_aut_segt_id
STRING sv_asm_create_patch_xy_creat_id[VIRTUAL]
STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL]
STRING sv_asm_line_2point_creat_id[VIRTUAL]
STRING sv_sgm_create_curve_2d_creat_id[VIRTUAL]
STRING sv_sgm_creat_cur_creat_curve_id[VIRTUAL]
#---------------------------------------------------------------------
# Open a new database
uil_file_new.go( "", "new.db" )
$? YES 36000002
#---------------------------------------------------------------------
# Show the labels of the surfaces and curves.
surface_label(TRUE)
curve_label(TRUE)
#---------------------------------------------------------------------
# Create a patch.
i_return_value = @
asm_const_patch_xyz( "1", "<10 10 0>", @
"[0 0 0]", "Coord 0", @
sv_asm_create_patch_xy_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Create 4 points.
i_return_value = @
asm_const_grid_xyz( "", "[5 0 0] [0 5 0] "// @
"[5 10 0][10 5 0]", @
"Coord 0", sv_asm_create_grid_xyz_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Create 4 curves.
i_return_value = @
asm_const_line_2point( "", "Point 5:8 ", @
"Point 6 7 8 5", 0, "", 50., 1, @
sv_asm_line_2point_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Create a circular curve.
i_return_value = @
sgm_const_curve_2d_circle_v1( "", 1, 1., @
"Coord 0.3", "", "[5 5 0]", TRUE , @
sv_sgm_create_curve_2d_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Convert the Curve 1:4 into a chain curve.
i_return_value = @
sgm_create_curve_chain_v1( "10", @
" Curve 1:4", TRUE, @
i_sgm_create_curve_aut_segt_id, @
sv_sgm_creat_cur_creat_curve_id )
$? YES 38000217
dump i_return_value
#---------------------------------------------------------------------
# Call the function to create a trimmed surface inside the Surface 1
# with Curve 10 as outer boundary trim curve and Curve 5 as inner
# boundary trim curve.
#
s_output_ids = "2"
s_surface_list = "Surface 1"
s_curveo_list = "Curve 10"
s_curvei_list = "Curve 5"
r_gap_dist = 0.0
l_delete_surface = TRUE
Main Index
1064
Code Examples
l_delete_ocurve = TRUE
l_delete_icurve = TRUE
l_implicit_topo = TRUE
i_return_value = @
sgm_create_surface_comptrim_v1 @
( s_output_ids, @
s_surface_list, @
s_curveo_list, @
s_curvei_list, @
r_gap_dist, @
l_delete_surface, @
l_delete_ocurve, @
l_delete_icurve, @
l_implicit_topo, @
sv_created_ids )
$? YES 38000217
$? YES 38000217
$? YES 38000219
dump i_return_value
# Created surface is
dump sv_created_ids
#---------------------------------------------------------------------
sys_free_string( sv_created_ids )
sys_free_string( sv_asm_create_patch_xy_creat_id )
sys_free_string( sv_asm_create_grid_xyz_creat_id )
sys_free_string( sv_asm_line_2point_creat_id )
sys_free_string( sv_sgm_create_curve_2d_creat_id )
sys_free_string( sv_sgm_creat_cur_creat_curve_id )
#---------------------------------------------------------------------
sgm_create_surface_from_elems1 ()
INTEGER surface_label_val
STRING s_element_list[32]
INTEGER i_preview
STRING s_node_list[32]
INTEGER i_inner_loop_option
STRING s_inner_loop_nodes[32]
LOGICAL l_delete_original
INTEGER i_smoother_option
INTEGER sgm_create_surf_corner_node_ids(4)
STRING sgm_create_surface__deleted_ids[VIRTUAL]
STRING sgm_create_surfac_created_label[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Creating four nodes.
i_return_value = fem_create_nodes_1( @
"Coord 0", @
"Coord 0", @
2, @
"#", @
" [0 0 0]", @
fem_create_nodes__nodes_created )
dump i_return_value
i_return_value = fem_create_nodes_1( @
"Coord 0", @
"Coord 0", @
2, @
"#", @
" [1 0 0]", @
fem_create_nodes__nodes_created )
dump i_return_value
i_return_value = fem_create_nodes_1( @
"Coord 0", @
"Coord 0", @
2, @
"#", @
" [1 1 0]", @
fem_create_nodes__nodes_created )
dump i_return_value
i_return_value = fem_create_nodes_1( @
"Coord 0", @
"Coord 0", @
2, @
"#", @
" [0 1 0]", @
fem_create_nodes__nodes_created )
dump i_return_value
#---------------------------------------------------------------------
# Creating element.
i_return_value = fem_create_elems_1( @
"Quad", @
"Quad4", @
"1", @
"Standard", @
2, @
"Node 1","Node 2","Node 3", @
"Node 4", "", "", "", "", @
fem_create_elemen_elems_created )
dump i_return_value
Main Index
1066
Code Examples
#---------------------------------------------------------------------
# Putting on the labels.
point_label(TRUE)
curve_label(TRUE)
node_label(TRUE)
quad_elem_label( TRUE )
#---------------------------------------------------------------------
# Creating the surface from the element in it's place by using
# the function sgm_create_surface_from_elems1().
surface_label_val = 1
s_element_list = "Elm 1"
i_preview = 0
s_node_list = ""
i_inner_loop_option = 0
s_inner_loop_nodes = ""
l_delete_original = FALSE
i_smoother_option = 1
i_return_value = sgm_create_surface_from_elems1( @
surface_label_val , @
s_element_list, @
i_preview, @
s_node_list, @
i_inner_loop_option, @
s_inner_loop_nodes, @
l_delete_original, @
i_smoother_option, @
sgm_create_surf_corner_node_ids, @
sgm_create_surface__deleted_ids, @
sgm_create_surfac_created_label )
dump i_return_value
dump sgm_create_surf_corner_node_ids
dump sgm_create_surface__deleted_ids
dump sgm_create_surfac_created_label
#---------------------------------------------------------------------
sys_free_string(sgm_create_surface__deleted_ids)
sys_free_string(sgm_create_surfac_created_label)
#---------------------------------------------------------------------
sgm_curve_convert_s_to_u ()
#
#---------------------------------------------------------------------
# Variable Declarations
REAL ra_curve_data(VIRTUAL)
INTEGER i_num_points
REAL ra_u(VIRTUAL)
REAL ra_s(2)
INTEGER i_surface_id
INTEGER i_label
STRING asm_create_patch_xy_created_ids[VIRTUAL]
INTEGER i_entitytype
INTEGER i_blobsize
INTEGER i_curve_blob_size
INTEGER i_direction
REAL r_param_value
REAL rv_surface_blob(VIRTUAL)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
i_return_value = @
ga_view_aa_set( 23., -34., 0. )
dump i_return_value
solid_label(TRUE)
surface_label(TRUE)
#---------------------------------------------------------------------
# Creating a Surface.
i_return_value = asm_const_patch_xyz( @
"1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
#---------------------------------------------------------------------
# Get the surface id for surface label = 1.
i_label = 1
db_get_surface_id @
( i_label, @
i_surface_id )
dump i_surface_id
# i_entitytype = 3 (surface)
i_entitytype = 3
#---------------------------------------------------------------------
# Get the surface blob size.
sgm_db_get_blob_size @
( i_entitytype, @
i_surface_id, @
i_blobsize, @
i_return_value )
dump i_return_value
SYS_ALLOCATE_ARRAY(rv_surface_blob,1,i_blobsize)
#---------------------------------------------------------------------
# Get the surface blob.
sgm_db_get_surface @
( i_surface_id, @
i_blobsize, @
rv_surface_blob, @
Main Index
1068
Code Examples
i_return_value )
dump i_return_value
#---------------------------------------------------------------------
# Defining the size of the curve blob
i_curve_blob_size = i_blobsize + 50
sys_allocate_array(ra_curve_data, 1, i_curve_blob_size)
#---------------------------------------------------------------------
# Get the curve blob.
i_direction = 2
r_param_value = 0.3
i_return_value = @
sgm_create_curve_on_surface @
( i_direction, @
r_param_value, @
rv_surface_blob, @
ra_curve_data )
dump i_return_value
#---------------------------------------------------------------------
# Using the function to convert the coordinates.
i_num_points = 2
ra_s = [1.0, 0.2]
sys_allocate_array(ra_u,1,i_num_points)
sgm_curve_convert_s_to_u @
( ra_curve_data, @
i_num_points, @
ra_s, @
ra_u, @
i_return_value )
dump i_return_value
dump ra_u
#---------------------------------------------------------------------
sys_free_array(rv_surface_blob)
sys_free_array(ra_curve_data)
#---------------------------------------------------------------------
sgm_curve_convert_u_to_s ()
#---------------------------------------------------------------------
# Variable Declarations
REAL ra_curve_data(VIRTUAL)
INTEGER i_num_points
REAL ra_s(VIRTUAL)
REAL ra_u(2)
INTEGER i_surface_id
INTEGER i_label
STRING asm_create_patch_xy_created_ids[VIRTUAL]
INTEGER i_entitytype
INTEGER i_blobsize
INTEGER i_curve_blob_size
INTEGER i_direction
REAL r_param_value
REAL rv_surface_blob(VIRTUAL)
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
i_return_value = @
ga_view_aa_set( 23., -34., 0. )
dump i_return_value
solid_label(TRUE)
surface_label(TRUE)
#---------------------------------------------------------------------
# Creating a Surface.
i_return_value = asm_const_patch_xyz( @
"1", @
"<1 1 0>", @
"[0 0 0]", @
"Coord 0", @
asm_create_patch_xy_created_ids )
#---------------------------------------------------------------------
# Get the surface id for surface label = 1.
i_label = 1
db_get_surface_id @
( i_label, @
i_surface_id )
dump i_surface_id
# i_entitytype = 3 (surface)
i_entitytype = 3
#---------------------------------------------------------------------
# Get the surface blob size.
sgm_db_get_blob_size @
( i_entitytype, @
i_surface_id, @
i_blobsize, @
i_return_value )
dump i_return_value
SYS_ALLOCATE_ARRAY(rv_surface_blob,1,i_blobsize)
#---------------------------------------------------------------------
# Get the surface blob.
sgm_db_get_surface @
( i_surface_id, @
i_blobsize, @
rv_surface_blob, @
i_return_value )
Main Index
1070
Code Examples
dump i_return_value
#---------------------------------------------------------------------
# Defining the size of the curve blob
i_curve_blob_size = i_blobsize + 50
sys_allocate_array(ra_curve_data, 1, i_curve_blob_size)
#---------------------------------------------------------------------
# Get the curve blob.
i_direction = 2
r_param_value = 0.3
i_return_value = @
sgm_create_curve_on_surface @
( i_direction, @
r_param_value, @
rv_surface_blob, @
ra_curve_data )
dump i_return_value
#---------------------------------------------------------------------
# Using the function to convert the coordinates.
i_num_points = 2
ra_u = [1.0, 0.2]
sys_allocate_array(ra_s,1,i_num_points)
sgm_curve_convert_u_to_s @
( ra_curve_data, @
i_num_points, @
ra_u, @
ra_s, @
i_return_value )
dump i_return_value
dump ra_s
#---------------------------------------------------------------------
sys_free_array(rv_surface_blob)
sys_free_array(ra_curve_data)
#---------------------------------------------------------------------
sgm_curve_evaluate ()
# ( s,
# ui,
# in,
# pd,
# irc )
#
#---------------------------------------------------------------------
# Variable Declarations
REAL ra_s(VIRTUAL)
REAL r_ui
INTEGER i_in
REAL ra_pd(1,3)
INTEGER i_curveid
INTEGER i_blobsize
INTEGER i_entitytype
INTEGER i_label
INTEGER i_status
INTEGER i_irc
#---------------------------------------------------------------------
# Open the database “spool.db”
uil_file_open.go(“spool.db”)
# r_ui = 0.3
r_ui = 0.3
# i_in = 0
i_in = 0
# i_label = 1
i_label = 1
dump i_curveid
# i_entitytype = 2 (curve)
i_entitytype = 2
dump i_blobsize
dump i_status
SYS_ALLOCATE_ARRAY(ra_s,1,i_blobsize)
sgm_db_get_curve @
( i_curveid, @
i_blobsize, @
ra_s, @
i_status )
dump ra_s
dump i_status
sgm_curve_evaluate @
( ra_s, @
r_ui, @
i_in, @
ra_pd, @
i_irc )
Main Index
1072
Code Examples
dump i_irc
dump r_ui
dump i_in
dump i_irc
#---------------------------------------------------------------------
sgm_db_get_blob_size ()
# i_entitytype = 2 (curve)
i_entitytype = 2
dump i_entityid
sgm_db_get_blob_size @
( i_entitytype, @
Main Index
CHAPTER 7 1073
Geometry
i_entityid, @
i_blobsize, @
i_status )
# Error status
dump i_status
# Size of blob is
dump i_blobsize
#---------------------------------------------------------------------
sgm_db_get_company_of_origin ()
# i_dbtype = 1
i_dbtype = 1
dump i_entityid
Main Index
1074
Code Examples
sgm_db_get_company_of_origin @
( i_dbtype, @
i_entityid, @
i_compoforg, @
i_geometrytype, @
i_status )
# Error Status
dump i_status
#---------------------------------------------------------------------
sgm_db_get_curve ()
# i_label = 1
i_label = 1
i_curveid )
dump i_curveid
# i_entitytype = 2 (curve)
i_entitytype = 2
dump i_blobsize
dump i_status
SYS_ALLOCATE_ARRAY(ra_blob,1,i_blobsize)
sgm_db_get_curve @
( i_curveid, @
i_blobsize, @
ra_blob, @
i_status )
dump i_status
SYS_FREE_ARRAY(ra_blob)
#---------------------------------------------------------------------
sgm_db_get_edge_vertex_ids ()
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
sgm_db_get_edge_vertex_ids @
( i_edgeid, @
ia_vertexids )
dump i_return_value
SYS_FREE_STRING(sv_asm_line_2point_created_ids)
#---------------------------------------------------------------------
sgm_db_get_gen_body_face_ids ()
INTEGER iv_faceorients(VIRTUAL)
INTEGER iv_facesense(VIRTUAL)
STRING sv_asm_create_hpat_xyz[VIRTUAL]
INTEGER i_status
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
SYS_ALLOCATE_ARRAY(iv_faceids,1,i_numberfaces)
SYS_ALLOCATE_ARRAY(iv_faceorients,1,i_numberfaces)
SYS_ALLOCATE_ARRAY(iv_facesense,1,i_numberfaces)
sgm_db_get_gen_body_face_ids @
( i_bodyid, @
i_numberfaces, @
iv_faceids, @
iv_faceorients, @
iv_facesense, @
i_status )
dump i_status
SYS_FREE_ARRAY(iv_faceids)
SYS_FREE_ARRAY(iv_faceorients)
SYS_FREE_ARRAY(iv_facesense)
SYS_FREE_STRING(sv_asm_create_hpat_xyz)
#---------------------------------------------------------------------
Main Index
1078
Code Examples
sgm_db_get_gen_body_vertex_ids ()
sgm_db_get_num_vertices_body( i_bodyid, @
i_numvert, @
i_status )
dump i_numvert
SYS_ALLOCATE_ARRAY(iv_vertexids,1,i_numvert)
sgm_db_get_gen_body_vertex_ids @
( i_bodyid, @
i_numvert, @
iv_vertexids, @
i_status )
Main Index
CHAPTER 7 1079
Geometry
dump i_status
SYS_FREE_ARRAY(iv_vertexids)
SYS_FREE_STRING(sv_asm_create_hpat_xyz)
#---------------------------------------------------------------------
sgm_db_get_gen_face_edge_ids ()
uil_toolbar.labels_on( )
ga_view_aa_set( 23., -34., 0. )
Main Index
1080
Code Examples
# Get the number of edges and number of loops for the surface
# with label = 1.
sgm_db_get_num_loops_face( i_surfaceid, @
l_getedges, @
i_numberloops, @
i_numberedges, @
ia_numegloop, @
i_status )
SYS_ALLOCATE_ARRAY(iv_loopids,1,i_numberedges)
SYS_ALLOCATE_ARRAY(iv_edgeids,1,i_numberedges)
SYS_ALLOCATE_ARRAY(iv_edgeorients,1,i_numberedges)
i_return_value = @
sgm_db_get_gen_face_edge_ids @
( i_surfaceid, @
i_numberloops, @
i_numberedges, @
iv_loopids, @
iv_edgeids, @
iv_edgeorients )
dump i_return_value
SYS_FREE_ARRAY(iv_loopids)
SYS_FREE_ARRAY(iv_edgeids)
SYS_FREE_ARRAY(iv_edgeorients)
SYS_FREE_STRING(sv_asm_create_patch_xy)
#---------------------------------------------------------------------
sgm_db_get_gen_face_vertex_ids ()
# numberverts,
# vertexids )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_surfaceid
INTEGER i_label
INTEGER i_numberverts
INTEGER iv_vertexids(VIRTUAL)
STRING sv_asm_create_patch_xy[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# i_label = 2
i_label = 2
db_get_surface_id( i_label, @
i_surfaceid )
# i_numberverts = 4
i_numberverts = 4
SYS_ALLOCATE_ARRAY(iv_vertexids,1,i_numberverts)
i_return_value = @
sgm_db_get_gen_face_vertex_ids @
( i_surfaceid, @
i_numberverts, @
iv_vertexids )
dump i_return_value
SYS_FREE_ARRAY(iv_vertexids)
SYS_FREE_STRING(sv_asm_create_patch_xy)
#---------------------------------------------------------------------
sgm_db_get_num_edges_face ()
#
# The function sgm_db_get_num_edges_face()
# has the following arguments:
#
# sgm_db_get_num_edges_face
# ( surfaceid,
# numberfaces )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_surfaceid
INTEGER i_label
INTEGER i_numberfaces
STRING sv_asm_create_patch_xy[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
i_return_value = @
sgm_db_get_num_edges_face @
( i_surfaceid, @
i_numberfaces )
dump i_return_value
SYS_FREE_STRING(sv_asm_create_patch_xy)
#---------------------------------------------------------------------
sgm_db_get_num_faces_body ()
sgm_db_get_num_faces_body @
( i_bodyid, @
i_numberfaces, @
i_status )
dump i_status
SYS_FREE_STRING(sv_asm_create_hpat_xyz)
#---------------------------------------------------------------------
sgm_db_get_num_loops_face ()
# i_label = 1
i_label = 1
db_get_surface_id @
( i_label, @
i_surfaceid )
# Get the number of loops for the surface and the total no of edges.
# l_getedges = FALSE
l_getedges = FALSE
sgm_db_get_num_loops_face @
( i_surfaceid, @
l_getedges, @
i_numloops, @
i_numedges, @
iv_numegploop, @
i_status )
dump i_status
SYS_ALLOCATE_ARRAY(iv_numegploop,1,i_numloops)
sgm_db_get_num_loops_face @
( i_surfaceid, @
l_getedges, @
i_numloops, @
i_numedges, @
iv_numegploop, @
Main Index
CHAPTER 7 1085
Geometry
i_status )
dump i_status
SYS_FREE_ARRAY(iv_numegploop)
#---------------------------------------------------------------------
sgm_db_get_num_vertices_body ()
# i_label = 4
i_label = 4
db_get_solid_id @
( i_label, @
i_bodyid )
sgm_db_get_num_vertices_body @
( i_bodyid, @
i_numvert, @
i_status )
Main Index
1086
Code Examples
dump i_status
SYS_FREE_STRING(sv_asm_create_hpat)
#---------------------------------------------------------------------
sgm_db_get_point ()
# i_label = 9
i_label = 9
db_get_point_id @
( i_label, @
i_pointid )
dump i_pointid
sgm_db_get_point @
( i_pointid, @
ra_xyz, @
i_status )
dump i_status
#---------------------------------------------------------------------
Main Index
CHAPTER 7 1087
Geometry
sgm_db_get_solid ()
# i_label = 1
i_label = 1
# i_entitytype = 4 (solid)
i_entitytype = 4
SYS_ALLOCATE_ARRAY(rv_blob,1,i_blobsize)
Main Index
1088
Code Examples
sgm_db_get_solid @
( i_solidid, @
i_blobsize, @
rv_blob, @
i_status )
dump i_status
SYS_FREE_STRING(sv_asm_create_hpat)
SYS_FREE_ARRAY(rv_blob)
#---------------------------------------------------------------------
sgm_db_get_surface ()
# i_label = 1
i_label = 1
# i_entitytype = 3 (surface)
Main Index
CHAPTER 7 1089
Geometry
i_entitytype = 3
SYS_ALLOCATE_ARRAY(rv_blob,1,i_blobsize)
sgm_db_get_surface @
( i_surfaceid, @
i_blobsize, @
rv_blob, @
i_status )
dump i_status
SYS_FREE_ARRAY(rv_blob)
#---------------------------------------------------------------------
sgm_db_modify_entity_label ()
#
# The function sgm_db_modify_entity_label()
# has the following arguments:
#
# sgm_db_modify_entity_label
# ( entitytype,
# entityid,
# newlabel )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_entitytype
INTEGER i_entityid
INTEGER i_newlabel
INTEGER i_return_value
STRING s_members[VIRTUAL],s_group[32],sv_asm_create_grid[VIRTUAL]
INTEGER i_groupid
#---------------------------------------------------------------------
# Open a new database “new.db”
uil_file_new.go(““,”new.db”)
$? YES 36000002
# i_entitytype = 1
i_entitytype = 1
# i_entityid = 1
i_entityid = 1
# i_groupid = 1
i_groupid = 1
# i_newlabel = 100
i_newlabel = 100
dump i_groupid
db_get_group_name @
( i_groupid, @
s_group )
dump s_group
SYS_ALLOCATE_STRING(s_members,32)
dump s_members
i_return_value = @
sgm_db_modify_entity_label @
( i_entitytype, @
i_entityid, @
i_newlabel )
dump i_return_value
dump s_members
SYS_FREE_STRING( sv_asm_create_grid )
SYS_FREE_STRING( s_members )
#---------------------------------------------------------------------
Main Index
CHAPTER 7 1091
Geometry
sgm_edit_brep_break_plane_v1 ()
solid_label(TRUE)
i_return_value = @
ga_view_aa_set( 23., -34., 0. )
dump i_return_value
#---------------------------------------------------------------------
# Create a Solid.
i_return_value = @
asm_const_hpat_xyz( "1", "<1 1 1>", @
"[0 0 0]", "Coord 0", @
sv_asm_create_hpat_xyz_created )
dump i_return_value
#---------------------------------------------------------------------
# Create a Plane.
i_return_value = @
sgm_const_plane_3point( "1", "[0.5 0.5 0.5]", @
"[0.85 0.25 0.25]", "[0.25 0.25 0.85]", @
sv_sgm_create_plane_3p_created )
dump i_return_value
#---------------------------------------------------------------------
# Break the solid with a plane.
s_output_ids = "5"
s_solid_list = "solid 1"
s_plane_list = "plane 1"
Main Index
1092
Code Examples
l_delete_flag = FALSE
i_return_value = @
sgm_edit_brep_break_plane_v1 @
( s_output_ids, @
s_solid_list, @
s_plane_list, @
l_delete_flag, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
#---------------------------------------------------------------------
sys_free_string(sv_created_ids)
sys_free_string(sv_asm_create_hpat_xyz_created)
sys_free_string(sv_sgm_create_plane_3p_created)
#---------------------------------------------------------------------
sgm_edit_brep_break_surface_v1 ()
i_return_value = @
ga_view_aa_set( 23., -34., 0. )
dump i_return_value
solid_label(TRUE)
#---------------------------------------------------------------------
# Create a Solid.
Main Index
CHAPTER 7 1093
Geometry
i_return_value = @
asm_const_hpat_xyz( "1", "<1 1 1>", @
"[0 0 0]", "Coord 0", @
sv_asm_create_hpat_xyz_created )
dump i_return_value
#---------------------------------------------------------------------
# Create a Surface.
i_return_value = @
asm_const_patch_xyz( "1", "<1 1.5 1.2>", @
"[0.3 0 -0.5]", "Coord 0", @
sv_asm_create_patch_xy_created )
dump i_return_value
#---------------------------------------------------------------------
# Break the solid with a surface.
s_output_ids = "5"
s_solid_list = "solid 1"
s_surface_list = "surface 1"
l_delete_flag = FALSE
i_return_value = @
sgm_edit_brep_break_surface_v1 @
( s_output_ids, @
s_solid_list, @
s_surface_list, @
l_delete_flag, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
#---------------------------------------------------------------------
sys_free_string(sv_created_ids)
sys_free_string(sv_asm_create_hpat_xyz_created)
sys_free_string(sv_asm_create_patch_xy_created)
#---------------------------------------------------------------------
sgm_edit_point_equivalence ()
STRING s_point_list[16]
STRING asm_create_grid_xyz_created_ids[VIRTUAL]
Main Index
1094
Code Examples
STRING sv_created_ids[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Enabling the point labeling.
point_label(TRUE)
#---------------------------------------------------------------------
# Creating two points at the same location.
i_return_value = @
asm_const_grid_xyz( @
"1", "[1 1 0]", "Coord 0", @
asm_create_grid_xyz_created_ids )
dump i_return_value
i_return_value = @
asm_const_grid_xyz( @
"2", "[1 1 0]", "Coord 0", @
asm_create_grid_xyz_created_ids )
$? YES 1000034
dump i_return_value
#---------------------------------------------------------------------
# Using the function to combine the two equivalent points
# to get a single point at that place.
i_return_value = @
sgm_edit_point_equivalence @
( s_point_list, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
#---------------------------------------------------------------------
sys_free_string(sv_created_ids)
sys_free_string(asm_create_grid_xyz_created_ids)
#---------------------------------------------------------------------
sgm_edit_solid_break ()
# point_list,
# parameters,
# delete_orig,
# solid_list,
# created_ids )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_output_ids[16]
INTEGER i_option_type
STRING s_point_list[16]
REAL r_parameters(3)
LOGICAL l_delete_orig
STRING s_solid_list[16]
STRING asm_create_grid_xyz_created_ids[VIRTUAL]
STRING asm_create_hpat_xyz_created_ids[VIRTUAL]
STRING sv_created_ids[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Enabling the point labeling.
point_label(TRUE)
Solid_label(TRUE)
#---------------------------------------------------------------------
# Creating a point.
i_return_value = @
asm_const_grid_xyz( @
"1", "[0.5 0.5 0.5]", "Coord 0", @
asm_create_grid_xyz_created_ids )
dump i_return_value
#---------------------------------------------------------------------
# Creating a Solid.
i_return_value = @
asm_const_hpat_xyz( @
"1", "<1 1 1>", "[0 0 0]", "Coord 0", @
asm_create_grid_xyz_created_ids )
dump i_return_value
#---------------------------------------------------------------------
# Using the function to break the solid 1 by point 1
s_output_ids = "2"
i_option_type = 1
s_point_list = "Point 1"
r_parameters = [ 0. 0. 0.]
l_delete_orig = FALSE
s_solid_list = "Solid 1"
i_return_value = @
sgm_edit_solid_break @
( s_output_ids, @
i_option_type, @
s_point_list, @
r_parameters, @
l_delete_orig, @
s_solid_list, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
Main Index
1096
Code Examples
#---------------------------------------------------------------------
sys_free_string(sv_created_ids)
sys_free_string(asm_create_grid_xyz_created_ids)
sys_free_string(asm_create_hpat_xyz_created_ids)
#---------------------------------------------------------------------
sgm_edit_solid_refit_v1 ()
#---------------------------------------------------------------------
# Creating a Solid.
i_return_value = asm_const_hpat_xyz( @
"1", @
"<1 1 1>", @
"[0 0 0]", @
"Coord 0", @
asm_create_hpat_xyz_created_ids )
dump i_return_value
#---------------------------------------------------------------------
solid_label(TRUE)
surface_label(TRUE)
#---------------------------------------------------------------------
# Creating the next solid on this solid 1.
Main Index
CHAPTER 7 1097
Geometry
s_output_ids = "5"
r_tolerance = 1e-5
l_type_option = TRUE
l_delete_orig = FALSE
s_solid_list = "solid 1"
i_return_value = @
sgm_edit_solid_refit_v1 @
( s_output_ids, @
r_tolerance, @
l_type_option, @
l_delete_orig, @
s_solid_list, @
sv_created_labels )
$? YES 1000034
dump i_return_value
dump sv_created_labels
#---------------------------------------------------------------------
sys_free_string(asm_create_hpat_xyz_created_ids)
sys_free_string(sv_created_labels)
#---------------------------------------------------------------------
sgm_edit_solid_reverse ()
#---------------------------------------------------------------------
# putting on the parametric direction set.
ga_display_parametric_set("general",1)
#---------------------------------------------------------------------
# Creating a Solid.
i_return_value = asm_const_hpat_xyz( @
"1", @
Main Index
1098
Code Examples
"<1 1 1>", @
"[0 0 0]", @
"Coord 0", @
asm_create_hpat_xyz_created_ids )
dump i_return_value
#---------------------------------------------------------------------
solid_label(TRUE)
#---------------------------------------------------------------------
# Reversing the solid with respect to it's parametric
# direction. Watch the direction of the parametric
# direction set display.
i_return_value = @
sgm_edit_solid_reverse @
( s_solid_list, @
sv_created_labels )
$? YES 1000034
dump i_return_value
dump sv_created_labels
repaint_graphics()
#---------------------------------------------------------------------
sys_free_string(asm_create_hpat_xyz_created_ids)
sys_free_string(sv_created_labels)
#---------------------------------------------------------------------
sgm_edit_surface_edge_match ()
STRING asm_create_grid_xyz_created_ids[VIRTUAL]
STRING asm_line_2point_created_ids[VIRTUAL]
STRING sgm_create_curve_2d_created_ids[VIRTUAL]
STRING sgm_surface_4edge_created_ids[VIRTUAL]
INTEGER i_return_value
INTEGER i_surface_id(VIRTUAL)
INTEGER i_edge_id
INTEGER i_count
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Setting the graphics.
point_label( TRUE )
surface_label( TRUE )
curve_label( TRUE )
ga_view_aa_set( 23., -34., 0. )
#---------------------------------------------------------------------
# Creating the points.
i_return_value = asm_const_grid_xyz( @
"1", @
"[0 0 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
i_return_value = asm_const_grid_xyz( @
"2", @
"[1 0 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
i_return_value = asm_const_grid_xyz( @
"3", @
"[1 1 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
i_return_value = asm_const_grid_xyz( @
"4", @
"[0 1 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
i_return_value = asm_const_grid_xyz( @
"5", @
"[1 0 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
$? YES 1000034
i_return_value = asm_const_grid_xyz( @
"6", @
"[2 0 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
i_return_value = asm_const_grid_xyz( @
"7", @
"[2 1 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
Main Index
1100
Code Examples
i_return_value = asm_const_grid_xyz( @
"8", @
"[1 1 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
$? YES 1000034
i_return_value = asm_const_grid_xyz( @
"9", @
"[1.007 0.5 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
#---------------------------------------------------------------------
# Creating the straight curves.
i_return_value = asm_const_line_2point( @
"1", "Point 1","Point 2", @
0, "", 50., 1, @
asm_line_2point_created_ids )
i_return_value = asm_const_line_2point( @
"2", "Point 3","Point 4", @
0, "", 50., 1, @
asm_line_2point_created_ids )
i_return_value = asm_const_line_2point( @
"3", "Point 4","Point 1", @
0, "", 50., 1, @
asm_line_2point_created_ids )
i_return_value = asm_const_line_2point( @
"4", "Point 2","Point 3", @
0, "", 50., 1, @
asm_line_2point_created_ids )
i_return_value = asm_const_line_2point( @
"5", "Point 5","Point 6", @
0, "", 50., 1, @
asm_line_2point_created_ids )
i_return_value = asm_const_line_2point( @
"6", "Point 6","Point 7", @
0, "", 50., 1, @
asm_line_2point_created_ids )
i_return_value = asm_const_line_2point( @
"7", "Point 7","Point 8", @
0, "", 50., 1, @
asm_line_2point_created_ids )
#---------------------------------------------------------------------
# Creating the arc from three points.
i_return_value = sgm_const_curve_2d_arc3point_v2( @
"8", FALSE,"Coord 0.3", "Point 8",@
"Point 9", "Point 5",FALSE, @
sgm_create_curve_2d_created_ids )
#---------------------------------------------------------------------
# Creating the surfaces
i_return_value = sgm_const_surface_4edge( @
"1", "Curve 1", "Curve 2", @
"Curve 3", "Curve 4", @
sgm_surface_4edge_created_ids )
i_return_value = sgm_const_surface_4edge( @
Main Index
CHAPTER 7 1101
Geometry
#---------------------------------------------------------------------
# Checking the surfaces associated with the curve 8
i_edge_id = 8
i_return_value = db_count_surfaces_for_edge( @
i_edge_id, @
i_count )
dump i_count
sys_allocate_array(i_surface_id,1,i_count)
i_return_value = db_get_surfaces_for_edge( @
i_edge_id, @
i_count, @
i_surface_id )
dump i_return_value
dump i_surface_id
#---------------------------------------------------------------------
# Using the function sgm_edit_surface_edge_match() to match the
# edge between the two surfaces.
i_option = 2
s_surface_list_1 = "Surface 1"
s_surface_list_2 = "Surface 2"
l_delete_orig = FALSE
i_return_value = @
sgm_edit_surface_edge_match @
( i_option, @
s_surface_list_1, @
s_surface_list_2, @
l_delete_orig, @
sv_created_labels )
$? YESFORALL 38001105
dump i_return_value
dump sv_created_labels
#---------------------------------------------------------------------
# Checking the surfaces associated with the curve 9.
i_edge_id = 9
i_return_value = db_count_surfaces_for_edge( @
i_edge_id, @
i_count )
dump i_count
sys_allocate_array(i_surface_id,1,i_count)
i_return_value = db_get_surfaces_for_edge( @
i_edge_id, @
i_count, @
i_surface_id )
dump i_return_value
dump i_surface_id
#---------------------------------------------------------------------
sys_free_string(sv_created_labels)
sys_free_string(asm_create_grid_xyz_created_ids)
sys_free_string(asm_line_2point_created_ids)
sys_free_string(sgm_create_curve_2d_created_ids)
sys_free_string(sgm_surface_4edge_created_ids)
sys_free_array(i_surface_id)
#---------------------------------------------------------------------
Main Index
1102
Code Examples
sgm_edit_surface_sew ()
#---------------------------------------------------------------------
# Setting the graphics.
point_label( TRUE )
surface_label( TRUE )
curve_label( TRUE )
ga_view_aa_set( 23., -34., 0. )
#---------------------------------------------------------------------
# Creating the points.
i_return_value = asm_const_grid_xyz( @
"1", @
"[0 0 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
i_return_value = asm_const_grid_xyz( @
"2", @
"[1 0 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
i_return_value = asm_const_grid_xyz( @
"3", @
"[1 1 0]", @
Main Index
CHAPTER 7 1103
Geometry
"Coord 0", @
asm_create_grid_xyz_created_ids )
i_return_value = asm_const_grid_xyz( @
"4", @
"[0 1 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
i_return_value = asm_const_grid_xyz( @
"5", @
"[1 0 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
$? YES 1000034
i_return_value = asm_const_grid_xyz( @
"6", @
"[2 0 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
i_return_value = asm_const_grid_xyz( @
"7", @
"[2 1 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
i_return_value = asm_const_grid_xyz( @
"8", @
"[1 1 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
$? YES 1000034
i_return_value = asm_const_grid_xyz( @
"9", @
"[1.007 0.5 0]", @
"Coord 0", @
asm_create_grid_xyz_created_ids )
#---------------------------------------------------------------------
# Creating the straight curves.
i_return_value = asm_const_line_2point( @
"1", "Point 1","Point 2", @
0, "", 50., 1, @
asm_line_2point_created_ids )
i_return_value = asm_const_line_2point( @
"2", "Point 3","Point 4", @
0, "", 50., 1, @
asm_line_2point_created_ids )
i_return_value = asm_const_line_2point( @
"3", "Point 4","Point 1", @
0, "", 50., 1, @
asm_line_2point_created_ids )
i_return_value = asm_const_line_2point( @
"4", "Point 2","Point 3", @
0, "", 50., 1, @
asm_line_2point_created_ids )
i_return_value = asm_const_line_2point( @
"5", "Point 5","Point 6", @
Main Index
1104
Code Examples
0, "", 50., 1, @
asm_line_2point_created_ids )
i_return_value = asm_const_line_2point( @
"6", "Point 6","Point 7", @
0, "", 50., 1, @
asm_line_2point_created_ids )
i_return_value = asm_const_line_2point( @
"7", "Point 7","Point 8", @
0, "", 50., 1, @
asm_line_2point_created_ids )
#---------------------------------------------------------------------
# Creating the arc from three points.
i_return_value = sgm_const_curve_2d_arc3point_v2( @
"8", FALSE,"Coord 0.3", "Point 8",@
"Point 9", "Point 5",FALSE, @
sgm_create_curve_2d_created_ids )
#---------------------------------------------------------------------
# Creating the surfaces
i_return_value = sgm_const_surface_4edge( @
"1", "Curve 1", "Curve 2", @
"Curve 3", "Curve 4", @
sgm_surface_4edge_created_ids )
i_return_value = sgm_const_surface_4edge( @
"2", "Curve 5", "Curve 6", @
"Curve 7", "Curve 8", @
sgm_surface_4edge_created_ids )
#---------------------------------------------------------------------
# Checking the surfaces associated with the curve 8
i_edge_id = 8
i_return_value = db_count_surfaces_for_edge( @
i_edge_id, @
i_count )
dump i_count
sys_allocate_array(i_surface_id,1,i_count)
i_return_value = db_get_surfaces_for_edge( @
i_edge_id, @
i_count, @
i_surface_id )
dump i_return_value
dump i_surface_id
#---------------------------------------------------------------------
# Using the function sgm_edit_surface_sew() to sew the gap
# between the two surfaces.
i_return_value = @
sgm_edit_surface_sew @
( s_surface_list, @
sv_created_labels )
$?YESFORALL 38001105
dump i_return_value
dump sv_created_labels
#---------------------------------------------------------------------
# Checking the surfaces associated with the curve 9.
i_edge_id = 9
Main Index
CHAPTER 7 1105
Geometry
i_return_value = db_count_surfaces_for_edge( @
i_edge_id, @
i_count )
dump i_count
sys_allocate_array(i_surface_id,1,i_count)
i_return_value = db_get_surfaces_for_edge( @
i_edge_id, @
i_count, @
i_surface_id )
dump i_return_value
dump i_surface_id
#---------------------------------------------------------------------
sys_free_string(sv_created_labels)
sys_free_string(asm_create_grid_xyz_created_ids)
sys_free_string(asm_line_2point_created_ids)
sys_free_string(sgm_create_curve_2d_created_ids)
sys_free_string(sgm_surface_4edge_created_ids)
sys_free_array(i_surface_id)
#---------------------------------------------------------------------
sgm_get_arc_center_radius ()