Patran 2008 r1

PCL Reference Manual Volume 2: Code Examples

Main Index

Corporate
MSC.Software Corporation 2 MacArthur Place Santa Ana, CA 92707 USA Telephone: (800) 345-2078 Fax: (714) 784-4056

Europe
MSC.Software GmbH Am Moosfeld 13 81829 Munich, Germany Telephone: (49) (89) 43 19 87 0 Fax: (49) (89) 43 61 71 6

Asia Pacific
MSC.Software Japan Ltd. Shinjuku First West 8F 23-7 Nishi Shinjuku 1-Chome, Shinjuku-Ku Tokyo 160-0023, JAPAN Telephone: (81) (3)-6911-1200 Fax: (81) (3)-6911-1201

Worldwide Web
www.mscsoftware.com

Disclaimer
This documentation, as well as the software described in it, is furnished under license and may be used only in accordance with the terms of such license. MSC.Software Corporation reserves the right to make changes in specifications and other information contained in this document without prior notice. The concepts, methods, and examples presented in this text are for illustrative and educational purposes only, and are not intended to be exhaustive or to apply to any particular engineering problem or design. MSC.Software Corporation assumes no liability or responsibility to any person or company for direct or indirect damages resulting from the use of any information contained herein. User Documentation: Copyright ©2008 MSC.Software Corporation. Printed in U.S.A. All Rights Reserved. This notice shall be marked on any reproduction of this documentation, in whole or in part. Any reproduction or distribution of this document, in whole or in part, without the prior written consent of MSC.Software Corporation is prohibited. The software described herein may contain certain third-party software that is protected by copyright and licensed from MSC.Software suppliers. Contains IBM XL Fortran for AIX V8.1, Runtime Modules, (c) Copyright IBM Corporation 1990-2002, All Rights Reserved. MSC, MSC/, MSC Nastran, MD Nastran, MSC Fatigue, Marc, Patran, Dytran, and Laminate Modeler are trademarks or registered trademarks of MSC.Software Corporation in the United States and/or other countries. NASTRAN is a registered trademark of NASA. PAM-CRASH is a trademark or registered trademark of ESI Group. SAMCEF is a trademark or registered trademark of Samtech SA. LS-DYNA is a trademark or registered trademark of Livermore Software Technology Corporation. ANSYS is a registered trademark of SAS IP, Inc., a wholly owned subsidiary of ANSYS Inc. ACIS is a registered trademark of Spatial Technology, Inc. ABAQUS, and CATIA are registered trademark of Dassault Systemes, SA. EUCLID is a registered trademark of Matra Datavision Corporation. FLEXlm is a registered trademark of Macrovision Corporation. HPGL is a trademark of Hewlett Packard. PostScript is a registered trademark of Adobe Systems, Inc. PTC, CADDS and Pro/ENGINEER are trademarks or registered trademarks of Parametric Technology Corporation or its subsidiaries in the United States and/or other countries. Unigraphics, Parasolid and I-DEAS are registered trademarks of UGS Corp. a Siemens Group Company. All other brand names, product names or trademarks belong to their respective owners.

P3:V2008R1:Z:PCL-XPL:Z:DC-REF-PDF

Main Index

Contents
PCL Reference Manual Examples
1 Introduction
Introduction 2 3

m`i=o bñ~ãé

Supporting Files

2

Basic Functions
Introduction File Menu Group Menu Viewport Menu Viewing Menu Display Menu Tools Menu 9 47 81 127 175 293 8

3

Geometry Functions
Introduction 380 381 589

Construct Actions Disassemble Actions

4

Finite Element Functions
Introduction Create Action Transform Action Sweep Action 754 710 711 745

Main Index

iv PCL Reference Manual Examples
==

Renumber Action Disassociate Action Equivalence Action Optimize Action Verify Action Show Action Modify Action Delete Action Utilities 914

779 782 785 800

802 882 885 905

5

Property Assignment Functions
Introduction 926 927

Loads and Boundary Conditions Element Properties Beam Library Materials Load Cases Fields 969 953 964 946 937

6

Results Postprocessing Functions
Introduction 988 989 1025 1047 1062 1066

Results Utility Functions

Data Register Definition Functions Data Register Query Functions Data Register Operator Functions

Plot Tool Creation and Modification Functions Plot Tool Manipulation Functions 1087

Main Index

CONTENTS v

Animation Functions

1099 1117

Plot Tool Query Functions

7

XY Plot Functions
Introduction Create Action Post Action Modify Action Rename Action Delete Action 1134 1135 1162 1172 1346 1347

8

Preference Functions
Introduction 1352 1353 1355 1373 1417 1421 1424

Analysis Preferences Global Preferences Graphics Preferences Report Preferences Geometry Preferences

Finite Element Preferences

Main Index

vi PCL Reference Manual Examples
==

Main Index

Chapter 1: Introduction PCL Reference Manual Examples

1

Introduction
Introduction 1 3

Supporting Files

Main Index

2 PCL Reference Manual Examples
Introduction

Introduction
This manual provides examples of use of many of the PCL functions “built-in” to Patran that are available to the user. This manual is broken up into seven chapters that describe:
Basic Functions

This chapter provides examples for the functions that are used in the implementation of the File, Group, Viewport, Viewing, Display and Tools items on the menu bar. This chapter provides examples for the functions that are used to implement the “Geometry” form accessed through the switch bar. The switch bar is located between the menu bar and the tool bar near the top of the user interface. This chapter provides examples for the functions that are used in the implementation of the “Finite Elements” switch bar form. This chapter provides examples for the functions that are used in the implementation of the “Loads/BC,” “Material,” “Properties,” “Load Cases,” and “Fields” switch bar forms. This chapter provides examples for the functions that are used by the “Results” switch bar form. This chapter provides examples for the functions that are used in the implementation of the “XY Plot” switch bar form. This chapter provides examples for the functions that are used to control some of the settings or preferences used by many of the other forms used in Patran. Many of these functions are used in the implementation of the “Preferences” menu bar item.

Geometry Functions

Finite Element Functions Property Assignment Functions

Results Postprocessing Functions XY Plot Functions Preference Functions

Main Index

Chapter 1: Introduction 3
Supporting Files

Supporting Files
The spool.ses file is a session file that is used by many of the examples in this book. To use this file, hold down the control key and the right mouse button, highlight the text and paste it into a text file named spool.ses. Start Patran and go to File/Session/Play to run the session file. spool.ses
()

# # Purpose : This file will generate a PATRAN database # "spool.db" which consists of a free standing # aluminum spool, wound with a wire which results # in a compressive pressure on the spool's core # and flanges. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # Model : The spool is 8 units tall with a core diameter of # 2 units, a flange diameter of 8 units. Fillet # radius is 1 unit. The spool is made of aluminum, # 0.075 units thick. # # The model consists of # * +400 psi compressive pressure on spool core # * +20 psi compressive pressure on the top and # bottom flanges # * +400 to +20 psi compressive pressure varying # over the top and bottom flanges # # Analysis & After running this session file, analysis can be # Results: done by following these steps. # 1. Choose "MSC.Nastran" from "Preferences", # "Analysis..." pulldown menus on the menu bar. # 2. Select "Analysis" switch and from the form # displayed, select the "Subcase Select" menu # button from the "The Subcases For Solution Sequence: 101" # select both default and spool_loads from the List box # and it will be added the selected subcases list box. # Enter OK. This will generate Subcase 1 (Default subcase) # 3. Select the "Translation Parameters..." # button. From the "OUTPUT2 Fomat" Option Menu # select option "Text". Press "OK". # 4. Press "Apply" on "Analysis" window. # If MSC.Nastran is available this will create # a file "spool.op2" # 5. From the "Analysis" window, from "Action" # Option Menu, select "Read Output2" option. # 6. Click on the "Select Results File.." Button # and select "spool.op2". Press "Apply". # 7. The results will be read, and a file # "spool.jbr" is created. #--------------------------------------------------------------------# # Create a new database and set the preferences uil_file_new.go("", "./spool.db") $? YES 36000002 ga_viewport_size_set( "default_viewport", 3.5, 3.5, 1 )

Main Index

4 PCL Reference Manual Examples
Supporting Files

ga_viewport_location_set( "default_viewport", 0.0, 5.0, 1 ) db_set_pref( 303, 3, 0, FALSE, 0.0040000002, "" ) #--------------------------------------------------------------------# Construct two curves for the bottom flange and core STRING asm_create_line_xyz_created_ids[VIRTUAL] asm_const_line_xyz( "1", "<3 0 0>", "[0 0 0]", "Coord 0", @ asm_create_line_xyz_created_ids ) asm_const_line_xyz( "2", "<0 4 0>", "[0 0 0]", "Coord 0", @ asm_create_line_xyz_created_ids ) #--------------------------------------------------------------------# Create a fillet between the flange and the core curves STRING asm_create_line_fil_created_ids[VIRTUAL] asm_const_line_fillet( "3", 1, 1., 0.0040000002, TRUE, @ "Construct PointCurveUOnCurve (Evaluate Geometry"// @ "(Point 1 )) (Evaluate Geometry (Curve 1 ))", @ "Construct PointCurveUOnCurve (Evaluate Geometry"// @ "(Point 1 )) (Evaluate Geometry (Curve 2 ))", @ asm_create_line_fil_created_ids ) $# Do you wish to trim the original curves? $? YESFORALL 1000047 #--------------------------------------------------------------------# Create spool surface using Create's Revolve method STRING sgm_sweep_surface_r_created_ids[VIRTUAL] sgm_const_surface_revolve( "1", "{[-1 0 0][-1 1 0]}", 360., @ 0.,"Coord 0","Curve 1 3 2", sgm_sweep_surface_r_created_ids ) ga_view_aa_set( 30., 60., 0. ) ga_display_lines_set( "general", 2 ) #--------------------------------------------------------------------# Create the surfaces for the top half of the spool using # Mirror method STRING sgm_transform_surf__created_ids[VIRTUAL] sgm_transform_mirror( "4", "surface", "{[0 4 0][0 5 0]}", @ 0., TRUE, FALSE, "Surface 1:3 ", sgm_transform_surf__created_ids ) #--------------------------------------------------------------------# Set the positive surface normal vectors STRING sgm_edit_surface_r_reversed_ids[VIRTUAL] sgm_edit_surface_reverse( TRUE, "Surface 1:6", @ sgm_edit_surface_r_reversed_ids ) sgm_edit_surface_reverse( TRUE, "Surface 1:6", @ sgm_edit_surface_r_reversed_ids ) #--------------------------------------------------------------------# Create a local cylindrical coordinate frame STRING asm_create_cord_3po_created_ids[VIRTUAL] asm_const_coord_3point( "1", "Coord 0", 2, "[-1 0 0]", "[-1 1 0]", @ "[1 0 0]", asm_create_cord_3po_created_ids ) #--------------------------------------------------------------------# Create a pressure field 400_20_psi_transition fields_create( "400_20_psi_transition", "Spatial", 1, "Scalar", @ "Real", "Coord 1", "", "Function", 1, "R", "", "", @ "780-380*'R", "", "", FALSE, [0.], [0.], [0.], [[[0.]]] ) #--------------------------------------------------------------------# Apply a pressure varying from 400 to 20 psi on the fillet loadsbcs_create( "fillet_pressure", "Pressure", "Element Uniform", @ "2D", "Static", ["Surface 2 5"], "Geometry", "", 1., ["", @ "f:400_20_psi_transition", ""], ["", "", ""] ) # Apply a pressure of 400 psi on the core loadsbcs_create( "400_psi", "Pressure", "Element Uniform", "2D", @ "Static", ["Surface 3 6"], "Geometry", "", 1., ["", "400", @ ""], ["", "", ""] ) # Apply a pressure of 20 psi on the top and bottom flanges loadsbcs_create( "20_psi", "Pressure", "Element Uniform", "2D", @ "Static", ["Surface 1 4"], "Geometry", "", 1., ["", "20", ""], @ ["", "", ""] ) #--------------------------------------------------------------------# Apply displacement constraint at the centre of the spool loadsbcs_create( "TZ_fixed", "Displacement", "Nodal", "", "Static", @ ["Point 7"], "Geometry", "Coord 1", 1., ["<0,0,0>", "<0,0,0 >" @

Main Index

Chapter 1: Introduction 5
Supporting Files

], ["", ""] ) #--------------------------------------------------------------------# Create a new group called "fem_model" and make it current sys_poll_option( 2 ) ga_group_create( "fem_model" ) ga_group_current_set( "fem_model" ) $# Group "fem_model" created. sys_poll_option( 0 ) #--------------------------------------------------------------------# Define mesh seeds for the flanges, core and fillets ui_exec_function( "mesh_seed_display_mgr", "init" ) mesh_seed_create( "Curve 1 3 2 Surface 6.1 5.1 4.1 ", 1, 4, 0., @ 0., 0.) mesh_seed_create( "Surface 1.1 4.4 ", 1, 24, 0., 0., 0. ) mesh_seed_display_mgr.erase( ) #--------------------------------------------------------------------# Create the finite element mesh INTEGER fem_create_mesh_surfa_num_nodes INTEGER fem_create_mesh_surfa_num_elems STRING fem_create_mesh_s_nodes_created[VIRTUAL] STRING fem_create_mesh_s_elems_created[VIRTUAL] fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1:6 ", 1, [0.1], @ "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 ) #--------------------------------------------------------------------# Equivalence the coincident nodes REAL fem_equiv_all_x_equivtol INTEGER fem_equiv_all_x_segment fem_equiv_all_group3( [" "], 0, "", 1, 0.0040000002, FALSE, @ fem_equiv_all_x_equivtol, fem_equiv_all_x_segment ) #--------------------------------------------------------------------# Optimise the model INTEGER fem_optimize_iband(4) INTEGER fem_optimize_iprof(4) INTEGER fem_optimize_maxwf(4) REAL fem_optimize_avgwf(4) REAL fem_optimize_rmswf(4) fem_optimize( "Nodes", "Both", "Profile", 1, fem_optimize_iband, @ fem_optimize_iprof, fem_optimize_maxwf, fem_optimize_avgwf, @ fem_optimize_rmswf ) #--------------------------------------------------------------------# Define material properties for Aluminum material.create( "Analysis code ID", 1, "Analysis type ID", 1, @ "aluminum", 0, "Date: 14-May-97 Time: 13:49:55", @ "Isotropic", 1, "Directionality", 1, "Linearity", 1, @ "Homogeneous", 0, "Linear Elastic", 1, "Model Options & IDs", @ ["", "", "", "", ""], [0, 0, 0, 0, 0], "Active Flag", 1, @ "Create", 10, "External Flag", FALSE, "Property IDs", @ ["Elastic Modulus", "Poisson Ratio", "Density"], [2, 5, 16, 0], @ "Property Values", ["10.1e6", "0.33", "0.1", ""] ) #--------------------------------------------------------------------# Create and assign element properties elementprops_create( "const_thick_spool", 51, 25, 35, 1, 1, 20, @ [13, 20, 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:aluminum", "", "0.075", "", "", "", ""], "Surface 1:6" ) #--------------------------------------------------------------------# Create a load case consisting the pressures and displacement # constraint loadcase_create2( "spool_loads", "Static", "", 1., ["TZ_fixed", @ "20_psi", "400_psi", "fillet_pressure"], [0, 0, 0, 0], [1., 1., @ 1., 1.], "", 0., TRUE ) sys_poll_option( 2 ) #--------------------------------------------------------------------pref_fa_set([FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,@ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @

Main Index

6 PCL Reference Manual Examples
Supporting Files

FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @ FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, @ TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,@ TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,@ TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @ FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @ FALSE, FALSE, FALSE, FALSE, FALSE], [6, 3, 1, 1, 5, 7, 2, 2, 8,1,@ 2, 3, 3, 5, 2, 1, 3, 4, 5, 3, 3, 2, 2, 2, 2, 6, 6, 6, 3, 6, 15,5,@ 5, 5, 5, 6, 7, 8, 9, 10], [FALSE, FALSE, FALSE, FALSE, FALSE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @ FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE], [3, 4, 5, 6, 1,@ 1, 7, 8, 9, 10], [FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE,@ TRUE, TRUE, TRUE], FALSE ) display_fa_vectors( TRUE ) sys_poll_option( 0 ) #--------------------------------------------------------------------# End of File.

Main Index

Chapter 2: Basic Functions PCL Reference Manual Examples

2

Basic Functions
Introduction File Menu Group Menu Viewport Menu Viewing Menu Display Menu Tools Menu 9 47 81 127 175 293 8

Main Index

8 PCL Reference Manual Examples
Introduction

Introduction
This chapter provides examples for functions that are used in the implementation of the File, Group, Viewport, Viewing, Display and Tools items on the menu bar. See Basic Functions (Ch. 2) in the PCL Reference Manual for a description of these functions.

Main Index

Chapter 2: Basic Functions 9
File Menu

File Menu
This section contains examples of some of the functions used to import and export model geometry files to and from files that can be used by various types of CAD systems.
neutold_import_neutral

()

# Purpose : This file provides an example of a call to the # function neutold_import_neutral() # # This session file will open a existing database # ’plate.db’ and will export it to Neutral format # database by name plate_neutral.out.1. The same # file will be imported to demonstrate the effect # of the function. # # Before running this session file run plate.ses # to create plate.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function neutold_import_neutral() # has the following arguments: # # neutold_import_neutral # ( file_name, # group_name, # entity_toggle_flags, # minimum_id, # maximum_id, # offset ) # #--------------------------------------------------------------------# Variable Declarations STRING s_file_name[32] STRING s_group_name[32] LOGICAL la_entity_toggle_flags(35) INTEGER ia_minimum_id(35) INTEGER ia_maximum_id(35) INTEGER ia_offset(35) INTEGER i_return_value STRING s_title[64] LOGICAL l_all_groups INTEGER i_number_of_groups INTEGER ia_group_entity_ids(4) #--------------------------------------------------------------------# Open the database "plate.db" uil_file_open.go("plate.db") #--------------------------------------------------------------------# Exporting following entity types to the file ’plate_neutral.out.1’ # Entity types - Nodes, Elements, Material, Element Properties la_entity_toggle_flags(1) = TRUE la_entity_toggle_flags(2) = TRUE la_entity_toggle_flags(3) = TRUE la_entity_toggle_flags(4) = TRUE s_file_name s_title l_all_groups i_number_of_groups = = = = "plate_neutral.out" "File created by exporting Patran database" FALSE 1

Main Index

10 PCL Reference Manual Examples
File Menu

ia_group_entity_ids = [1, 0, 0, 0] # i_return_value = neutral_export2 ( s_file_name, s_title, la_entity_toggle_flags, l_all_groups, i_number_of_groups, ia_group_entity_ids ) dump i_return_value

@ @ @ @ @ @ @

# Closing the current database ’plate.db’. uil_file_close.go( ) #--------------------------------------------------------------------# Opening a new database by name ’new.db’. uil_file_new.go( "", "new.db" ) $? YES 36000002 #--------------------------------------------------------------------# Importing the file with all entities in default_group. s_file_name = "plate_neutral.out.1" s_group_name = "default_group" ia_offset(1) = 3 ia_offset(2) = 7 # i_return_value = @ neutold_import_neutral @ ( s_file_name, @ s_group_name, @ la_entity_toggle_flags, @ ia_minimum_id, @ ia_maximum_id, @ ia_offset ) dump i_return_value #---------------------------------------------------------------------

neutral_export2
# # # # # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function neutral_export2() This session file will open a existing database ’plate.db’ and will export it to Neutral format database by name plate_neutral.out.1. Before running this session file run plate.ses to create plate.db

Patran,

This file can be run by starting a session of and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function neutral_export2() has the following arguments: neutral_export2 ( file_name, title, entity_toggle_flags, all_groups, number_of_groups, group_entity_ids )

Main Index

Chapter 2: Basic Functions 11
File Menu

#--------------------------------------------------------------------# Variable Declarations STRING s_file_name[32] STRING s_title[64] LOGICAL la_entity_toggle_flags(35) LOGICAL l_all_groups INTEGER i_number_of_groups INTEGER ia_group_entity_ids(4) INTEGER i_return_value #--------------------------------------------------------------------# Open the database "plate.db" uil_file_open.go("plate.db") #--------------------------------------------------------------------# Exporting following entity types to the file ’plate_neutral.out.1’ # Entity types - Nodes, Elements, Material, Element Properties la_entity_toggle_flags(1) = TRUE la_entity_toggle_flags(2) = TRUE la_entity_toggle_flags(3) = TRUE la_entity_toggle_flags(4) = TRUE s_file_name = "plate_neutral.out" s_title = "File created by exporting Patran database" l_all_groups = FALSE i_number_of_groups = 1 ia_group_entity_ids = [1, 0, 0, 0] # i_return_value = @ neutral_export2 @ ( s_file_name, @ s_title, @ la_entity_toggle_flags, @ l_all_groups, @ i_number_of_groups, @ ia_group_entity_ids ) dump i_return_value #---------------------------------------------------------------------

p3_express_import

()

# # Purpose : This file provides an example of a call to the # function p3_express_import() # # This session file will open a new database by # name ’new.db’ and import a ’Express Neutral’ # model named ’sgm_cv_block-hole.exp’. # # This file can be run by starting a session of Patran, and running this session file # # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function p3_express_import() # has the following arguments: # # p3_express_import # ( option_file, # file_name, # geometry_tracking, # reset_tolerance, # tolerance_prompt, # return_entity_count, # entities ) # #--------------------------------------------------------------------# Variable Declarations

Main Index

12 PCL Reference Manual Examples
File Menu

STRING s_option_file[32] STRING s_file_name[32] LOGICAL l_geometry_tracking LOGICAL l_reset_tolerance LOGICAL l_tolerance_prompt LOGICAL l_return_entity_count INTEGER iaa_entities(64,2) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Calling function to import model ’sgm_cv_block-hole.exp’.A log file # by name ’ComputerVision_Geometry.log.01’ will be written. Also form # will appear indicating the change in tolerance. s_file_name = "sgm_cv_block-hole.exp" l_geometry_tracking = TRUE l_reset_tolerance = TRUE l_tolerance_prompt = TRUE l_return_entity_count = TRUE # i_return_value = @ p3_express_import @ ( s_option_file, @ s_file_name, @ l_geometry_tracking, @ l_reset_tolerance, @ l_tolerance_prompt, @ l_return_entity_count, @ iaa_entities ) dump i_return_value dump iaa_entities #--------------------------------------------------------------------# Exiting the import operation without deleting the express file. i_return_value = @ p3_express_import_exit( TRUE, FALSE ) dump i_return_value #---------------------------------------------------------------------

p3_express_import_preview
# # # # # # # # # # # # # # # # # # # # # # Purpose :

()
This file provides an example of a call to the function p3_express_import_preview() This session file will open a new database by name ’new.db’ and find summary information of a ’Express Neutral’ model named ’sgm_cv_block-hole.exp’.

Patran,

This file can be run by starting a session of and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function p3_express_import_preview() has the following arguments: p3_express_import_preview ( option_file, file_name, tolerance_check, return_entity_count,

Main Index

Chapter 2: Basic Functions 13
File Menu

# entities, # cad_attributes, # cad_tolerance, # shortest_curve_length ) # #--------------------------------------------------------------------# Variable Declarations STRING s_option_file[32] STRING s_file_name[32] LOGICAL l_tolerance_check LOGICAL l_return_entity_count INTEGER iaa_entities(64,2) STRING sa_cad_attributes[2](256) REAL r_cad_tolerance REAL r_shortest_curve_length INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Calling function to get the geometry information of the model # ’sgm_cv_block-hole.exp’ and calculate the tolerance also. s_file_name = "sgm_cv_block-hole.exp" l_tolerance_check = TRUE l_return_entity_count = TRUE # i_return_value = @ p3_express_import_preview @ ( s_option_file, @ s_file_name, @ l_tolerance_check, @ l_return_entity_count, @ iaa_entities, @ sa_cad_attributes, @ r_cad_tolerance, @ r_shortest_curve_length ) dump i_return_value dump iaa_entities, sa_cad_attributes, r_cad_tolerance dump r_shortest_curve_length #--------------------------------------------------------------------# Exiting the import operation without deleting the express file. i_return_value = @ p3_express_import_exit( TRUE, FALSE ) dump i_return_value #---------------------------------------------------------------------

p3_express_import_exit
# # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function p3_express_import_exit() This session file will open a new database by name ’new.db’ and import a ’Express Neutral’ model named ’sgm_cv_block-hole.exp’. And exits the import operation without deleting the express file.

Patran,

This file can be run by starting a session of and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function p3_express_import_exit()

Main Index

14 PCL Reference Manual Examples
File Menu

# has the following arguments: # # p3_express_import_exit # ( delete_option_file, # delete_express_file ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_delete_option_file LOGICAL l_delete_express_file INTEGER i_return_value STRING s_option_file[32] STRING s_file_name[32] LOGICAL l_geometry_tracking LOGICAL l_reset_tolerance LOGICAL l_tolerance_prompt LOGICAL l_return_entity_count INTEGER iaa_entities(64,2) #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Calling function to import model ’sgm_cv_block-hole.exp’.A log file # by name ’ComputerVision_Geometry.log.01’ will be written. Also form # will appear indicating the change in tolerance. s_file_name = "sgm_cv_block-hole.exp" l_geometry_tracking = TRUE l_reset_tolerance = TRUE l_tolerance_prompt = TRUE l_return_entity_count = TRUE # i_return_value = @ p3_express_import @ ( s_option_file, @ s_file_name, @ l_geometry_tracking, @ l_reset_tolerance, @ l_tolerance_prompt, @ l_return_entity_count, @ iaa_entities ) dump i_return_value dump iaa_entities #--------------------------------------------------------------------# Exiting the import operation without deleting the files. l_delete_option_file = FALSE l_delete_express_file = FALSE # i_return_value = @ p3_express_import_exit @ ( l_delete_option_file, @ l_delete_express_file ) dump i_return_value #---------------------------------------------------------------------

p3_express_options_file
# # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function p3_express_options_file() This session file will write an options file named ’exampla.exp’ for express model named ’sgm_cv_block-hole.exp’. Then will open a new database by name ’new.db’ and import the same ’Express Neutral’ model.

Main Index

Chapter 2: Basic Functions 15
File Menu

# # This file can be run by starting a session of Patran, and running this session file # # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function p3_express_options_file() # has the following arguments: # # p3_express_options_file # ( option_file, # versioning, # file_format, # action, # source, # transform_exists, # transformation, # number_of_groups, # group_names, # group_entities, # group_layers, # group_colors, # all_entities, # entities, # all_layers, # layers, # all_colors, # colors, # trimmed_curve_type, # trimmed_surface_type, # solid_representation ) # #--------------------------------------------------------------------# Variable Declarations STRING s_option_file[16] LOGICAL l_versioning INTEGER i_file_format INTEGER i_action INTEGER i_source LOGICAL l_transform_exists REAL ra_transformation(12) INTEGER i_number_of_groups STRING sa_group_names[16](3) INTEGER iaa_group_entities(3,3) INTEGER iaa_group_layers(3,1) INTEGER iaa_group_colors(3,1) LOGICAL l_all_entities INTEGER ia_entities(64) LOGICAL l_all_layers INTEGER ia_layers(256) LOGICAL l_all_colors INTEGER ia_colors(10) INTEGER i_trimmed_curve_type INTEGER i_trimmed_surface_type INTEGER i_solid_representation INTEGER i_return_value STRING s_file_name[32] LOGICAL l_geometry_tracking LOGICAL l_reset_tolerance LOGICAL l_tolerance_prompt LOGICAL l_return_entity_count INTEGER iaa_entities(64,2) #--------------------------------------------------------------------# Calling function to write options file by name ’example.exp’. The # file will be written in ascii without the transformation matrix. s_option_file = "example.exp" i_file_format = 1 i_action = 1

Main Index

16 PCL Reference Manual Examples
File Menu

# Making the source of the geometry entities as PDA ENGINEERING. i_source = 52054 # Three groups will be created while importing. And entities will be # separated in these groups. i_number_of_groups =3 sa_group_names(1) = "curve" sa_group_names(2) = "surface" sa_group_names(3) = "solid" iaa_group_entities = [[1 102 0][1 1002 0][1 2002 0]] # All layers and colors will be read in for each group. iaa_group_layers = [[-1][-1][-1]] iaa_group_colors = [[0][0][0]] l_all_entities = TRUE l_all_layers = TRUE l_all_colors = TRUE # Only preference for trimmed surface will be # set to ’only general trimmed surface’ i_trimmed_curve_type = 3 i_trimmed_surface_type = 2 i_solid_representation = 3 # i_return_value = p3_express_options_file ( s_option_file, l_versioning, i_file_format, i_action, i_source, l_transform_exists, ra_transformation, i_number_of_groups, sa_group_names, iaa_group_entities, iaa_group_layers, iaa_group_colors, l_all_entities, ia_entities, l_all_layers, ia_layers, l_all_colors, ia_colors, i_trimmed_curve_type, i_trimmed_surface_type, i_solid_representation ) dump i_return_value

@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Calling function to import model ’sgm_cv_block-hole.exp’. Using the # options file created. A log file by name # ’ComputerVision_Geometry.log.01’ will be written. Also form will # appear indicating the change in tolerance. s_file_name = "sgm_cv_block-hole.exp" l_geometry_tracking = TRUE l_reset_tolerance = TRUE l_tolerance_prompt = TRUE l_return_entity_count = TRUE # i_return_value = @ p3_express_import @ ( s_option_file, @ s_file_name, @

Main Index

Chapter 2: Basic Functions 17
File Menu

l_geometry_tracking, @ l_reset_tolerance, @ l_tolerance_prompt, @ l_return_entity_count, @ iaa_entities ) $? NOFORALL 1000034 dump i_return_value dump iaa_entities #--------------------------------------------------------------------# Exiting the import operation without deleting the files. i_return_value = @ p3_express_import_exit( FALSE, FALSE ) dump i_return_value #---------------------------------------------------------------------

ps_get_body_string_attribute

()

FUNCTION attribute_import_body( output_name ) STRING output_name[] INTEGER i, status, nc, nsrf, nsol, entity_id(1), min_label, label STRING attr_name[VIRTUAL], psidentifier[256] INTEGER endLabel, startLabel, fid psidentifier = "SDL/TYSA_NAME" utl_process_spawn( "rm -f " // output_name, TRUE ) status = fio_openw( output_name, fid ) status = db_count_solid( nsol ) status = db_get_min_solid_label( min_label ) status = db_get_max_solid_label( endLabel ) label = min_label startLabel = label fio_writec( fio_writec( fio_writec( fio_writec( fid, fid, fid, fid, "minimum solid label = %d \n", startLabel ) "maximum solid label = %d \n\n", endLabel ) "Identifier: %s\n",psidentifier ) "Function: ps_get_body_string_attribute\n\n" )

IF( label > 0 ) THEN fio_writec( fid, "Number of solids = %d\n",nsol) FOR (i = startLabel TO endLabel) status = db_get_solid_id( label, entity_id(1) ) status = ps_get_body_string_attribute( entity_id(1), 4,psidentifier, 0, attr_name ) fio_writec( fid, "status from ps_get_body_string_attribute = %d \n", status ) IF( status == 0 ) THEN fio_writec( fid, "solid %d : Body Attribute name = %s\n",entity_id(1), attr_name ) END IF fio_writec( fid, label += 1 END FOR END IF "\n" )

status = db_count_surface( nsrf ) status = db_get_min_surface_label( min_label ) status = db_get_max_surface_label( endLabel ) label = min_label startLabel = label

Main Index

18 PCL Reference Manual Examples
File Menu

fio_writec( fid, "minimum surface label = %d \n", startLabel ) fio_writec( fid, "maximum surface label = %d \n", endLabel ) IF( label > 0 ) THEN fio_writec( fid, "Number of surfaces = %d\n",nsrf) FOR (i = startLabel TO endLabel) status = db_get_surface_id( label, entity_id(1) ) status = ps_get_body_string_attribute( entity_id(1), 3, psidentifier, 0, attr_name ) fio_writec( fid, "status from ps_get_body_string_attribute = %d \n", status ) IF( status == 0 ) THEN fio_writec( fid, "surface %d : Body Attribute name = %s\n",entity_id(1), attr_name ) END IF fio_writec( fid, label += 1 END FOR END IF "\n" )

status = db_count_curve( nc ) status = db_get_min_curve_label( min_label ) status = db_get_max_curve_label( endLabel ) label = min_label startLabel = label fio_writec( fid, "minimum curve label = %d \n", startLabel ) fio_writec( fid, "maximum curve label = %d \n", endLabel ) IF( label > 0 ) THEN fio_writec( fid, "Number of curves = %d\n",nc) FOR (i = startLabel TO endLabel) status = db_get_curve_id( label, entity_id(1) ) status = ps_get_body_string_attribute( entity_id(1), 2, psidentifier, 0, attr_name ) fio_writec( fid, "status from ps_get_body_string_attribute = %d\n", status ) IF( status == 0 ) THEN fio_writec( fid, "curve %d : Body Attribute name = %s\n", entity_id(1), attr_name ) END IF fio_writec( fid, label += 1 END FOR END IF fio_close( fid ) END FUNCTION "\n" )

ps_get_string_attribute

()

FUNCTION attribute_import_topology( output_name ) STRING output_name[] INTEGER i, status, nc, nsrf, nsol, entity_id(1), min_label, label STRING attr_name[VIRTUAL], psidentifier[256] INTEGER endLabel, startLabel, fid psidentifier = "SDL/TYSA_NAME" utl_process_spawn( "rm -f " // output_name, TRUE )

Main Index

Chapter 2: Basic Functions 19
File Menu

status = fio_openw( output_name, fid ) status = db_count_solid( nsol ) status = db_get_min_solid_label( min_label ) status = db_get_max_solid_label( endLabel ) label = min_label startLabel = label fio_writec( fio_writec( fio_writec( fio_writec( fid, fid, fid, fid, "minimum solid label = %d \n", startLabel ) "maximum solid label = %d \n\n", endLabel ) "Identifier: %s\n",psidentifier ) "Function: ps_get_string_attribute\n\n" )

IF( label > 0 ) THEN fio_writec( fid, "Number of solids = %d\n",nsol) FOR (i = startLabel TO endLabel) status = db_get_solid_id( label, entity_id(1) ) status = ps_get_string_attribute( entity_id(1), 4,psidentifier, 0, attr_name ) fio_writec( fid, "status from ps_get_string_attribute = %d \n", status ) IF( status == 0 ) THEN fio_writec( fid, "solid %d : Attribute name = %s\n",entity_id(1), attr_name ) END IF fio_writec( fid, label += 1 END FOR END IF "\n" )

status = db_count_surface( nsrf ) status = db_get_min_surface_label( min_label ) status = db_get_max_surface_label( endLabel ) label = min_label startLabel = label fio_writec( fid, "minimum surface label = %d \n", startLabel ) fio_writec( fid, "maximum surface label = %d \n", endLabel ) IF( label > 0 ) THEN fio_writec( fid, "Number of surfaces = %d\n",nsrf) FOR (i = startLabel TO endLabel) status = db_get_surface_id( label, entity_id(1) ) status = ps_get_string_attribute( entity_id(1), 3, psidentifier, 0, attr_name ) fio_writec( fid, "status from ps_get_string_attribute = %d \n", status ) IF( status == 0 ) THEN fio_writec( fid, "surface %d : Attribute name = %s\n",entity_id(1), attr_name ) END IF fio_writec( fid, label += 1 END FOR END IF "\n" )

status = db_count_curve( nc ) status = db_get_min_curve_label( min_label ) status = db_get_max_curve_label( endLabel ) label = min_label startLabel = label fio_writec( fid, "minimum curve label = %d \n", startLabel ) fio_writec( fid, "maximum curve label = %d \n", endLabel ) IF( label > 0 ) THEN

Main Index

20 PCL Reference Manual Examples
File Menu

fio_writec( fid, "Number of curves = %d\n",nc) FOR (i = startLabel TO endLabel) status = db_get_curve_id( label, entity_id(1) ) status = ps_get_string_attribute( entity_id(1), 2, psidentifier, 0, attr_name ) fio_writec( fid, "status from ps_get_string_attribute = %d\n", status ) IF( status == 0 ) THEN fio_writec( fid, "curve %d : Attribute name = %s\n", entity_id(1), attr_name ) END IF fio_writec( fid, label += 1 END FOR END IF fio_close( fid ) END FUNCTION "\n" )

Example 2:
FUNCTION publication_import( output_name ) $ This function searches for CAD tags from CATIA and creates a matched array of labels: p3 <-> CATIA STRINGoutput_name[] STRINGp3_labels[32](VIRTUAL), CATIA_labels[512](VIRTUAL) INTEGER num_publications = 0 INTEGER i, status, nc, nsrf, nsol, entity_id(1) INTEGER min_labelS, min_labelF, min_labelC, label INTEGER endLabelS, endLabelF, endLabelC STRING attr_name[VIRTUAL], battr_name[VIRTUAL], psidentifier[256] INTEGER fid STRING face_name_prefix[32], face_name[32], edge_name_prefix[32], edge_name[32] INTEGER dummy(VIRTUAL), j, k, m INTEGER faces(VIRTUAL),nfaces INTEGER num_edges, number_loops, loop_ids(VIRTUAL), edge_orients(VIRTUAL), edge_ids(VIRTUAL) REAL time(10) INTEGER method, handle, attribute, internal_curve_id(1) INTEGER num_faces_found = 0, num_edges_found = 0 INTEGER found_faces(VIRTUAL), found_edges(VIRTUAL) LOGICAL face_found, edge_found time(1) = sys_cputime() psidentifier = "SDL/TYSA_NAME" utl_process_spawn( "rm -f " // output_name, TRUE ) status = fio_openw( output_name, fid ) status status status status status status status status status = = = = = = = = = db_count_solid( nsol ) db_get_min_solid_label( min_labelS ) db_get_max_solid_label( endLabelS ) db_count_surface( nsrf ) db_get_min_surface_label( min_labelF ) db_get_max_surface_label( endLabelF ) db_count_curve( nc ) db_get_min_curve_label( min_labelC ) db_get_max_curve_label( endLabelC )

$ Allocate space for array of face and edge ids to prevent duplication sys_allocate_array( found_faces, 1, nsrf ) sys_allocate_array( found_edges, 1, nc ) $ Allocate space for array of labels to return

Main Index

Chapter 2: Basic Functions 21
File Menu

sys_allocate_array( p3_labels, 1, nsol+nsrf+nc ) sys_allocate_array( CATIA_labels, 1, nsol+nsrf+nc ) fio_writec( fid, "Solids: Number=%d minimum=%d maximum=%d \n",nsol, min_labelS, endLabelS ) fio_writec( fid, "Surfaces: Number=%d minimum=%d maximum=%d \n",nsrf, min_labelF, endLabelF) fio_writec( fid, "Curves: Number=%d minimum=%d maximum=%d \n\n",nc, min_labelC, endLabelC ) fio_writec( fid, "Identifier: %s\n",psidentifier ) fio_writec( fid, "Function: ps_get_string_attribute\n\n" ) if(min_labelF==0) THEN min_labelF = 1 if(endLabelF==0) THEN endLabelF = nsrf if(min_labelC==0) THEN min_labelC = 1 if(endLabelC==0) THEN endLabelC = nc IF( nsol FOR (i = status = status = > 0 ) THEN min_labelS TO endLabelS) db_get_solid_id( i, entity_id(1) ) ps_get_string_attribute( entity_id(1), 4, psidentifier, 0, attr_name )

IF( status == 0 ) THEN status = db_get_solid_label( entity_id(1), label ) fio_writec( fid, "solid %d [Solid %d] : Attribute name = %s\n",label, entity_id(1), attr_name ) num_publications += 1 p3_labels(num_publications) = "Solid " // str_from_integer( label ) CATIA_labels(num_publications) = attr_name END IF $ do all faces on this solid: face_name_prefix = "Solid " // str_from_integer( i ) //"." sgm_db_get_num_faces_body( entity_id(1),nfaces,status) IF( status != 0) THEN msg_to_form( status, 4, appcode(status),1,1.,"") RETURN status END IF $ Allocate memory: status = sys_allocate_array( faces, 1, nfaces ) IF( status != 0) THEN msg_to_form( status, 4, appcode(status),1,1.,"") RETURN status END IF status = sys_allocate_array( dummy, 1, nfaces ) IF( status != 0) THEN msg_to_form( status, 4, appcode(status),1,1.,"") RETURN status END IF $ Get the list of faces referenced by the body sgm_db_get_gen_body_face_ids( entity_id(1), nfaces, faces, dummy, @ dummy, status ) IF( status != 0) THEN msg_to_form( status, 4, appcode(status),1,1.,"") RETURN status END IF FOR( j = 1 TO nfaces ) face_name = face_name_prefix // str_from_integer( j ) $fio_writec( fid, "Face name = %s Surface id = %d\n",face_name, faces(i) ) face_found = FALSE FOR( m = 1 TO num_faces_found ) IF(found_faces(m)==faces(j)) THEN face_found = TRUE END FOR IF(face_found!=TRUE) THEN status = ps_get_string_attribute( faces(j), 3, psidentifier, 0, attr_name ) IF( status == 0 ) THEN fio_writec( fid, "%s [Face %d] : Attribute name = %s\n", @

Main Index

22 PCL Reference Manual Examples
File Menu

face_name, faces(j), attr_name ) num_publications += 1 p3_labels(num_publications) = face_name CATIA_labels(num_publications) = attr_name num_faces_found += 1 found_faces(num_faces_found) = faces(j) END IF END IF status = sgm_db_get_num_edges_face( faces(j), num_edges ) IF( status != 0 ) THEN BREAK sgm_db_get_num_vertices_surface( faces(j), num_edges, status ) edge_name_prefix = face_name // "." $Allocate and initialize virtual strings sys_allocate_array( edge_ids, 1, num_edges ) sys_allocate_array( loop_ids, 1, num_edges ) sys_allocate_array( edge_orients, 1, num_edges ) status = sgm_db_get_gen_face_edge_ids ( faces(i), number_loops, num_edges, @ loop_ids, edge_ids, edge_orients ) FOR( k = 1 TO num_edges ) edge_name = edge_name_prefix // str_from_integer( k ) $method = LP_EVAL_FOR_ID = 4, LP_ATTRIBUTE_ID = 1 method = 4 ; attribute = 1 status = lp_eval( edge_name, method, handle ) IF(status==0) THEN status = lp_sublist_attribute_get_int( handle, attribute, internal_curve_id ) END IF lp_eval_cleanup(handle) edge_found = FALSE FOR( m = 1 TO num_edges_found ) IF(found_edges(m)==internal_curve_id(1)) THEN edge_found = TRUE END FOR IF(edge_found!=TRUE) THEN status = ps_get_string_attribute( internal_curve_id(1), 2, psidentifier, 0, attr_name ) IF( status == 0 ) THEN fio_writec( fid, "%s [Edge %d] : Attribute name = %s\n", @ edge_name, internal_curve_id(1), attr_name ) num_publications += 1 p3_labels(num_publications) = edge_name CATIA_labels(num_publications) = attr_name num_edges_found+= 1 found_edges(num_edges_found) = internal_curve_id(1) END IF END IF END FOR END FOR label += 1 END FOR END IF fio_writec( fid, "\n" ) battr_name = "" $ Get directly creates surfaces and curves IF( nsrf > 0 ) THEN FOR (i = min_labelF TO endLabelF) /*status = db_get_surface_id( label, entity_id(1) )*/ entity_id(1) = i face_found = FALSE FOR( m = 1 TO num_faces_found ) IF(found_faces(m)==entity_id(1)) THEN face_found = TRUE END FOR IF(face_found!=TRUE) THEN status = ps_get_string_attribute( entity_id(1), 3, psidentifier, 0, attr_name )

Main Index

Chapter 2: Basic Functions 23
File Menu

IF( status == 0 ) THEN status = db_get_surface_label( entity_id(1), label ) $ a label of -1 means it is not an actual surface IF(label!=-1) THEN fio_writec( fid, "Surface %d [Face %d] : Attribute name = %s\n",@ label, entity_id(1), attr_name ) num_publications += 1 p3_labels(num_publications) = "Surface " // str_from_integer( label ) CATIA_labels(num_publications) = attr_name num_faces_found += 1 found_faces(num_faces_found) = entity_id(1) END IF END IF END IF label += 1 END FOR END IF fio_writec( fid, "\n" ) battr_name = "" IF( nc > 0 ) THEN FOR (i = 1 TO endLabelC) entity_id(1) = i edge_found = FALSE FOR( m = 1 TO num_edges_found ) IF(found_edges(m)==entity_id(1)) THEN edge_found = TRUE END FOR IF(edge_found!=TRUE) THEN status = ps_get_string_attribute( entity_id(1), 2, psidentifier, 0, attr_name ) IF( status == 0 ) THEN status = db_get_curve_label( entity_id(1), label ) $ a label of -1 means it is not an actual curve IF(label!=-1) THEN fio_writec( fid, "Curve %d [Edge %d] : Attribute name = %s\n", @ label, entity_id(1), attr_name ) num_publications += 1 p3_labels(num_publications) = "Curve " // str_from_integer( label ) CATIA_labels(num_publications) = attr_name num_edges_found += 1 found_edges(num_edges_found) = entity_id(1) END IF END IF END IF label += 1 END FOR END IF fio_writec( fid, "\n" ) time(2) = sys_cputime() fio_writec( fid, "Total computation time = %f seconds\n", time(2)-time(1) ) fio_close( fid ) IF( num_publications > 0 ) THEN sys_reallocate_array( p3_labels, 1, num_publications ) sys_reallocate_array( CATIA_labels, 1, num_publications ) END IF dump p3_labels, CATIA_labels RETURN num_publications END FUNCTION

select_focus.exit
# #

()

Purpose

:

This file provides an example of a call to the

Main Index

24 PCL Reference Manual Examples
File Menu

# function select_focus.exit() # # This session file will open a new database by # name ’new.db’. A curve and a surface will be # drawn so that the curve is overlapping with one # edge from the surface. # After this the session file will be paused and # the user will have to try to delete the curve # by screen picking. Which will make the # ’Selection’ window appear on the screen. The # session file will be resumed after that. In # effect this function will be executed and the # selection window will disappear. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function select_focus.exit() has no arguments. # #--------------------------------------------------------------------# Variable Declarations INTEGER i_return_value STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] STRING sv_asm_create_line_xyz_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a curve. i_return_value = @ asm_const_line_xyz( "1", "<1 0 0>", "[0 0 0]", "Coord 0", @ sv_asm_create_line_xyz_crtd_ids ) dump i_return_value # Drawing a surface so that an edge of the surface will overlap with # the curve. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", @ sv_asm_create_patch_xy_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. # User should open the ’Geometry’ form and try to ’Delete’ the curve # by clicking on the screen. While trying this the ’Object’ should be # ’Any’. After the selection window appears on the screen the # ’Resume’ button should be pressed. sf_pause() #--------------------------------------------------------------------# Calling function to remove the selection window. # select_focus.exit() sys_free_string(sv_asm_create_patch_xy_crtd_ids) sys_free_string(sv_asm_create_line_xyz_crtd_ids) #---------------------------------------------------------------------e

sgm_cad_access_v1
# # # # #

()

Purpose

:

This file provides an example of a call to the function sgm_cad_access_v1() This session file will open a new database by

Main Index

Chapter 2: Basic Functions 25
File Menu

# name ’new.db’. UG file named ’asm002.prt’ is # imported with all its entities in default_group # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_cad_access_v1() # has the following arguments: # # sgm_cad_access_v1 # ( file_name, # file_name_length, # group_name, # group_name_length, # entity_toggle_values, # simply_trimmed, # access_as_solids, # enable_tol_prompt, # color_toggle_values, # all_layers, # active_layer, # layer_numbers, # mod_type, # number_of_groups, # group_entity_ids, # group_entity_values, # group_color_values, # active_layer_values, # layer_pointers, # group_layers, # I_N_UG_LAYERS, # ug_count, # patran_count ) # #--------------------------------------------------------------------# Variable Declarations STRING s_file_name[32] INTEGER i_file_name_length STRING s_group_name[80] INTEGER i_group_name_length LOGICAL la_entity_toggle_values(35) LOGICAL l_simply_trimmed LOGICAL l_access_as_solids LOGICAL l_enable_tol_prompt LOGICAL la_color_toggle_values(14) LOGICAL l_all_layers LOGICAL l_active_layer INTEGER ia_layer_numbers(256) STRING s_mod_type[6] INTEGER i_number_of_groups INTEGER ia_group_entity_ids(1) LOGICAL laa_group_entity_values(1,20) LOGICAL laa_group_color_values(1,14) LOGICAL la_active_layer_values(256) INTEGER ia_layer_pointers(1) INTEGER ia_group_layers(512) integer i_n_ug_layers INTEGER iaa_ug_count(256,37) INTEGER ia_patran_count(4) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Calling function to import all entities from UG model ’asm002.prt’.

Main Index

26 PCL Reference Manual Examples
File Menu

# Tolerance prompt will be displayed on the screen. s_file_name = "asm002.prt" i_file_name_length =10 s_group_name = "default_group" i_group_name_length = 13 l_simply_trimmed = true l_enable_tol_prompt = true l_all_layers = true s_mod_type ="ug" i_number_of_groups =1 ia_group_entity_ids =[1] ia_layer_pointers = [1] ia_group_layers(1) = 1 la_entity_toggle_values=[true true true true true true true true true@ true true true true true true true true true true false false @ false false false false false false false false false false false @ false false false] laa_group_entity_values=[true true true true true true true true true@ true true true true true true true true true true false] # i_return_value = @ sgm_cad_access_v1 @ ( s_file_name, @ i_file_name_length, @ s_group_name, @ i_group_name_length, @ la_entity_toggle_values, @ l_simply_trimmed, @ l_access_as_solids, @ l_enable_tol_prompt, @ la_color_toggle_values, @ l_all_layers, @ l_active_layer, @ ia_layer_numbers, @ s_mod_type, @ i_number_of_groups, @ ia_group_entity_ids, @ laa_group_entity_values, @ laa_group_color_values, @ la_active_layer_values, @ ia_layer_pointers, @ ia_group_layers, @ i_n_ug_layers, @ iaa_ug_count, @ ia_patran_count ) dump i_return_value dump ia_patran_count,i_n_ug_layers #---------------------------------------------------------------------

sgm_catia_access
# # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function sgm_catia_access() This session file will open a new database by name ’new.db’. A Catia model named ’catia_cam.cat’ will be imported in the default group with all entities. Model will be made visible on the screen. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

Main Index

Chapter 2: Basic Functions 27
File Menu

# The function sgm_catia_access() # has the following arguments: # # sgm_catia_access # ( file_name, # group_name, # group_name_length, # entity_toggle_values, # simply_trimmed, # color_toggle_values, # all_layers, # active_layer, # layer_numbers, # mod_type, # number_of_groups, # group_entity_ids, # group_entity_values, # group_color_values, # active_layer_values, # layer_pointers, # group_layers, # interactive_flag, # user_control_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_file_name[32] STRING s_group_name[32] INTEGER i_group_name_length LOGICAL la_entity_toggle_values(35) LOGICAL l_simply_trimmed LOGICAL la_color_toggle_values(14) LOGICAL l_all_layers LOGICAL l_active_layer INTEGER ia_layer_numbers(256) STRING s_mod_type[6] INTEGER i_number_of_groups = 1 INTEGER ia_group_entity_ids(2) LOGICAL laa_group_entity_values(2,20) LOGICAL laa_group_color_values(2,14) LOGICAL la_active_layer_values(256) INTEGER ia_layer_pointers(2) INTEGER ia_group_layers(8) INTEGER i_interactive_flag INTEGER ia_user_control_flag(2) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Importing all entities of file named "catia_cam.cat". s_file_name = "catia_cam.cat" s_group_name = "default_group" i_group_name_length = 13 l_all_layers = TRUE s_mod_type = "catia" ia_group_entity_ids = [1,0] la_entity_toggle_values = [TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @ TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE] # i_return_value = @ sgm_catia_access @ ( s_file_name, @ s_group_name, @ i_group_name_length, @

Main Index

28 PCL Reference Manual Examples
File Menu

la_entity_toggle_values, l_simply_trimmed, la_color_toggle_values, l_all_layers, l_active_layer, ia_layer_numbers, s_mod_type, i_number_of_groups, ia_group_entity_ids, laa_group_entity_values, laa_group_color_values, la_active_layer_values, ia_layer_pointers, ia_group_layers, i_interactive_flag, ia_user_control_flag ) dump i_return_value

@ @ @ @ @ @ @ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Model is made visible in the viewport. i_return_value = ga_view_corners_set([125.,-60.,0],[150.,-20.,0],1) dump i_return_value #---------------------------------------------------------------------

sgm_catia_access_v1

()

# # Purpose : This file provides an example of a call to the # function sgm_catia_access_v1() # # This session file will open a new database by # name ’new.db’. A Catia model named # ’catia_cam.cat’ will be imported in the default # group with all entities. Model will be made # visible on the screen. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_catia_access_v1() # has the following arguments: # # sgm_catia_access_v1 # ( file_name, # group_name, # group_name_length, # entity_toggle_values, # simply_trimmed, # enable_tol_prompt, # color_toggle_values, # all_layers, # active_layer, # layer_numbers, # mod_type, # number_of_groups, # group_entity_ids, # group_entity_values, # group_color_values, # active_layer_values, # layer_pointers, # group_layers, # interactive_flag, # user_control_flag ) # #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 29
File Menu

# Variable Declarations STRING s_file_name[32] STRING s_group_name[32] INTEGER i_group_name_length LOGICAL la_entity_toggle_values(35) LOGICAL l_simply_trimmed LOGICAL l_enable_tol_prompt LOGICAL la_color_toggle_values(14) LOGICAL l_all_layers LOGICAL l_active_layer INTEGER ia_layer_numbers(256) STRING s_mod_type[6] INTEGER i_number_of_groups = 1 INTEGER ia_group_entity_ids(2) LOGICAL laa_group_entity_values(2,20) LOGICAL laa_group_color_values(2,14) LOGICAL la_active_layer_values(256) INTEGER ia_layer_pointers(2) INTEGER ia_group_layers(8) INTEGER i_interactive_flag INTEGER ia_user_control_flag(2) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Importing all entities of file named "catia_cam.cat". Form # indicating proposed change in tolerance will appear on the screen. s_file_name = "catia_cam.cat" s_group_name = "default_group" i_group_name_length = 13 l_enable_tol_prompt = TRUE l_all_layers = TRUE s_mod_type = "catia" ia_group_entity_ids = [1,0] la_entity_toggle_values = [TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @ TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE] # i_return_value = @ sgm_catia_access_v1 @ ( s_file_name, @ s_group_name, @ i_group_name_length, @ la_entity_toggle_values, @ l_simply_trimmed, @ l_enable_tol_prompt, @ la_color_toggle_values, @ l_all_layers, @ l_active_layer, @ ia_layer_numbers, @ s_mod_type, @ i_number_of_groups, @ ia_group_entity_ids, @ laa_group_entity_values, @ laa_group_color_values, @ la_active_layer_values, @ ia_layer_pointers, @ ia_group_layers, @ i_interactive_flag, @ ia_user_control_flag ) dump i_return_value #--------------------------------------------------------------------# Model is made visible in the viewport. i_return_value =ga_view_corners_set([125.,-60.,0],[150.,-20.,0],1)

Main Index

30 PCL Reference Manual Examples
File Menu

dump i_return_value #---------------------------------------------------------------------

sgm_euclid_access

()

# # Purpose : This file provides an example of a call to the # function sgm_euclid_access() # # This session file will open a new database by # name ’new.db’. A Euclid model named # ’euclid_exo_2.pat’ will be imported in the # default group with all entities. Model will be # made visible on the screen. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_euclid_access() # has the following arguments: # # sgm_euclid_access # ( file_name, # group_name, # group_name_length, # entity_toggle_values, # simply_trimmed, # color_toggle_values, # all_layers, # active_layer, # layer_numbers, # mod_type, # number_of_groups, # group_entity_ids, # group_entity_values, # group_color_values, # active_layer_values, # layer_pointers, # group_layers, # interactive_flag, # user_control_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_file_name[32] STRING s_group_name[32] INTEGER i_group_name_length LOGICAL la_entity_toggle_values(35) LOGICAL l_simply_trimmed LOGICAL la_color_toggle_values(14) LOGICAL l_all_layers LOGICAL l_active_layer INTEGER ia_layer_numbers(256) STRING s_mod_type[6] INTEGER i_number_of_groups = 1 INTEGER ia_group_entity_ids(2) LOGICAL laa_group_entity_values(2,20) LOGICAL laa_group_color_values(2,14) LOGICAL la_active_layer_values(256) INTEGER ia_layer_pointers(2) INTEGER ia_group_layers(8) INTEGER i_interactive_flag INTEGER ia_user_control_flag(2) INTEGER i_return_value

Main Index

Chapter 2: Basic Functions 31
File Menu

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Importing all entities of file named "euclid_exo_2.pat". s_file_name = "euclid_exo_2.pat" s_group_name = "default_group" i_group_name_length = 13 l_all_layers = TRUE s_mod_type = "euclid" ia_group_entity_ids = [1,0] la_entity_toggle_values = [TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @ TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE] # i_return_value = @ sgm_euclid_access @ ( s_file_name, @ s_group_name, @ i_group_name_length, @ la_entity_toggle_values, @ l_simply_trimmed, @ la_color_toggle_values, @ l_all_layers, @ l_active_layer, @ ia_layer_numbers, @ s_mod_type, @ i_number_of_groups, @ ia_group_entity_ids, @ laa_group_entity_values, @ laa_group_color_values, @ la_active_layer_values, @ ia_layer_pointers, @ ia_group_layers, @ i_interactive_flag, @ ia_user_control_flag ) dump i_return_value #--------------------------------------------------------------------# Model is made visible in the viewport. i_return_value =ga_view_corners_set([-70.,-70.,0],[70.,70.,0],1) dump i_return_value #---------------------------------------------------------------------

sgm_euclid_access_v1
# # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function sgm_euclid_access_v1() This session file will open a new database by name ’new.db’. A Euclid model named ’euclid_exo_2.pat’ will be imported in the default group with all entities. Model will be made visible on the screen. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function sgm_euclid_access_v1() has the following arguments: sgm_euclid_access_v1

Main Index

32 PCL Reference Manual Examples
File Menu

# ( file_name, # group_name, # group_name_length, # entity_toggle_values, # simply_trimmed, # enable_tol_prompt, # color_toggle_values, # all_layers, # active_layer, # layer_numbers, # mod_type, # number_of_groups, # group_entity_ids, # group_entity_values, # group_color_values, # active_layer_values, # layer_pointers, # group_layers, # interactive_flag, # user_control_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_file_name[32] STRING s_group_name[32] INTEGER i_group_name_length LOGICAL la_entity_toggle_values(35) LOGICAL l_simply_trimmed LOGICAL l_enable_tol_prompt LOGICAL la_color_toggle_values(14) LOGICAL l_all_layers LOGICAL l_active_layer INTEGER ia_layer_numbers(256) STRING s_mod_type[6] INTEGER i_number_of_groups = 1 INTEGER ia_group_entity_ids(2) LOGICAL laa_group_entity_values(2,20) LOGICAL laa_group_color_values(2,14) LOGICAL la_active_layer_values(256) INTEGER ia_layer_pointers(2) INTEGER ia_group_layers(8) INTEGER i_interactive_flag INTEGER ia_user_control_flag(2) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Importing all entities of file named "euclid_exo_2.pat". Form # indicating proposed change in tolerance will appear on the screen. s_file_name = "euclid_exo_2.pat" s_group_name = "default_group" i_group_name_length = 13 l_enable_tol_prompt = TRUE l_all_layers = TRUE s_mod_type = "euclid" ia_group_entity_ids = [1,0] la_entity_toggle_values = [TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @ TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, @ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE] # i_return_value = @ sgm_euclid_access_v1 @ ( s_file_name, @ s_group_name, @ i_group_name_length, @

Main Index

Chapter 2: Basic Functions 33
File Menu

la_entity_toggle_values, l_simply_trimmed, l_enable_tol_prompt, la_color_toggle_values, l_all_layers, l_active_layer, ia_layer_numbers, s_mod_type, i_number_of_groups, ia_group_entity_ids, laa_group_entity_values, laa_group_color_values, la_active_layer_values, ia_layer_pointers, ia_group_layers, i_interactive_flag, ia_user_control_flag ) dump i_return_value

@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Model is made visible in the viewport. i_return_value =ga_view_corners_set([-70.,-70.,0],[70.,70.,0],1) dump i_return_value #---------------------------------------------------------------------

sgm_intersect_curves

()

# # Purpose : This file provides an example of a call to the # function sgm_intersect_curves() # # This session file will create a new database by # name new.db and will draw two curves. These # curves will be used for finding out minimum # distance between the two. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_intersect_curves() # has the following arguments: # # sgm_intersect_curves # ( curve1, # curve2, # distance, # u1, # u2, # xyz1, # xyz2 ) # #--------------------------------------------------------------------# Variable Declarations REAL rv_curve1(VIRTUAL) REAL rv_curve2(VIRTUAL) REAL r_distance REAL r_u1 REAL r_u2 REAL ra_xyz1(3) REAL ra_xyz2(3) INTEGER i_return_value INTEGER i_blob_size STRING sv_asm_create_line_xyz_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db"

Main Index

34 PCL Reference Manual Examples
File Menu

uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating two parallel lines. i_return_value = @ asm_const_line_xyz( "1", "<1 0 0>", "[0 0 0]","Coord 0",@ sv_asm_create_line_xyz_crtd_ids ) dump i_return_value i_return_value = @ asm_const_line_xyz( "2", "<1 0 0>", "[0 1 1]","Coord 0",@ sv_asm_create_line_xyz_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Getting the blob size for curves(entity type = 2) and allocating # the memory for getting the information for curves. # For curve ID. 1 sgm_db_get_blob_size(2,1,i_blob_size,i_return_value) dump i_return_value sys_allocate_array(rv_curve1,1,i_blob_size) sgm_db_get_curve(1,i_blob_size,rv_curve1,i_return_value) dump i_return_value # For curve ID. 2 sgm_db_get_blob_size(2,2,i_blob_size,i_return_value) dump i_return_value sys_allocate_array(rv_curve2,1,i_blob_size) sgm_db_get_curve(2,i_blob_size,rv_curve2,i_return_value) dump i_return_value #--------------------------------------------------------------------# Calling the function two get the minimum distance. # i_return_value = @ sgm_intersect_curves @ ( rv_curve1, @ rv_curve2, @ r_distance, @ r_u1, @ r_u2, @ ra_xyz1, @ ra_xyz2 ) dump i_return_value dump r_distance,r_u1,r_u2,ra_xyz1,ra_xyz2 sys_free_array(rv_curve1) sys_free_array(rv_curve2) sys_free_string(sv_asm_create_line_xyz_crtd_ids) #---------------------------------------------------------------------

sgm_nearest_point_on_surface
# # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function sgm_nearest_point_on_surface() This session file will create a new database by name new.db and will draw a X-Y surface. This surface will be used for finding out minimum distance of a point(1,1,1) from the surface. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function sgm_nearest_point_on_surface()

Main Index

Chapter 2: Basic Functions 35
File Menu

# has the following arguments: # # sgm_nearest_point_on_surface # ( point, # surface, # u, # v, # xyz ) # #--------------------------------------------------------------------# Variable Declarations REAL ra_point(3) REAL rv_surface(VIRTUAL) REAL r_u REAL r_v REAL raa_xyz(3,4) INTEGER i_return_value INTEGER i_blob_size STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a patch. i_return_value = @ asm_const_patch_xyz( "1","<1 1 0>","[0 0 0]","Coord 0", @ sv_asm_create_patch_xy_crtd_ids ) dump i_return_value # Getting the blob size for surface(entity type = 3) and allocating # the memory for getting the information for surface(Surface ID = 1). sgm_db_get_blob_size(3,1,i_blob_size,i_return_value) dump i_return_value sys_allocate_array(rv_surface,1,i_blob_size) sgm_db_get_surface(1,i_blob_size,rv_surface,i_return_value) dump i_return_value #--------------------------------------------------------------------# Calling the function to find out shortest distance between the # Surface and point at (1,1,1). ra_point = [1.,1.,1.] # i_return_value = @ sgm_nearest_point_on_surface @ ( ra_point, @ rv_surface, @ r_u, @ r_v, @ raa_xyz ) dump i_return_value dump r_u,r_v,raa_xyz sys_free_array(rv_surface) sys_free_string(sv_asm_create_patch_xy_crtd_ids) #---------------------------------------------------------------------

sgm_ptc_access_v2
# # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function sgm_ptc_access_v2() This session file will open a new database by name ’new.db’. A Pro/ENGINEER geometry file named ’gn-0348.geo’ will be imported with all entities. Model will be made visible on the screen.

Main Index

36 PCL Reference Manual Examples
File Menu

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_ptc_access_v2() # has the following arguments: # # sgm_ptc_access_v2 # ( file_name, # file_type, # simply_trimmed, # create_groups, # save_geo_file, # enable_tol_prompt, # pro_entities, # pro_count, # patran_count ) # #--------------------------------------------------------------------# Variable Declarations STRING s_file_name[32] STRING s_file_type[3] LOGICAL l_simply_trimmed LOGICAL l_create_groups LOGICAL l_save_geo_file LOGICAL l_enable_tol_prompt INTEGER ia_pro_entities(17) INTEGER ia_pro_count(9) INTEGER ia_patran_count(7) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Importing all entities of file named "euclid_exo_2.pat". Form # indicating proposed change in tolerance will appear on the screen. s_file_name = "gn-0348.geo" s_file_type = "GEO" l_simply_trimmed = TRUE l_create_groups = TRUE l_enable_tol_prompt = TRUE ia_pro_entities = [16, 1, 2, 3, 4, 108, 114, @ 118, 120, 122, 128, 154, 156, 160, 170, 172, 174] # i_return_value = @ sgm_ptc_access_v2 @ ( s_file_name, @ s_file_type, @ l_simply_trimmed, @ l_create_groups, @ l_save_geo_file, @ l_enable_tol_prompt, @ ia_pro_entities, @ ia_pro_count, @ ia_patran_count ) dump i_return_value, ia_pro_count, ia_patran_count #---------------------------------------------------------------------

uil_db_commit
# # #

()

Purpose

:

This file provides an example of a call to the function uil_db_commit()

Main Index

Chapter 2: Basic Functions 37
File Menu

# # This session file will open a new database by # name ’new.db’. Initially a line will be drawn # and ’uil_db_commit’ function will be called. # After this one more line will be created and # ’uil_db_undo’ function will be called twice to # undo both the lines. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_db_commit() # has the following arguments: # # uil_db_commit # ( command ) # #--------------------------------------------------------------------# Variable Declarations STRING sa_command[32] INTEGER i_return_value STRING sv_asm_create_line_xyz_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating line with id ’Line 1’ i_return_value = @ asm_const_line_xyz( "1", "<1 1 0>", "[0 0 0]", @ "Coord 0", sv_asm_create_line_xyz_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# The line creation will be committed. sa_command = "committed" # uil_db_commit @ ( sa_command ) #--------------------------------------------------------------------# Creating line with id ’Line 2’ i_return_value = @ asm_const_line_xyz( "2", "<2 1 0>", "[0 0 0]", @ "Coord 0", sv_asm_create_line_xyz_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Attempt will be made to undo the line ’Line 2’. uil_db_undo() # Attempt will be made to undo the line ’Line 1’. uil_db_undo() #--------------------------------------------------------------------sys_free_string(sv_asm_create_line_xyz_crtd_ids) #---------------------------------------------------------------------

uil_db_undo
# # # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function uil_db_undo() This session file will open a new database by name ’new.db’. Initially a line will be drawn and ’uil_db_commit’ function will be called. After this one more line will be created and ’uil_db_undo’ function will be called twice to

Main Index

38 PCL Reference Manual Examples
File Menu

# undo both the lines. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_db_undo() has no arguments. # #--------------------------------------------------------------------# Variable Declarations STRING sa_command[32] INTEGER i_return_value STRING sv_asm_create_line_xyz_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating line with id ’Line 1’ i_return_value = @ asm_const_line_xyz( "1", "<1 1 0>", "[0 0 0]", @ "Coord 0", sv_asm_create_line_xyz_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# The line creation will be committed. sa_command = "committed" # uil_db_commit @ ( sa_command ) #--------------------------------------------------------------------# Creating line with id ’Line 2’ i_return_value = @ asm_const_line_xyz( "2", "<2 1 0>", "[0 0 0]", @ "Coord 0", sv_asm_create_line_xyz_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Attempt will be made to undo the line ’Line 2’. uil_db_undo() # Attempt will be made to undo the line ’Line 1’. uil_db_undo() #--------------------------------------------------------------------sys_free_string(sv_asm_create_line_xyz_crtd_ids) #---------------------------------------------------------------------

uil_file_close.go

()

# # Purpose : This file provides an example of a call to the # function uil_file_close.go() # # This session file will create a new database by # using ’template.db’ in P3_HOME directory by # the name new.db. Session file execution will be # paused. After pressing ’Resume’ button the # database will be closed and the same will be # reopened. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_file_close.go() has no arguments. # #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 39
File Menu

# Variable Declarations STRING s_template_name[32] STRING s_file_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Create a database using ’template.db’ in P3_HOME directory. s_template_name = "" s_file_name = "new.db" # i_return_value = @ uil_file_new.go @ ( s_template_name, @ s_file_name ) $? YES 36000002 dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Database will be closed. # uil_file_close.go() #--------------------------------------------------------------------# The same database will be reopened. # i_return_value = @ uil_file_open.go @ ( s_file_name ) dump i_return_value #---------------------------------------------------------------------

uil_file_new.go

()

# # Purpose : This file provides an example of a call to the # function uil_file_new.go() # # This session file will create a new database by # using ’template.db’ in P3_HOME directory by # the name new.db. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_file_new.go() # has the following arguments: # # uil_file_new.go # ( template_name, # file_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_template_name[32] STRING s_file_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Create a database using ’template.db’ in P3_HOME directory. s_template_name = "" s_file_name = "new.db" # i_return_value = @ uil_file_new.go @ ( s_template_name, @ s_file_name )

Main Index

40 PCL Reference Manual Examples
File Menu

dump i_return_value #---------------------------------------------------------------------

uil_file_open.go

()

# # Purpose : This file provides an example of a call to the # function uil_file_open.go() # # This session file will create a new database by # using ’template.db’ in P3_HOME directory by # the name new.db, closes the same and reopens. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_file_open.go() # has the following arguments: # # uil_file_open.go # ( file_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_template_name[32] STRING s_file_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Create a database using ’template.db’ in P3_HOME directory. s_template_name = "" s_file_name = "new.db" # i_return_value = @ uil_file_new.go @ ( s_template_name, @ s_file_name ) $? YES 36000002 dump i_return_value #--------------------------------------------------------------------# Database will be closed. # uil_file_close.go() #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# The same database will be reopened. # i_return_value = @ uil_file_open.go @ ( s_file_name ) dump i_return_value #---------------------------------------------------------------------

uil_imaging_coordframes.post_cf
# # # # # # # Purpose :

()
This file provides an example of a call to the function uil_imaging_coordframes.post_cf() This session file will open a existing database of name ’view.db’ tile the three viewports. A cylindrical coordinate frame will be created.

Main Index

Chapter 2: Basic Functions 41
File Menu

# The ’unpost’ function will demonstrate the # unposting of the created coordinate frame and # the ’post’ function will post the coordinate # frame after a pause. # # Before running this session file run view.ses # to create view.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_imaging_coordframes.post_cf() # has the following arguments: # # uil_imaging_coordframes.post_cf # ( contents ) # #--------------------------------------------------------------------# Variable Declarations STRING s_contents[16] INTEGER i_return_value STRING sv_asm_create_cord_3po_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") #--------------------------------------------------------------------# Tiling all the viewports. i_return_value = ga_viewport_post("default_viewport") dump i_return_value i_return_value = ga_viewport_post("view1") dump i_return_value i_return_value = ga_viewport_post("view2") dump i_return_value uil_viewport_tiling.tile( ) #--------------------------------------------------------------------# Creating a coordinate frame. The frame will be posted by the create # function. i_return_value = @ asm_const_coord_3point( "1", "Coord 0", 2, "[0 0 0]", "[0 0 1]", @ "[1 0 0]", sv_asm_create_cord_3po_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Unposting the coordinate frame "Coord 1". s_contents = "Coord 1" # i_return_value = @ uil_imaging_coordframes.unpost_cf @ ( s_contents ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# The coordinate frame "Coord 1" will be posted. # i_return_value = @ uil_imaging_coordframes.post_cf @ ( s_contents ) dump i_return_value sys_free_string(sv_asm_create_cord_3po_crtd_ids) #---------------------------------------------------------------------

Main Index

42 PCL Reference Manual Examples
File Menu

uil_imaging_coordframes.unpost_cf

()

# # Purpose : This file provides an example of a call to the # function uil_imaging_coordframes.unpost_cf() # # This session file will open a existing database # of name ’view.db’ tile the three viewports. A # cylindrical coordinate frame will be created. # The function will demonstrate the unposting of # the created coordinate frame. # # Before running this session file run view.ses # to create view.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_imaging_coordframes.unpost_cf() # has the following arguments: # # uil_imaging_coordframes.unpost_cf # ( contents ) # #--------------------------------------------------------------------# Variable Declarations STRING s_contents[16] INTEGER i_return_value STRING sv_asm_create_cord_3po_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") #--------------------------------------------------------------------# Tiling all the viewports. i_return_value = ga_viewport_post("default_viewport") dump i_return_value i_return_value = ga_viewport_post("view1") dump i_return_value i_return_value = ga_viewport_post("view2") dump i_return_value uil_viewport_tiling.tile( ) #--------------------------------------------------------------------# Creating a coordinate frame. The frame will be posted by the create # function. i_return_value = @ asm_const_coord_3point( "1", "Coord 0", 2, "[0 0 0]", "[0 0 1]", @ "[1 0 0]", sv_asm_create_cord_3po_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Unposting the coordinate frame "Coord 1". s_contents = "Coord 1" # i_return_value = @ uil_imaging_coordframes.unpost_cf @ ( s_contents ) dump i_return_value sys_free_string(sv_asm_create_cord_3po_crtd_ids) #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 43
File Menu

uil_primary.get_menubar_id

()

# # Purpose : This file provides an example of a call to the # function uil_primary.get_menubar_id() # # This function gets the widget id of the # primary menubar # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_primary.get_menubar_id() has no arguments. # #--------------------------------------------------------------------# Variable Declarations WIDGET w_return_value #--------------------------------------------------------------------# Calling function to get the primary menubar ID. # w_return_value = uil_primary.get_menubar_id() dump w_return_value #---------------------------------------------------------------------

uil_viewport_tiling.tile

()

# # Purpose : This file provides an example of a call to the # function uil_viewport_tiling.tile() # # This session file will create a new database by # name ’new.db’ and three viewports at different # locations and of different size will be created # and tiled after a pause. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_viewport_tiling.tile() has no arguments. # #--------------------------------------------------------------------# Variable Declarations INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating three viewports at different locations on the screen. i_return_value = ga_viewport_create("view1",0,0,4,4) dump i_return_value i_return_value = ga_viewport_create("view2",0,10,8,4) dump i_return_value i_return_value = ga_viewport_create("view3",10,0,4,7) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Tiling the three views including the "default_viewport".

Main Index

44 PCL Reference Manual Examples
File Menu

# uil_viewport_tiling.tile() #---------------------------------------------------------------------

ugi_import_iges

()

# # Purpose : This file provides an example of a call to the # function ugi_import_iges() # # This session file will open a existing database # of name ’plate.db’. The model will be exported # to IGES format file ’plate_IGES.igs.01’. The # same model will be imported in a new database # named ’new.db’ . # # Before running this session file run plate.ses # to create plate.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ugi_import_iges() # has the following arguments: # # ugi_import_iges # ( file_name, # group_name, # entity_toggle_values, # color_toggle_values, # color_method, # color_definition, # all_layers, # layer, # number_of_groups, # group_entity_ids, # group_entity_values, # group_color_values, # layer_pointers, # group_layers, # scale, # iges_count, # patran_count ) # #--------------------------------------------------------------------# Variable Declarations STRING s_file_name[32] STRING s_group_name[32] LOGICAL la_entity_toggle_values(35) LOGICAL la_color_toggle_values(10) STRING s_color_method[7] STRING s_color_definition[8] LOGICAL l_all_layers STRING s_layer[8] INTEGER i_number_of_groups = 1 INTEGER ia_group_entity_ids(2) LOGICAL laa_group_entity_values(20,2) LOGICAL laa_group_color_values(10,2) INTEGER ia_layer_pointers(2) INTEGER ia_group_layers(4) REAL r_scale INTEGER ia_iges_count(20) INTEGER ia_patran_count(8)

Main Index

Chapter 2: Basic Functions 45
File Menu

INTEGER i_return_value STRING s_start_section[64] STRING s_model_units[8] LOGICAL la_entity_values(7) LOGICAL l_all_groups #--------------------------------------------------------------------# Open the database "plate.db" uil_file_open.go("plate.db") #--------------------------------------------------------------------# Exporting all the entities from plate.db file # to ’plate_IGES.igs.01’ file. s_file_name = "plate_IGES.igs" s_start_section = "File created by exporting plate.db" s_model_units = "Inches" la_entity_values = [TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE] l_all_groups = FALSE ia_group_entity_ids = [1,0] # i_return_value = @ ugi_export_iges @ ( s_file_name, @ s_start_section, @ s_model_units, @ la_entity_values, @ l_all_groups, @ i_number_of_groups, @ ia_group_entity_ids, @ ia_patran_count, @ ia_iges_count ) dump i_return_value # Closing the current database ’plate.db’. uil_file_close.go( ) #--------------------------------------------------------------------# Opening a new database by name ’new.db’. uil_file_new.go( "", "new.db" ) $? YES 36000002 #--------------------------------------------------------------------# Importing all the entities from file ’plate_IGES.igs.01’. s_file_name = "plate_IGES.igs.01" s_group_name = "default_group" s_color_method = "all" l_all_layers = TRUE la_color_toggle_values = [TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE] la_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, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE] # i_return_value = ugi_import_iges ( s_file_name, s_group_name, la_entity_toggle_values, la_color_toggle_values, s_color_method, s_color_definition, l_all_layers, s_layer, i_number_of_groups, ia_group_entity_ids, laa_group_entity_values, laa_group_color_values, ia_layer_pointers, ia_group_layers, r_scale, @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @

Main Index

46 PCL Reference Manual Examples
File Menu

ia_iges_count, ia_patran_count ) dump i_return_value

@

#---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 47
Group Menu

Group Menu
This section contains examples of functions that are used to create, delete, modify and transform groups of geometric and finite element model entities stored in the database.

ga_group_clear

()

# # Purpose : This file provides an example of a call to the # function ga_group_clear() # # This function clears a group of all of its # members. # # In this example, the spool database is opened # and group "fem_model" is posted. Then all the # entities associated with group "fem_model" # are cleared using this function. # Then the same group is posted for viewing in # default viewport. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_clear() # has the following arguments: # # ga_group_clear # ( group_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") # Post the "fem_model" uil_viewport_post_groups.posted_groups ( "default_viewport", 1, ["fem_model"] ) @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Clear group "fem_model" of all its member s_group_name = "fem_model" i_return_value = ga_group_clear ( s_group_name ) dump i_return_value # Post the "fem_model" uil_viewport_post_groups.posted_groups ( "default_viewport", 1, ["fem_model"] )

@ @

@ @

Main Index

48 PCL Reference Manual Examples
Group Menu

# It can be observed that no entity appearing on the default view# port as the group "fem_model" is freed of all the its members #---------------------------------------------------------

ga_group_create_groups

()

# # Purpose : This file provides an example of a call to the # function ga_group_create() # # This function creates an empty group in the # database # # In this example, the spool database is opened # and a new group("new_group") is created. List # of groups present in database is verified # before and after creation. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_create() has the following arguments: # # ga_group_create # ( group_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING sa_groups[32](3) INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") # Get the list of groups i_return_value = ga_group_groups_get ( sa_groups ) dump i_return_value dump sa_groups # Create "new_group" s_group_name = "new_group" i_return_value = ga_group_create ( s_group_name ) dump i_return_value @

@ @

# Get the list of groups i_return_value = @ ga_group_groups_get ( sa_groups ) dump i_return_value dump sa_groups #---------------------------------------------------------------------

ga_group_current_set
#

()

Main Index

Chapter 2: Basic Functions 49
Group Menu

# Purpose : This file provides an example of a call to the # function ga_group_current_set() # # This function sets up the current group for # receiving newly created entities, and also # posts the specified group to current viewport. # # In this example, the spool database is opened # and id of the current group is obtained. Then # "default_group" is set as the current-group # using this function. The id of the current# group is once again obtained for verification. # # Groups present in spool.db are "default_group" # ( id = 1 ) and "fem_model"( id = 2 ). # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_current_set() has the following arguments: # # ga_group_current_set # ( group_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] INTEGER i_group_id INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") # Get the current group id i_return_value = db_get_current_group_id ( i_group_id ) dump i_return_value dump i_group_id # Set "default_group" as current group s_group_name = "default_group" i_return_value = ga_group_current_set ( s_group_name ) dump i_return_value @ @

@ @

# Get the current group id i_return_value = @ db_get_current_group_id @ ( i_group_id ) dump i_return_value dump i_group_id #---------------------------------------------------------------------

ga_group_delete
# # # # #

()

Purpose

:

This file provides an example of a call to the function ga_group_delete() This function deletes a group from the database

Main Index

50 PCL Reference Manual Examples
Group Menu

# # In this example, the spool database is opened # and then "default_group" is deleted using this # function. The list of groups present in # database is verified before and after deletion. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_delete() has the following arguments: # # ga_group_delete # ( group_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING sa_groups[32](2) INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") # Get the list of groups i_return_value = ga_group_groups_get ( sa_groups ) dump i_return_value dump sa_groups # Delete the group s_group_name = "default_group" i_return_value = ga_group_delete ( s_group_name ) dump i_return_value # Re-initialization of sa_groups sa_groups(1) = "" sa_groups(2) = "" # Get the list of groups i_return_value = ga_group_groups_get ( sa_groups ) dump i_return_value dump sa_groups @ @

@ @

# It can be observed that all geometric entities disappear # from the screen, as default_group was consisting of geomeric # entities only. #---------------------------------------------------------------------

ga_group_display_set
# # # # # # # # #

()
: This file provides an example of a call to the function ga_group_display_set() This function changes the current display property list associated with a group and posts the group to the current viewport. In this example the spool.db is opened and

Purpose

Main Index

Chapter 2: Basic Functions 51
Group Menu

# display property of group, "fem_model" is # obtained using the function, # ga_group_display_get(). Then the display prope# rty of "fem_model" is changed to "simple" using # this function. The change in display property # of "fem_model" is verified in the end. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_display_set() # has the following arguments: # # ga_group_display_set # ( group_name, # display_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_display_list[32] INTEGER i_return_value STRING s_display_property[32] #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") # Post "fem_model" uil_viewport_post_groups.posted_groups ( "default_viewport", 1, ["fem_model"] ) # Group name s_group_name = "fem_model" # Get the display property "fem_model" i_return_value = ga_group_display_get ( s_group_name, s_display_property ) dump i_return_value dump s_display_property @ @ @ @

# Set current display property associated with a group s_display_list = "simple" i_return_value = @ ga_group_display_set @ ( s_group_name, @ s_display_list ) dump i_return_value # Get the display property "fem_model" i_return_value = @ ga_group_display_get @ ( s_group_name, @ s_display_property ) dump i_return_value dump s_display_property #---------------------------------------------------------------------

ga_group_entity_add
#

()

Main Index

52 PCL Reference Manual Examples
Group Menu

# Purpose : This file provides an example of a call to the # function ga_group_entity_add() # # This function adds a list of entities as # members to a group. # # In this example, the spool database is opened # and a new group("new_group") is created and # posted for viewing. After a pause, geometric # entities are added to the group and viewed # again. The list of members present in # "new_group" is also checked, before and # after the addition of entities. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_entity_add() # has the following arguments: # # ga_group_entity_add # ( group_name, # entities ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_entities[128] INTEGER i_return_value STRING sv_members[VIRTUAL] #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") # Create "new_group" i_return_value = ga_group_create ( "new_group" ) dump i_return_value # Post "new_group" uil_viewport_post_groups.posted_groups ( "default_viewport", 1, ["new_group"] ) # Get the list of all members of group i_return_value = uil_group_members_get ( "new_group" , sv_members ) dump i_return_value dump sv_members @ @

@

@ @

# It can be observed that entities not appearing on the default view# port as a newly created group is empty. # Session file paused. Press "Resume" to continue.. sf_pause() # Add all geometric entities to "new_group" s_group_name = "new_group" s_entities = "Point 6:7 4:5 8:10 Curve 3 1:2 Surface 1:6" i_return_value = @ ga_group_entity_add @ ( s_group_name, @ s_entities )

Main Index

Chapter 2: Basic Functions 53
Group Menu

dump i_return_value # Get the list of all members of group i_return_value = uil_group_members_get ( "new_group" , sv_members ) dump i_return_value dump sv_members @ @

# Free allocated memory sys_free_string ( sv_members ) #---------------------------------------------------------------------

ga_group_entity_remove

()

# Purpose : This file provides an example of a call to the # function ga_group_entity_remove() # # This function removes a list of entities from # a group. # # In this example, the spool database is opened # and "default_group" is posted for viewing. # After a pause, surfaces 1 to 3 are removed # from "default_group". The list of members # present in "default_group" is also checked, # before and after the removal of entities. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_entity_remove() # has the following arguments: # # ga_group_entity_remove # ( group_name, # entities ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_entities[32] INTEGER i_return_value STRING sv_members[VIRTUAL] #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") # Post "default_group" uil_viewport_post_groups.posted_groups ( "default_viewport", 1, ["default_group"] ) # Get the list of all members of group i_return_value = uil_group_members_get ( "default_group" , sv_members ) dump i_return_value dump sv_members # Session file paused. Press "Resume" to continue.. sf_pause() @

@ @

Main Index

54 PCL Reference Manual Examples
Group Menu

# Remove surfaces 1 to 3 from "default_group" s_group_name = "default_group" s_entities = "Surface 1:3" i_return_value = ga_group_entity_remove ( s_group_name, s_entities ) dump i_return_value # Get the list of all members of group i_return_value = uil_group_members_get ( "default_group" , sv_members ) dump i_return_value dump sv_members # #

@ @ @

@ @

It can be observed that surfaces-1,2,3 disappearing from the view-port because of their removal from the "default_group"

# Free allocated memory sys_free_string ( sv_members ) #---------------------------------------------------------------------

ga_group_members_delete

()

# # Purpose : This file provides an example of a call to the # function ga_group_members_delete() # # This function deletes the entities associated # with a group from the database. # # In this example, the spool database is opened # and members (fem entities) associated with # group "fem_model" is deleted by calling this # function. The default display view-port is # then refreshed. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_members_delete() has the following arguments: # # ga_group_members_delete # ( group_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") # Session file paused. Press "Resume" to continue.. sf_pause() # Delete members of "fem_model" s_group_name = "fem_model" i_return_value = ga_group_members_delete ( s_group_name )

@ @

Main Index

Chapter 2: Basic Functions 55
Group Menu

dump i_return_value # Patran generating list of deleted entities can also be seen from # the history window. #---------------------------------------------------------------------

ga_group_precision_set

()

# # Purpose : This file provides an example of a call to the # function ga_group_precision_set() # # This function sets the precision of the rende# ring for a specified group. # # In this example the spool.db is opened and the # precision for rendering of group "fem_model" is # obtained using the function, ga_group_precision # _get (). Then the precision of "fem_model" is # changed to 1 using this function. The change in # precision is verified in the end. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_precision_set() # has the following arguments: # # ga_group_precision_set # ( group_name, # precision_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[128] INTEGER i_precision_status INTEGER i_precision_status_get INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") # Post "fem_model" uil_viewport_post_groups.posted_groups ( "default_viewport", 1, ["fem_model"] ) # Group name s_group_name = "fem_model" # Get the display property "fem_model" i_return_value = ga_group_precision_get ( s_group_name, i_precision_status_get ) dump i_return_value dump i_precision_status_get @ @ @ @

# Set current display property associated with a group i_precision_status = 1 i_return_value = @ ga_group_precision_set @ ( s_group_name, @

Main Index

56 PCL Reference Manual Examples
Group Menu

i_precision_status ) dump i_return_value # Get the display property "fem_model" i_return_value = @ ga_group_precision_get @ ( s_group_name, @ i_precision_status_get ) dump i_return_value dump i_precision_status_get #---------------------------------------------------------------------

ga_group_rename

()

# # Purpose : This file provides an example of a call to the # function ga_group_rename() # # This function renames the specified group. # # In this example, the spool database is opened # and the group "fem_model" is renamed to # "fem_renamed". The list of groups present in # the database is checked before and after # renaming. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_rename() # has the following arguments: # # ga_group_rename # ( original_name, # new_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_original_name[32] STRING s_new_name[32] STRING sa_groups[32](2) INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") # Get the list of groups i_return_value = ga_group_groups_get ( sa_groups ) dump i_return_value dump sa_groups # Rename group "fem_model" to "fem_renamed" s_original_name = "fem_model" s_new_name = "fem_renamed" i_return_value = ga_group_rename ( s_original_name, s_new_name ) dump i_return_value # Get the list of groups @

@ @ @

Main Index

Chapter 2: Basic Functions 57
Group Menu

i_return_value = @ ga_group_groups_get ( sa_groups ) dump i_return_value dump sa_groups #---------------------------------------------------------------------

ga_group_transform_mirror

()

# # Purpose : This file provides an example of a call to the # function ga_group_transform_mirror() # # This function creates a new set of entities # which are a mirror of the entities contained # in the named group. # # In this example a new database is opened and a # cube is created. After a pause, this function # is called to create a new set of entities which # are mirror of entities(cube) present in default # _group. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_transform_mirror() # has the following arguments: # # ga_group_transform_mirror # ( group_name, # plane, # offset, # delete_original, # use_original_labels, # reverse ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_plane[32] REAL r_offset LOGICAL l_delete_original LOGICAL l_use_original_labels LOGICAL l_reverse INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Create cube of dimension of 1*1*1 i_return_value = asm_const_hpat_xyz ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value @ @ @

@

# Session file paused. Press "Resume" to continue.. sf_pause()

Main Index

58 PCL Reference Manual Examples
Group Menu

# Name of the group s_group_name = "default_group" # Plane for mirroring s_plane = "Coord 0.3" # Offset distance between mirrored entities r_offset = 5 # Do not delete original entities l_delete_original = FALSE # Do not set same labels to the new entities as that of original l_use_original_labels = FALSE # Do not reverse curves and surfaces of mirrored entities l_reverse = FALSE # Create a new set of entities by mirroring. i_return_value = ga_group_transform_mirror ( s_group_name, s_plane, r_offset, l_delete_original, l_use_original_labels, l_reverse ) dump i_return_value # Free allocated memory sys_free_string ( sv_hpat_ids ) # Copy of created entities can be seen in the display #--------------------------------------------------------------------@ @ @ @ @ @ @

ga_group_transform_mirror2
# # # # # # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_group_transform_mirror2() This function creates a new set of entities which are a mirror of the entities contained in the named group. In this example a new database is opened and a cube with an lbc("force_1") is created. After a pause, this function is called to create a new set of entities which are mirror of entities and present in default_group. The lbcs are copied without co-ordinate transformation to the mirrored entities. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_group_transform_mirror2() has the following arguments: ga_group_transform_mirror2 ( group_name, plane, offset,

Main Index

Chapter 2: Basic Functions 59
Group Menu

# delete_original, # use_original_labels, # reverse, # lbc_copy_sets, # lbc_transform_sets, # prop_copy_sets, # prop_transform_sets ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_plane[32] REAL r_offset LOGICAL l_delete_original LOGICAL l_use_original_labels LOGICAL l_reverse STRING sa_lbc_copy_sets[16](2) STRING sa_lbc_transform_sets[16](2) STRING sa_prop_copy_sets[16](2) STRING sa_prop_transform_sets[16](2) INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Create cube of dimension of 1*1*1 i_return_value = asm_const_hpat_xyz ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value # Create lbc i_return_value = loadsbcs_create ( "force_1", "Force", "Nodal", "", "Static", ["Point 7"], "Geometry", "Coord 0", 1., ["<0 -100 0 >", "< >"], ["", ""] ) dump i_return_value @ @ @

@

@ @ @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Name of the group s_group_name = "default_group" # Plane for mirroring s_plane = "Coord 0.3" # Offset distance between mirrored entities r_offset = 2 # Do not delete original entities l_delete_original = FALSE # Do not set same labels to the new entities as that of original l_use_original_labels = FALSE # Do not reverse curves and surfaces of mirrored entities l_reverse = FALSE

Main Index

60 PCL Reference Manual Examples
Group Menu

# Names of LBCs to be copied without co-ordinate transformation. sa_lbc_copy_sets(1) = "$ALL" sa_lbc_copy_sets(2) = "" # Create a new set of entities by mirroring i_return_value = ga_group_transform_mirror2 ( s_group_name, s_plane, r_offset, l_delete_original, l_use_original_labels, l_reverse, sa_lbc_copy_sets, sa_lbc_transform_sets, sa_prop_copy_sets, sa_prop_transform_sets ) dump i_return_value # Free allocated memory sys_free_string(sv_hpat_ids) # Copy of created entities can be seen in the display #--------------------------------------------------------------------@ @ @ @ @ @ @ @ @ @ @

ga_group_transform_pivot

()

# Purpose : This file provides an example of a call to the # function ga_group_transform_pivot() # # This function creates a new set of entities # which are a copy of the entities contained in # the named group pivoted around a point defined # in space. # # In this example a new database is opened and a # cuboid is created. After a pause, this function # is called to create a new set of entities with # [0 0 0] as pivot-point . # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_transform_pivot() # has the following arguments: # # ga_group_transform_pivot # ( group_name, # pivot_point, # start_point, # end_point, # delete_original, # use_original_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_pivot_point[32] STRING s_start_point[32] STRING s_end_point[32] LOGICAL l_delete_original LOGICAL l_use_original_labels INTEGER i_return_value

Main Index

Chapter 2: Basic Functions 61
Group Menu

STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Create cuboid of dimension of 10*1*5 i_return_value = asm_const_hpat_xyz ( "1", "<10 1 5>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value @ @ @

@

# Session file paused. Press "Resume" to continue.. sf_pause() # Name of the group s_group_name = "default_group" # Points definition s_pivot_point = "[0 0 0]" s_start_point = "Point 8" s_end_point = "Point 7" # Do not delete original entities l_delete_original = FALSE # Do not set same labels to the new entities as that of original l_use_original_labels = FALSE # Create a new set of entities by pivot transformation method i_return_value = @ ga_group_transform_pivot @ ( s_group_name, @ s_pivot_point, @ s_start_point, @ s_end_point, @ l_delete_original, @ l_use_original_labels ) dump i_return_value # Free allocated memory sys_free_string(sv_hpat_ids) # Copy of created entities can be seen in the display #---------------------------------------------------------------------

ga_group_transform_pivot2
# # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_group_transform_pivot2() This function creates a new set of entities which are a copy of the entities contained in the named group pivoted around a point defined in space. In this example a new database is opened and a cuboid with an lbc("force_1") is created. After a pause, this function is called to create a new set of entities with [0 0 0]as pivot point.

Main Index

62 PCL Reference Manual Examples
Group Menu

# The lbcs are copied without co-ordinate transf# ormation to the transformed entities. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_transform_pivot2() # has the following arguments: # # ga_group_transform_pivot2 # ( group_name, # pivot_point, # start_point, # end_point, # delete_original, # use_original_labels, # lbc_copy_sets, # lbc_transform_sets, # prop_copy_sets, # prop_transform_sets ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_pivot_point[32] STRING s_start_point[32] STRING s_end_point[32] LOGICAL l_delete_original LOGICAL l_use_original_labels STRING sa_lbc_copy_sets[32](2) STRING sa_lbc_transform_sets[32](2) STRING sa_prop_copy_sets[32](2) STRING sa_prop_transform_sets[32](2) INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Create cuboid of dimension of l0*1*5 i_return_value = asm_const_hpat_xyz ( "1", "<10 1 5>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value # Create lbc i_return_value = loadsbcs_create ( "force_1", "Force", "Nodal", "", "Static", ["Point 7"], "Geometry", "Coord 0", 1., ["<0 -100 0 >", "< >"], ["", ""] ) dump i_return_value @ @ @

@

@ @ @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Name of the group s_group_name = "default_group"

Main Index

Chapter 2: Basic Functions 63
Group Menu

# Points definition s_pivot_point = "[0 0 0]" s_start_point = "Point 8" s_end_point = "Point 7" # Do not delete original entities l_delete_original = FALSE # Do not set same labels to the new entities as that of original l_use_original_labels = FALSE # Names of LBCs to be copied without co-ordinate transformation sa_lbc_copy_sets(1) = "$ALL" sa_lbc_copy_sets(2) = "" # Create a new set of entities by pivot transformation method i_return_value = @ ga_group_transform_pivot2 @ ( s_group_name, @ s_pivot_point, @ s_start_point, @ s_end_point, @ l_delete_original, @ l_use_original_labels, @ sa_lbc_copy_sets, @ sa_lbc_transform_sets, @ sa_prop_copy_sets, @ sa_prop_transform_sets ) dump i_return_value # Free allocated memory sys_free_string(sv_hpat_ids) # Copy of created entities can be seen in the display #---------------------------------------------------------------------

ga_group_transform_position
# # # # # # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_group_transform_position() This function creates a new set of entities which are a copy of the entities contained in the named group by rigid body positional and rotational translation in space. In this example a new database is opened and a cube is created. After a pause, this function is called to create a new set of entities after specification of origin and destination points. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_group_transform_position() has the following arguments: ga_group_transform_position ( group_name, start_point_1, start_point_2, start_point_3, end_point_1,

Main Index

64 PCL Reference Manual Examples
Group Menu

# end_point_2, # end_point_3, # delete_original, # use_original_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_start_point_1[32] STRING s_start_point_2[32] STRING s_start_point_3[32] STRING s_end_point_1[32] STRING s_end_point_2[32] STRING s_end_point_3[32] LOGICAL l_delete_original LOGICAL l_use_original_labels INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Create cube of dimension of 1*1*1 i_return_value = asm_const_hpat_xyz ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value @ @ @

@

# Session file paused. Press "Resume" to continue.. sf_pause() # Name of the group s_group_name = "default_group" # Points definitions s_start_point_1 = "Point 1 " s_start_point_2 = "Point 4 " s_start_point_3 = "Point 8 " s_end_point_1 = "[0 3 0]" s_end_point_2 = "[0 3 1]" s_end_point_3 = "[1 3.1 1]" # Do not delete original entities l_delete_original = FALSE # Do not set same labels to the new entities as that of original l_use_original_labels = FALSE # Create a new set of entities by position transformation method i_return_value = @ ga_group_transform_position @ ( s_group_name, @ s_start_point_1, @ s_start_point_2, @ s_start_point_3, @ s_end_point_1, @ s_end_point_2, @ s_end_point_3, @ l_delete_original, @ l_use_original_labels ) dump i_return_value

Main Index

Chapter 2: Basic Functions 65
Group Menu

# Free allocated memory sys_free_string(sv_hpat_ids) # Copy of created entities can be seen in the display #---------------------------------------------------------------------

ga_group_transform_position2

()

# # Purpose : This file provides an example of a call to the # function ga_group_transform_position2() # # This function creates a new set of entities # which are a copy of the entities contained in # the named group by rigid body positional and # rotational translation in space. # # In this example a new database is opened and a # cube with an lbc("force_1") is created. After a # pause, this function is called to create a new # set of entities after specification of origin # and destination points. The lbcs are copied # without co-ordinate transformation to the tran# sformed entities. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_transform_position2() # has the following arguments: # # ga_group_transform_position2 # ( group_name, # start_point_1, # start_point_2, # start_point_3, # end_point_1, # end_point_2, # end_point_3, # delete_original, # use_original_labels, # lbc_copy_sets, # lbc_transform_sets, # prop_copy_sets, # prop_transform_sets ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_start_point_1[32] STRING s_start_point_2[32] STRING s_start_point_3[32] STRING s_end_point_1[32] STRING s_end_point_2[32] STRING s_end_point_3[32] LOGICAL l_delete_original LOGICAL l_use_original_labels STRING sa_lbc_copy_sets[32](2) STRING sa_lbc_transform_sets[32](2) STRING sa_prop_copy_sets[32](2) STRING sa_prop_transform_sets[32](2) INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #---------------------------------------------------------------------

Main Index

66 PCL Reference Manual Examples
Group Menu

# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Create cube of dimension of 1*1*1 i_return_value = asm_const_hpat_xyz ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value # Create lbc i_return_value = loadsbcs_create ( "force_1", "Force", "Nodal", "", "Static", ["Point 7"], "Geometry", "Coord 0", 1., ["<0 -100 0 >", "< >"], ["", ""] ) dump i_return_value @ @ @

@

@ @ @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Name of the group s_group_name = "default_group" # Points definitions s_start_point_1 = "Point 1 " s_start_point_2 = "Point 4 " s_start_point_3 = "Point 8 " s_end_point_1 = "[0 3 0]" s_end_point_2 = "[1 3 0]" s_end_point_3 = "[1 3.1 1]" # Do not delete original entities l_delete_original = FALSE # Do not set same labels to the new entities as that of original l_use_original_labels = FALSE # Names of LBCs to be copied without co-ordinate transformation. sa_lbc_copy_sets(1) = "$ALL" sa_lbc_copy_sets(2) = "" # Create a new set of entities by position transformation method i_return_value = @ ga_group_transform_position2 @ ( s_group_name, @ s_start_point_1, @ s_start_point_2, @ s_start_point_3, @ s_end_point_1, @ s_end_point_2, @ s_end_point_3, @ l_delete_original, @ l_use_original_labels, @ sa_lbc_copy_sets, @ sa_lbc_transform_sets, @ sa_prop_copy_sets, @ sa_prop_transform_sets ) dump i_return_value # Free allocated memory

Main Index

Chapter 2: Basic Functions 67
Group Menu

sys_free_string(sv_hpat_ids) # Copy of created entities can be seen in the display #---------------------------------------------------------------------

ga_group_transform_rotate

()

# # Purpose : This file provides an example of a call to the # function ga_group_transform_rotate() # # This function creates a new set of entities # which are a copy of the entities contained in # the named group by rigid body rotational # translation in space. # # In this example a new database is opened and a # cube is created. After a pause, this function # is called to create a new set of entities with # an rotational translation of 45 degrees along # Z axis. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_transform_rotate() # has the following arguments: # # ga_group_transform_rotate # ( group_name, # coordinate_frame_id, # rotation_axis, # rotation_angle, # offset_angle, # delete_original, # use_original_labels, # repeat_count ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_coordinate_frame_id[32] STRING s_rotation_axis[32] REAL r_rotation_angle REAL r_offset_angle LOGICAL l_delete_original LOGICAL l_use_original_labels INTEGER i_repeat_count INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Create cube of dimension of 1*1*1 i_return_value = asm_const_hpat_xyz ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) @ @ @

@

Main Index

68 PCL Reference Manual Examples
Group Menu

dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() # Name of the group s_group_name = "default_group" # Rotation details s_coordinate_frame_id = "CoordinateFrame 0" s_rotation_axis = "Coord 0.3" r_rotation_angle = 45.0 r_offset_angle = 0.0 # Do not delete original entities l_delete_original = FALSE # Do not set same labels to the new entities as that of original l_use_original_labels = FALSE # Number of times to repeat the transformation i_repeat_count = 1 # Create a new set of entities by rotation transformation method i_return_value = @ ga_group_transform_rotate @ ( s_group_name, @ s_coordinate_frame_id, @ s_rotation_axis, @ r_rotation_angle, @ r_offset_angle, @ l_delete_original, @ l_use_original_labels, @ i_repeat_count ) dump i_return_value # Free allocated memory sys_free_string(sv_hpat_ids) # Copy of created entities can be seen in the display #---------------------------------------------------------------------e

ga_group_transform_rotate2
# # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_group_transform_rotate2() This function creates a new set of entities which are a copy of the entities contained in the named group by rigid body rotational translation in space. In this example a new database is opened and a cube with an lbc("force_1") is created. After a pause, this function is called to create a new set of entities with an rotational translation of 45 degrees along Z axis. The lbcs are copied without co-ordinate transformation to the transformed entities. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_group_transform_rotate2()

Main Index

Chapter 2: Basic Functions 69
Group Menu

# has the following arguments: # # ga_group_transform_rotate2 # ( group_name, # coordinate_frame_id, # rotation_axis, # rotation_angle, # offset_angle, # delete_original, # use_original_labels, # repeat_count, # lbc_copy_sets, # lbc_transform_sets, # prop_copy_sets, # prop_transform_sets ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_coordinate_frame_id[32] STRING s_rotation_axis[32] REAL r_rotation_angle REAL r_offset_angle LOGICAL l_delete_original LOGICAL l_use_original_labels INTEGER i_repeat_count STRING sa_lbc_copy_sets[32](2) STRING sa_lbc_transform_sets[32](2) STRING sa_prop_copy_sets[32](2) STRING sa_prop_transform_sets[32](2) INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Create cube of dimension of 1*1*1 i_return_value = asm_const_hpat_xyz ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value # Create lbc i_return_value = loadsbcs_create ( "force_1", "Force", "Nodal", "", "Static", ["Point 7"], "Geometry", "Coord 0", 1., ["<0 -100 0 >", "< >"], ["", ""] ) dump i_return_value @ @ @

@

@ @ @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Name of the group s_group_name = "default_group" # Rotation details s_rotation_axis = "Coord 0.3" r_rotation_angle = 45.0 r_offset_angle = 0.0

Main Index

70 PCL Reference Manual Examples
Group Menu

s_coordinate_frame_id = "CoordinateFrame 0" # Do not delete original entities l_delete_original = FALSE # Do not set same labels to the new entities as that of original l_use_original_labels = FALSE # Number of times to repeat the transformation i_repeat_count = 1 # Names of LBCs to be copied without co-ordinate transformation. sa_lbc_copy_sets(1) = "$ALL" sa_lbc_copy_sets(2) = "" # Create a new set of entities by rotation transformation method i_return_value = @ ga_group_transform_rotate2 @ ( s_group_name, @ s_coordinate_frame_id, @ s_rotation_axis, @ r_rotation_angle, @ r_offset_angle, @ l_delete_original, @ l_use_original_labels, @ i_repeat_count, @ sa_lbc_copy_sets, @ sa_lbc_transform_sets, @ sa_prop_copy_sets, @ sa_prop_transform_sets ) dump i_return_value # Free allocated memory sys_free_string(sv_hpat_ids) # Copy of created entities can be seen in the display #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 71
Group Menu

ga_group_transform_scale

()

# # Purpose : This file provides an example of a call to the # function ga_group_transform_scale() # # This function creates a new set of entities # which are a scaled-copy of the entities contai# ned in the named group. # # In this example a new database is opened and a # cube is created. After a pause, this function # is called to create a new set of entities which # are twice the size (scale_factor = 2 along x,y, # z axis) of the original. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_transform_scale() # has the following arguments: # # ga_group_transform_scale # ( group_name, # coordinate_frame_id, # origin_point, # scale_factors, # delete_original, # use_original_labels, # repeat_count ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_coordinate_frame_id[32] STRING s_origin_point[32] REAL ra_scale_factors(3) LOGICAL l_delete_original LOGICAL l_use_original_labels INTEGER i_repeat_count INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Create cube of dimension of 1*1*1 i_return_value = asm_const_hpat_xyz ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value @ @ @

@

# Session file paused. Press "Resume" to continue.. sf_pause()

Main Index

72 PCL Reference Manual Examples
Group Menu

# Name of the group s_group_name = "default_group" # Scaling details s_coordinate_frame_id = "CoordinateFrame 0" s_origin_point = "[0 0 0]" ra_scale_factors = [2.0, 2.0, 2.0] # Do not delete original entities l_delete_original = FALSE # Do not set same labels to the new entities as that of original l_use_original_labels = FALSE # Number of times to repeat the transformation i_repeat_count = 1 # Create a new set of entities by scale transformation method i_return_value = @ ga_group_transform_scale @ ( s_group_name, @ s_coordinate_frame_id, @ s_origin_point, @ ra_scale_factors, @ l_delete_original, @ l_use_original_labels, @ i_repeat_count ) dump i_return_value # Free allocated memory sys_free_string(sv_hpat_ids) # Copy of created entities can be seen in the display #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 73
Group Menu

ga_group_transform_scale2

()

# # Purpose : This file provides an example of a call to the # function ga_group_transform_scale2() # # This function creates a new set of entities # which are a scaled-copy of the entities contai# ned in the named group. # # In this example a new database is opened and a # cube with an lbc("force_1") is created. After a # pause, this function is called to create a new # set of entities which are twice the size # (scale_factor = 2 along x,y, z axis) of the # original. The lbcs are copied without coord# inate transformation to the transformed # entities # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_transform_scale2() # has the following arguments: # # ga_group_transform_scale2 # ( group_name, # coordinate_frame_id, # origin_point, # scale_factors, # delete_original, # use_original_labels, # repeat_count, # lbc_copy_sets, # lbc_transform_sets, # prop_copy_sets, # prop_transform_sets ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_coordinate_frame_id[32] STRING s_origin_point[32] REAL ra_scale_factors(3) LOGICAL l_delete_original LOGICAL l_use_original_labels INTEGER i_repeat_count STRING sa_lbc_copy_sets[32](2) STRING sa_lbc_transform_sets[32](2) STRING sa_prop_copy_sets[32](2) STRING sa_prop_transform_sets[32](2) INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Create cube of dimension of 1*1*1 i_return_value = asm_const_hpat_xyz ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", @ @ @

Main Index

74 PCL Reference Manual Examples
Group Menu

sv_hpat_ids ) dump i_return_value # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value # Create lbc i_return_value = loadsbcs_create ( "force_1", "Force", "Nodal", "", "Static", ["Point 7"], "Geometry", "Coord 0", 1., ["<0 -100 0 >", "< >"], ["", ""] ) dump i_return_value @

@ @ @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Name of the group s_group_name = "default_group" # Scaling details s_origin_point = "[0 0 0]" ra_scale_factors = [2.0, 2.0, 2.0] s_coordinate_frame_id = "CoordinateFrame 0" # Do not delete original entities l_delete_original = FALSE # Do not set same labels to the new entities as that of original l_use_original_labels = FALSE # Number of times to repeat the transformation i_repeat_count = 1 # Names of LBCs to be copied without co-ordinate transformation. sa_lbc_copy_sets(1) = "$ALL" sa_lbc_copy_sets(2) = "" # Create a new set of entities by scale transformation method i_return_value = @ ga_group_transform_scale2 @ ( s_group_name, @ s_coordinate_frame_id, @ s_origin_point, @ ra_scale_factors, @ l_delete_original, @ l_use_original_labels, @ i_repeat_count, @ sa_lbc_copy_sets, @ sa_lbc_transform_sets, @ sa_prop_copy_sets, @ sa_prop_transform_sets ) dump i_return_value # Free allocated memory sys_free_string(sv_hpat_ids) # Copy of created entities can be seen in the display #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 75
Group Menu

ga_group_transform_translate

()

# # Purpose : This file provides an example of a call to the # function ga_group_transform_translate() # # This function creates a new set of entities # which are a copy of the entities contained in # the named group by movement or translation in # space according to the translation vector. # # In this example a new database is opened and a # cube is created. After a pause, this function # is called to create a new set of entities with # <3,3,3> as translation vector. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_transform_translate() # has the following arguments: # # ga_group_transform_translate # ( group_name, # coordinate_frame_id, # translation_vector, # delete_original, # use_original_labels, # repeat_count ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_coordinate_frame_id[32] STRING s_translation_vector[32] LOGICAL l_delete_original LOGICAL l_use_original_labels INTEGER i_repeat_count INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Create cube of dimension of 1*1*1 i_return_value = asm_const_hpat_xyz ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value @ @ @

@

# Session file paused. Press "Resume" to continue.. sf_pause() # Name of the group s_group_name = "default_group"

Main Index

76 PCL Reference Manual Examples
Group Menu

# Linear translation details s_coordinate_frame_id = "CoordinateFrame 0" s_translation_vector = "<3 3 3>" # Do not delete original entities l_delete_original = FALSE # Do not set same labels to the new entities as that of original l_use_original_labels = FALSE # Number of times to repeat the transformation i_repeat_count = 1 # Create a new set of entities by vector transformation method i_return_value = @ ga_group_transform_translate @ ( s_group_name, @ s_coordinate_frame_id, @ s_translation_vector, @ l_delete_original, @ l_use_original_labels, @ i_repeat_count ) dump i_return_value # Free allocated memory sys_free_string(sv_hpat_ids) # Copy of created entities can be seen in the display #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 77
Group Menu

ga_group_transform_translate2

()

# # Purpose : This file provides an example of a call to the # function ga_group_transform_translate2() # # This function creates a new set of entities # which are a copy of the entities contained in # the named group by movement or translation in # space according to the translation vector. # # In this example a new database is opened and a # cube with an lbc("force_1") is created. After a # pause, this function is called to create a new # set of entities with <3,3,3> as translation # vector. The lbcs are copied without # co-ordinate transformation to the transformed # entities. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_group_transform_translate2() # has the following arguments: # # ga_group_transform_translate2 # ( group_name, # coordinate_frame_id, # translation_vector, # delete_original, # use_original_labels, # repeat_count, # lbc_copy_sets, # lbc_transform_sets, # prop_copy_sets, # prop_transform_sets ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING s_coordinate_frame_id[32] STRING s_translation_vector[32] LOGICAL l_delete_original LOGICAL l_use_original_labels INTEGER i_repeat_count STRING sa_lbc_copy_sets[32](2) STRING sa_lbc_transform_sets[32](2) STRING sa_prop_copy_sets[32](2) STRING sa_prop_transform_sets[32](2) INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Create cube of dimension of 1*1*1 i_return_value = asm_const_hpat_xyz ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value @ @ @

Main Index

78 PCL Reference Manual Examples
Group Menu

# Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value # Create lbc i_return_value = loadsbcs_create ( "force_1", "Force", "Nodal", "", "Static", ["Point 7"], "Geometry", "Coord 0", 1., ["<0 -100 0 >", "< >"], ["", ""] ) dump i_return_value

@

@ @ @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Name of the group s_group_name = "default_group" # Linear translation details s_coordinate_frame_id = "CoordinateFrame 0" s_translation_vector = "<3 3 3>" # Do not delete original entities l_delete_original = FALSE # Do not set same labels to the new entities as that of original l_use_original_labels = FALSE # Number of times to repeat the transformation i_repeat_count = 1 # Names of LBCs to be copied without co-ordinate transformation. sa_lbc_copy_sets(1) = "$ALL" sa_lbc_copy_sets(2) = "" # Create a new set of entities by vector transformation method i_return_value = @ ga_group_transform_translate2 @ ( s_group_name, @ s_coordinate_frame_id, @ s_translation_vector, @ l_delete_original, @ l_use_original_labels, @ i_repeat_count, @ sa_lbc_copy_sets, @ sa_lbc_transform_sets, @ sa_prop_copy_sets, @ sa_prop_transform_sets ) dump i_return_value # Free allocated memory sys_free_string(sv_hpat_ids) # Copy of created entities can be seen in the display #---------------------------------------------------------------------

uil_group_members_get
# # # # # #

()

Purpose

:

This file provides an example of 2 calls to the function uil_group_members_get() This function gets the list of all members of a group.

Main Index

Chapter 2: Basic Functions 79
Group Menu

# # In this example a new database is opened and # this function is called to get the list of # members in "default_group". A cube is then # created. This cube forms the member of the # current group i.e "default_group". Then this # function is called once again to get the list # of members in "default_group". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_group_members_get() # has the following arguments: # # uil_group_members_get # ( group_name, # members ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] STRING sv_members[VIRTUAL] INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("", "new.db") $? YES 36000002 # Get the list of all members of group s_group_name = "default_group" i_return_value = uil_group_members_get ( s_group_name, sv_members ) dump i_return_value dump sv_members # Create cube of dimension of 1*1*1 i_return_value = asm_const_hpat_xyz ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value # Get the list of all members of group s_group_name = "default_group" i_return_value = uil_group_members_get ( s_group_name, sv_members ) dump i_return_value dump sv_members # Free allocated memory sys_free_string(sv_members) sys_free_string(sv_hpat_ids) # # It can be found that list showing "Point 1:8 Solid 1" after the creation of the solid

@ @ @

@ @ @

@

@ @ @

Main Index

80 PCL Reference Manual Examples
Group Menu

#---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 81
Viewport Menu

Viewport Menu
This section contains examples of functions that are used to create, delete, modify and retrieve the settings of named viewports.
ga_viewport_axis_get

()

# # Purpose : This file provides an example of two calls # to the function ga_viewport_axis_get() # # This file opens a new database and gets the # flag for axis display. Later it sets the # axis display and gets the flag again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_axis_get() # has the following arguments: # # ga_viewport_axis_get # ( viewport_name, # axis_display ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] INTEGER i_axis_display INTEGER i_axis_display_s INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # s_viewport_name = "default_viewport". s_viewport_name = "default_viewport" # Get the axis display flag. i_return_value = ga_viewport_axis_get ( s_viewport_name, i_axis_display ) dump i_return_value # The axis display flag is dump i_axis_display IF( i_axis_display == 1) THEN i_axis_display_s = 0 ELSE i_axis_display_s = 1 END IF # Note the change in viewport for the axis display. # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the axis display flag. i_return_value = @ ga_viewport_axis_set @ @ @ @

Main Index

82 PCL Reference Manual Examples
Viewport Menu

s_viewport_name, i_axis_display_s ) dump i_return_value # Get the axis display flag. i_return_value = ga_viewport_axis_get ( s_viewport_name, i_axis_display ) dump i_return_value

(

@

@ @ @

# The axis display flag is dump i_axis_display #---------------------------------------------------------------------

ga_viewport_axis_set

()

# # Purpose : This file provides an example of a call # to the function ga_viewport_axis_set() # # This file opens a new database and gets the # flag for axis display. Later it sets the # axis display and gets the flag again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_axis_set() # has the following arguments: # # ga_viewport_axis_get # ( viewport_name, # axis_display ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] INTEGER i_axis_display INTEGER i_axis_display_g INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # s_viewport_name = "default_viewport". s_viewport_name = "default_viewport" # Get the axis display flag. i_return_value = ga_viewport_axis_get ( s_viewport_name, i_axis_display_g ) dump i_return_value # The axis display flag is dump i_axis_display_g IF( i_axis_display_g == 1) THEN i_axis_display = 0 ELSE i_axis_display = 1 END IF @ @ @

Main Index

Chapter 2: Basic Functions 83
Viewport Menu

# Note the change in viewport for the axis display. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the axis display flag. i_return_value = ga_viewport_axis_set ( s_viewport_name, i_axis_display ) dump i_return_value # Get the axis display flag. i_return_value = ga_viewport_axis_get ( s_viewport_name, i_axis_display_g ) dump i_return_value @ @ @

@ @ @

# The axis display flag is dump i_axis_display_g #---------------------------------------------------------------------

ga_viewport_background_get

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_background_get() # # This file opens a new database "new.db" and # gets the background color of the viewport. # Later it sets the background color and gets # color. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_background_get() # has the following arguments: # # ga_viewport_background_get # ( viewport_name, # background_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] INTEGER i_background_color INTEGER i_background_color_s INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_viewport_name = "default_viewport" # Get the background color of the viewport. i_return_value = ga_viewport_background_get ( s_viewport_name, i_background_color ) dump i_return_value dump i_background_color IF ( i_background_color == 4 ) THEN @ @ @

Main Index

84 PCL Reference Manual Examples
Viewport Menu

i_background_color_s = 8 ELSE i_background_color_s = 4 END IF # Set the background color of the viewport. i_return_value = ga_viewport_background_set ( s_viewport_name, i_background_color_s ) dump i_return_value @ @ @

# Get the background color of the viewport. i_return_value = @ ga_viewport_background_get @ ( s_viewport_name, @ i_background_color ) dump i_return_value dump i_background_color #---------------------------------------------------------------------

ga_viewport_background_set

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_background_set() # # This file opens a new database "new.db" and # gets the background color of the viewport. # Later it sets the background color and gets # color. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_background_set() # has the following arguments: # # ga_viewport_background_set # ( viewport_name, # background_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] INTEGER i_background_color INTEGER i_background_color_g INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_viewport_name = "default_viewport" # Get the background color of the viewport. i_return_value = ga_viewport_background_get ( s_viewport_name, i_background_color_g ) dump i_return_value dump i_background_color_g IF ( i_background_color_g == 4 ) THEN i_background_color = 8 @ @ @

Main Index

Chapter 2: Basic Functions 85
Viewport Menu

ELSE i_background_color = 4 END IF # Set the background color of the viewport. i_return_value = ga_viewport_background_set ( s_viewport_name, i_background_color ) dump i_return_value @ @ @

# Get the background color of the viewport. i_return_value = @ ga_viewport_background_get @ ( s_viewport_name, @ i_background_color_g ) dump i_return_value dump i_background_color_g #---------------------------------------------------------------------

ga_viewport_create

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_create() # # This file opens a new database and creates # a new viewport in addition to the existing # "default_viewport". The created new viewport # is visible on the screen. The count of the # viewports before and after creation is done. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_create() # has the following arguments: # # ga_viewport_create # ( viewport_name, # x_location, # y_location, # width, # height ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_number_of_viewports INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # # Create a new viewport with x,y location (6.5,6.5),width 4.5 and # height 3.5. s_viewport_name = "new_viewport" r_x_location = 6.5 r_y_location = 6.5 r_width = 4.5

Main Index

86 PCL Reference Manual Examples
Viewport Menu

r_height = 3.5 # Count the number of view ports in the database. i_return_value = @ ga_viewport_nviewports_get @ ( i_number_of_viewports ) dump i_return_value dump i_number_of_viewports i_return_value = ga_viewport_create ( s_viewport_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value @ @ @ @ @ @

# Count the number of view ports in the database. i_return_value = @ ga_viewport_nviewports_get @ ( i_number_of_viewports ) dump i_return_value dump i_number_of_viewports # Note the increase in count by 1 due to newly created viewport. #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 87
Viewport Menu

ga_viewport_current_get

()

# # Purpose : This file provides an example of two calls to # the function ga_viewport_current_get() # # This file opens the existing database "view.db" # which has three viewports.This file gets the # current viewport and later sets the current # viewport to a different viewport and finally # gets the current viewport. # # Before running this session file run view.ses # to create view.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_current_get() # has the following arguments: # # ga_viewport_current_get # ( viewport_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_viewport_name_s[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") # Get the current viewport. i_return_value = ga_viewport_current_get ( s_viewport_name ) dump i_return_value dump s_viewport_name IF ( s_viewport_name == "view1" ) THEN s_viewport_name_s = "view2" ELSE s_viewport_name_s = "view1" END IF # The change of viewport can be noticed in the Viewport/Modify # form in the current viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the current viewport. i_return_value = ga_viewport_current_set ( s_viewport_name_s ) dump i_return_value # Get the current viewport. i_return_value = ga_viewport_current_get ( s_viewport_name ) dump i_return_value dump s_viewport_name @ @ @ @

@ @

Main Index

88 PCL Reference Manual Examples
Viewport Menu

#---------------------------------------------------------------------

ga_viewport_current_set

()

# # Purpose : This file provides an example of a call to # the function ga_viewport_current_set() # # This file opens the existing database "view.db" # which has three viewports.This file gets the # current viewport and later sets the current # viewport to a different viewport and finally # gets the current viewport. # # Before running this session file run view.ses # to create view.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_current_set() # has the following arguments: # # ga_viewport_current_set # ( viewport_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_viewport_name_g[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") # Get the current viewport. i_return_value = ga_viewport_current_get ( s_viewport_name_g ) dump i_return_value dump s_viewport_name_g IF ( s_viewport_name_g == "view1" ) THEN s_viewport_name = "view2" ELSE s_viewport_name = "view1" END IF # The change of viewport can be noticed in the Viewport/Modify # form in the current viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the current viewport. i_return_value = ga_viewport_current_set ( s_viewport_name ) dump i_return_value # Get the current viewport. i_return_value = ga_viewport_current_get ( s_viewport_name_g ) dump i_return_value dump s_viewport_name_g @ @ @ @

@ @

Main Index

Chapter 2: Basic Functions 89
Viewport Menu

#---------------------------------------------------------------------

ga_viewport_delete

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_delete() # # This file opens a new database and creates # a new viewport in addition to the existing # "default_viewport". Later it counts the # number of viewports in the database before # and after deleting the view port. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_delete() # has the following arguments: # # ga_viewport_delete # ( viewport_name ) #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_number_of_viewports INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new viewport with x,y location (6.5,6.5),width 4.5 and # height 3.5. s_viewport_name = "new_viewport" r_x_location = 6.5 r_y_location = 6.5 r_width = 4.5 r_height = 3.5 i_return_value = ga_viewport_create ( s_viewport_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value @ @ @ @ @ @

# Count the number of view ports in the database. i_return_value = @ ga_viewport_nviewports_get @ ( i_number_of_viewports ) dump i_number_of_viewports # Session file paused. Press "Resume" to continue.. # Note that the new viewport will be deleted when session file # is resumed. sf_pause() # Delete the newly created viewport.

Main Index

90 PCL Reference Manual Examples
Viewport Menu

i_return_value = ga_viewport_delete ( s_viewport_name ) dump i_return_value

@ @

# Count the number of view ports in the database. i_return_value = @ ga_viewport_nviewports_get @ ( i_number_of_viewports ) dump i_number_of_viewports # Note the count has decreased by 1 in comparison with the # earlier count. #---------------------------------------------------------------------

ga_viewport_exist_get

()

# # Purpose : This file provides an example of two calls to # the function ga_viewport_exist_get() # # This file opens an existing database "view.db" # which has three viewports.Later it checks # for existance of an existing and a non-existing # viewport. # # Before running this session file run view.ses # to create view.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_exist_get() # has the following arguments: # # ga_viewport_exist_get # ( viewport_name, # existance_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] INTEGER i_existance_flag INTEGER i_return_value #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") # Check for the existant viewport. s_viewport_name = "view1" i_return_value = ga_viewport_exist_get ( s_viewport_name, i_existance_flag ) dump i_return_value dump i_existance_flag # Check for the non-existant viewport. s_viewport_name = "no_view" i_return_value = ga_viewport_exist_get ( s_viewport_name, i_existance_flag ) dump i_return_value dump i_existance_flag

@ @ @

@ @ @

Main Index

Chapter 2: Basic Functions 91
Viewport Menu

#---------------------------------------------------------------------

ga_viewport_group_post

()

#--------------------------------------------------------------------# Purpose : This file provides an example of a call to the # function ga_viewport_group_post() # # This file opens a existing database "view.db" # which has three groups.It posts the group # "new1_group" which contains a square surface # on the default_viewport.Later it unposts this # group. # # Before running this session file run view.ses # to create view.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_group_post() # has the following arguments: # # ga_viewport_group_post # ( viewport_name, # group_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_group_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") # Post the default_viewport s_viewport_name = "default_viewport" i_return_value = ga_viewport_post ( s_viewport_name ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Post the group "new1_group" to the "default_viewport" which # contains only "default_group". s_group_name = "new1_group" i_return_value = @ ga_viewport_group_post @ ( s_viewport_name, @ s_group_name ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() # Unpost the group "new1_group" from the "default_viewport" which # contains "default_group" and "new1_group". i_return_value = @ ga_viewport_group_unpost @ ( s_viewport_name, @ s_group_name ) dump i_return_value

Main Index

92 PCL Reference Manual Examples
Viewport Menu

#---------------------------------------------------------------------

ga_viewport_group_post_all

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_group_post_all() # # This file opens an existing database "view.db" # which has three groups.It posts all the groups # to the default viewport.Later it unposts all # the groups from the default viewport.Finally # it posts the default group to the viewport. # # Before running this session file run view.ses # to create view.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_group_post_all() # has the following arguments: # # ga_viewport_group_post_all # ( viewport_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") # Post the default viewport which contains just the default group. s_viewport_name = "default_viewport" i_return_value = @ ga_viewport_post @ ( s_viewport_name ) dump i_return_value # Post all the groups to the default viewport. # Session file paused. Press "Resume" to continue.. sf_pause() i_return_value = @ ga_viewport_group_post_all @ ( s_viewport_name ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() # Unpost all the groups from the default viewport. i_return_value = @ ga_viewport_group_unpost_all @ ( s_viewport_name ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() # Post the default group to the default viewport. i_return_value = @

Main Index

Chapter 2: Basic Functions 93
Viewport Menu

ga_viewport_group_post @ ( s_viewport_name, @ "default_group" ) dump i_return_value #---------------------------------------------------------------------

ga_viewport_group_unpost

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_group_unpost() # # This file opens a existing database "view.db" # which has three groups.It posts the group # "new1_group" which contains a square surface # on the default_viewport.Later it unposts this # group. # # Before running this session file run view.ses # to create view.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_group_unpost() # has the following arguments: # # ga_viewport_group_unpost # ( viewport_name, # group_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_group_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") # Post the default_viewport s_viewport_name = "default_viewport" i_return_value = ga_viewport_post ( s_viewport_name ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Post the group "new1_group" to the "default_viewport" which # contains only "default_group". s_group_name = "new1_group" i_return_value = @ ga_viewport_group_post @ ( s_viewport_name, @ s_group_name ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() # Unpost the group "new1_group" from the "default_viewport" which # contains "default_group" and "new1_group". i_return_value = @

Main Index

94 PCL Reference Manual Examples
Viewport Menu

ga_viewport_group_unpost @ ( s_viewport_name, @ s_group_name ) dump i_return_value #---------------------------------------------------------------------

ga_viewport_group_unpost_all

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_group_unpost_all() # # This file opens an existing database "view.db" # which has three groups.It posts all the groups # to the default viewport.Later it unposts all # the groups from the default viewport.Finally # it posts the default group to the viewport. # # Before running this session file run view.ses # to create view.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_group_unpost_all() # has the following arguments: # # ga_viewport_group_unpost_all # ( viewport_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") # Post the default viewport which contains just the default group. s_viewport_name = "default_viewport" i_return_value = @ ga_viewport_post @ ( s_viewport_name ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() # Post all the groups to the default viewport. i_return_value = @ ga_viewport_group_post_all @ ( s_viewport_name ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() # Unpost all the groups from the default viewport. i_return_value = @ ga_viewport_group_unpost_all @ ( s_viewport_name ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() # Post the default group to the default viewport. i_return_value = @

Main Index

Chapter 2: Basic Functions 95
Viewport Menu

ga_viewport_group_post @ ( s_viewport_name, @ "default_group" ) dump i_return_value #---------------------------------------------------------------------

ga_viewport_groups_get

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_groups_get() # # This file opens a new database "new.db" and # gets the count of groups in the default # viewport. Later it gets the groups. The new # database has "default_group" as the only # group in the "default_viewport". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_groups_get() # has the following arguments: # # ga_viewport_groups_get # ( viewport_name, # number_of_groups ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING sa_group_list[32](VIRTUAL) INTEGER i_number_of_groups INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # i_return_value = @ ga_viewport_ngroups_get @ ( s_viewport_name, @ i_number_of_groups ) dump i_return_value # The number of groups are dump i_number_of_groups SYS_ALLOCATE_ARRAY(sa_group_list,1,i_number_of_groups) i_return_value = ga_viewport_groups_get ( s_viewport_name, sa_group_list ) dump i_return_value # The list of groups are dump sa_group_list @ @ @

SYS_FREE_ARRAY(sa_group_list) #---------------------------------------------------------------------

ga_viewport_light_post
#

()

Main Index

96 PCL Reference Manual Examples
Viewport Menu

# Purpose : This file provides an example of two calls # to the function ga_viewport_light_post() # # This file opens a new database "new.db" and # creates a surface. It posts the light "ambient" # and "directional_1" to the viewport. It gets # the lights posted before and after posting. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_light_post() # has the following arguments: # # ga_viewport_light_post # ( viewport_name, # light ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_light[32] INTEGER i_number_of_lights STRING sa_light_list[32](2) STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface. asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0",sv_asm_create_patch_xy_created) s_viewport_name = "default_viewport" # Get the number of posted viewports. i_return_value = ga_viewport_nlights_get ( s_viewport_name, i_number_of_lights ) dump i_return_value dump i_number_of_lights # Post the ambient light. s_light = "ambient" i_return_value = ga_viewport_light_post ( s_viewport_name, s_light ) dump i_return_value # Post the "directional_1" light. s_light = "directional_1" i_return_value = ga_viewport_light_post ( s_viewport_name, s_light ) dump i_return_value # Get the number of posted lights. i_return_value = ga_viewport_nlights_get ( s_viewport_name, i_number_of_lights ) @ @ @ @

@ @ @

@ @ @

@ @ @

Main Index

Chapter 2: Basic Functions 97
Viewport Menu

dump i_return_value dump i_number_of_lights # Get the posted lights. i_return_value = ga_viewport_lights_get ( s_viewport_name, sa_light_list ) dump i_return_value dump sa_light_list @ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_viewport_light_unpost

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_light_unpost() # # This file opens a new database "new.db" and # creates a surface. It posts the light "ambient" # and "directional_1" to the viewport. Then it # unposts the "directional_1" light.It gets # the lights posted before and after unposting. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_light_unpost() # has the following arguments: # # ga_viewport_light_unpost # ( viewport_name, # light ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_light[32] INTEGER i_number_of_lights STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface. asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0",sv_asm_create_patch_xy_created) s_viewport_name = "default_viewport" # Post the ambient light. s_light = "ambient" i_return_value = ga_viewport_light_post ( s_viewport_name, s_light ) dump i_return_value # Post the "directional_1" light. s_light = "directional_1" i_return_value = @

@ @ @

@

Main Index

98 PCL Reference Manual Examples
Viewport Menu

ga_viewport_light_post ( s_viewport_name, s_light ) dump i_return_value # Get the number of posted viewports. i_return_value = ga_viewport_nlights_get ( s_viewport_name, i_number_of_lights ) dump i_return_value dump i_number_of_lights # Unpost the "directional_1" light. s_light = "directional_1" i_return_value = ga_viewport_light_unpost ( s_viewport_name, s_light ) dump i_return_value # Get the number of posted viewports. i_return_value = ga_viewport_nlights_get ( s_viewport_name, i_number_of_lights ) dump i_return_value dump i_number_of_lights

@ @

@ @ @

@ @ @

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_viewport_lights_get

()

# # Purpose : This file provides an example of two calls # to the function ga_viewport_lights_get() # # This file opens a new database "new.db" and # creates a surface. It posts the light "ambient" # and "directional_1" to the viewport. It gets # the lights posted before and after posting. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_lights_post() # has the following arguments: # # ga_viewport_lights_get # ( viewport_name, # light_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_light[32] INTEGER i_number_of_lights STRING sa_light_list[32](2) STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

Chapter 2: Basic Functions 99
Viewport Menu

# Create a surface. asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0",sv_asm_create_patch_xy_created) s_viewport_name = "default_viewport" # Get the number of posted viewports. i_return_value = ga_viewport_nlights_get ( s_viewport_name, i_number_of_lights ) dump i_return_value dump i_number_of_lights # Post the ambient light. s_light = "ambient" i_return_value = ga_viewport_light_post ( s_viewport_name, s_light ) dump i_return_value # Post the "directional_1" light. s_light = "directional_1" i_return_value = ga_viewport_light_post ( s_viewport_name, s_light ) dump i_return_value # Get the number of posted lights. i_return_value = ga_viewport_nlights_get ( s_viewport_name, i_number_of_lights ) dump i_return_value dump i_number_of_lights # Get the posted lights. i_return_value = ga_viewport_lights_get ( s_viewport_name, sa_light_list ) dump i_return_value dump sa_light_list

@

@ @ @

@ @ @

@ @ @

@ @ @

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_viewport_location_get
# # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_viewport_location_get() This file opens a new database "new.db"and gets the location of the default viewport. Later it changes the location of the viewport and gets the location. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_viewport_location_get()

Main Index

100 PCL Reference Manual Examples
Viewport Menu

# has the following arguments: # # ga_viewport_location_get # ( viewport_name, # x, # y ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] REAL r_x REAL r_y REAL r_x_s REAL r_y_s INTEGER i_update_control INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_viewport_name = "default_viewport" i_update_control = 1 # Get the location of the viewport. i_return_value = ga_viewport_location_get ( s_viewport_name, r_x, r_y ) dump i_return_value dump r_x dump r_y # Set the location of the viewport. r_x_s = r_x + 1.0 r_y_s = r_y + 1.0 i_return_value = ga_viewport_location_set ( s_viewport_name, r_x_s, r_y_s, i_update_control ) dump i_return_value @ @ @ @

@ @ @ @ @

# Get the location of the viewport. i_return_value = @ ga_viewport_location_get @ ( s_viewport_name, @ r_x, @ r_y ) dump i_return_value dump r_x dump r_y # Note the change of location of viewport on the screen. #---------------------------------------------------------------------

ga_viewport_location_set
# # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_viewport_location_set() This file opens a new database "new.db"and gets the location of the default viewport. Later it changes the location of the viewport

Main Index

Chapter 2: Basic Functions 101
Viewport Menu

# get the location. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_location_set() # has the following arguments: # # ga_viewport_location_set # ( viewport_name, # x, # y, # update_control ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] REAL r_x REAL r_y REAL r_x_g REAL r_y_g INTEGER i_update_control INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_viewport_name = "default_viewport" i_update_control = 1 # Get the location of the viewport. i_return_value = ga_viewport_location_get ( s_viewport_name, r_x_g, r_y_g ) dump i_return_value dump r_x_g dump r_y_g # Set the location of the viewport. r_x = r_x_g + 1.0 r_y = r_y_g + 1.0 i_return_value = ga_viewport_location_set ( s_viewport_name, r_x, r_y, i_update_control ) dump i_return_value @ @ @ @

@ @ @ @ @

# Get the location of the viewport. i_return_value = @ ga_viewport_location_get @ ( s_viewport_name, @ r_x_g, @ r_y_g ) dump i_return_value dump r_x_g dump r_y_g # Note the change of location of viewport on the screen. #---------------------------------------------------------------------

Main Index

102 PCL Reference Manual Examples
Viewport Menu

ga_viewport_ngroups_get

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_ngroups_get() # # This file opens a new database "new.db" and # gets the count of groups in the default # viewport. Later it gets the groups. The new # database has "default_group" as the only # group in the "default_viewport". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_ngroups_get() # has the following arguments: # # ga_viewport_ngroups_get # ( viewport_name, # number_of_groups ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING sa_group_list[32](VIRTUAL) INTEGER i_number_of_groups INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # i_return_value = @ ga_viewport_ngroups_get @ ( s_viewport_name, @ i_number_of_groups ) dump i_return_value # The number of groups are dump i_number_of_groups SYS_ALLOCATE_ARRAY(sa_group_list,1,i_number_of_groups) i_return_value = ga_viewport_groups_get ( s_viewport_name, sa_group_list ) dump i_return_value # The list of groups are dump sa_group_list @ @ @

SYS_FREE_ARRAY(sa_group_list) #---------------------------------------------------------------------

ga_viewport_nlights_get
# # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_viewport_nlights_get() This file opens a new database "new.db" and

Main Index

Chapter 2: Basic Functions 103
Viewport Menu

# creates a surface. It posts the light "ambient" # and "directional_1" to the viewport. It gets # the lights posted before and after posting. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_nlights_get() # has the following arguments: # # ga_viewport_nlights_get # ( viewport_name, # number_of_lights ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_light[32] INTEGER i_number_of_lights STRING sa_light_list[32](2) STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface. asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0",sv_asm_create_patch_xy_created) s_viewport_name = "default_viewport" # Get the number of posted viewports. i_return_value = ga_viewport_nlights_get ( s_viewport_name, i_number_of_lights ) dump i_return_value dump i_number_of_lights # Post the ambient light. s_light = "ambient" i_return_value = ga_viewport_light_post ( s_viewport_name, s_light ) dump i_return_value # Post the "directional_1" light. s_light = "directional_1" i_return_value = ga_viewport_light_post ( s_viewport_name, s_light ) dump i_return_value # Get the number of posted lights. i_return_value = ga_viewport_nlights_get ( s_viewport_name, i_number_of_lights ) dump i_return_value dump i_number_of_lights # Get the posted lights. @ @ @ @

@ @ @

@ @ @

@ @ @

Main Index

104 PCL Reference Manual Examples
Viewport Menu

i_return_value = ga_viewport_lights_get ( s_viewport_name, sa_light_list ) dump i_return_value dump sa_light_list

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_viewport_nposted_get

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_nposted_get() # # This file opens an existing database "view.db" # which has three viewports.Later it gets the # number and the list of posted viewports.Finally # it unposts one of the viewport and gets the # number and the list of posted viewports. # # Before running this session file run view.ses # to create view.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_nposted_get() # has the following arguments: # # ga_viewport_nposted_get # ( number_of_viewports ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_number_of_viewports STRING sa_viewport_list[32](3) INTEGER i_return_value #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") # Get the number of viewports marked as posted. i_return_value = @ ga_viewport_nposted_get @ ( i_number_of_viewports ) dump i_return_value # Number of viewports marked as posted. dump i_number_of_viewports # Get the list of posted viewports. i_return_value = ga_viewport_posted_get ( sa_viewport_list ) dump i_return_value # The list of posted view ports. dump sa_viewport_list # Unpost the viewport "view2". i_return_value = ga_viewport_unpost ( "view2" ) dump i_return_value @ @

@ @

Main Index

Chapter 2: Basic Functions 105
Viewport Menu

# Get the number of viewports marked as posted. i_return_value = @ ga_viewport_nposted_get @ ( i_number_of_viewports ) dump i_return_value # Number of viewports marked as posted. dump i_number_of_viewports sa_viewport_list(1) = "" sa_viewport_list(2) = "" sa_viewport_list(3) = "" # Get the list of posted viewports. i_return_value = @ ga_viewport_posted_get @ ( sa_viewport_list ) dump i_return_value # The list of posted view ports. dump sa_viewport_list #--------------------------------------------------------------------ga_viewport_nviewports_get

()

# # Purpose : This file provides an example of two calls # to the function ga_viewport_nviewports_get() # # This file opens a new database and creates # a new viewport in addition to the existing # "default_viewport". The created new viewport # is visible on the screen. The count of the # viewports before and after creation is done. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_nviewports_get() # has the following arguments: # # ga_viewport_nviewports_get # ( number_of_viewports ) #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_number_of_viewports INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # # Create a new viewport with x,y location (6.5,6.5),width 4.5 and # height 3.5. s_viewport_name = "new_viewport" r_x_location = 6.5 r_y_location = 6.5 r_width = 4.5

Main Index

106 PCL Reference Manual Examples
Viewport Menu

r_height = 3.5 # Count the number of view ports in the database. i_return_value = @ ga_viewport_nviewports_get @ ( i_number_of_viewports ) dump i_return_value dump i_number_of_viewports i_return_value = ga_viewport_create ( s_viewport_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value @ @ @ @ @ @

# Count the number of view ports in the database. i_return_value = @ ga_viewport_nviewports_get @ ( i_number_of_viewports ) dump i_return_value dump i_number_of_viewports # Note the increase in count by 1 due to newly created viewport. #---------------------------------------------------------------------

ga_viewport_origin_get

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_origin_get() # # This file opens a new database and gets the # flag for origin display. Later it sets the # origin display and gets the flag again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_origin_get() # has the following arguments: # # ga_viewport_origin_get # ( viewport_name, # origin_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] INTEGER i_origin_status INTEGER i_origin_status_s INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # s_viewport_name = "default_viewport". s_viewport_name = "default_viewport" # Get the origin display flag. i_return_value = ga_viewport_origin_get @ @

Main Index

Chapter 2: Basic Functions 107
Viewport Menu

s_viewport_name, i_origin_status ) dump i_return_value # The origin display flag is dump i_origin_status IF( i_origin_status == 1) THEN i_origin_status_s = 0 ELSE i_origin_status_s = 1 END IF

(

@

# Note the change in viewport for the origin display. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the axis display flag. i_return_value = ga_viewport_origin_set ( s_viewport_name, i_origin_status_s ) dump i_return_value # Get the origin display flag. i_return_value = ga_viewport_origin_get ( s_viewport_name, i_origin_status ) dump i_return_value @ @ @

@ @ @

# The origin display flag is dump i_origin_status #---------------------------------------------------------------------

ga_viewport_origin_set

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_origin_set() # # This file opens a new database and gets the # flag for origin display. Later it sets the # origin display and gets the flag again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_origin_set() # has the following arguments: # # ga_viewport_origin_set # ( viewport_name, # origin_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] INTEGER i_origin_status INTEGER i_origin_status_g INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db")

Main Index

108 PCL Reference Manual Examples
Viewport Menu

$? YES 36000002 # s_viewport_name = "default_viewport". s_viewport_name = "default_viewport" # Get the origin display flag. i_return_value = ga_viewport_origin_get ( s_viewport_name, i_origin_status_g ) dump i_return_value # The origin display flag is dump i_origin_status_g IF( i_origin_status_g == 1) THEN i_origin_status = 0 ELSE i_origin_status = 1 END IF # Note the change in viewport for the origin display. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the axis display flag. i_return_value = ga_viewport_origin_set ( s_viewport_name, i_origin_status ) dump i_return_value # Get the origin display flag. i_return_value = ga_viewport_origin_get ( s_viewport_name, i_origin_status_g ) dump i_return_value @ @ @ @ @ @

@ @ @

# The origin display flag is dump i_origin_status_g #---------------------------------------------------------------------

ga_viewport_post

()

# # Purpose : This file provides an example of a call # to the function ga_viewport_post() # # This file opens a new database "new.db" and # and creates a viewport "new_viewport". Later # it unposts the viewport and finally posts it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_post() # has the following arguments: # # ga_viewport_post # ( viewport_name ) # #--------------------------------------------------------------------# Variable Declarations

Main Index

Chapter 2: Basic Functions 109
Viewport Menu

STRING s_viewport_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new viewport s_viewport_name = "new_viewport" r_x_location = 6.5 r_y_location = 6.5 r_width = 4.5 r_height = 3.5 i_return_value = ga_viewport_create ( s_viewport_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Unpost the viewport "new_viewport" i_return_value = ga_viewport_unpost ( s_viewport_name ) dump i_return_value @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Post the viewport "new_view" i_return_value = @ ga_viewport_post @ ( s_viewport_name ) dump i_return_value #---------------------------------------------------------------------

ga_viewport_posted_get
# # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_viewport_posted_get() This file opens an existing database "view.db" which has three viewports.Later it gets the number and the list of posted viewports.Finally it unposts one of the viewport and gets the number and the list of posted viewports. Before running this session file run view.ses to create view.db This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_viewport_posted_get()

Main Index

110 PCL Reference Manual Examples
Viewport Menu

# has the following arguments: # # ga_viewport_posted_get # ( viewport_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_number_of_viewports STRING sa_viewport_list[32](3) INTEGER i_return_value #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") # Get the number of viewports marked as posted. i_return_value = @ ga_viewport_nposted_get @ ( i_number_of_viewports ) dump i_return_value # Number of viewports marked as posted. dump i_number_of_viewports # Get the list of posted viewports. i_return_value = ga_viewport_posted_get ( sa_viewport_list ) dump i_return_value # The list of posted view ports. dump sa_viewport_list # Unpost the viewport "view2". i_return_value = ga_viewport_unpost ( "view2" ) dump i_return_value @ @

@ @

# Get the number of viewports marked as posted. i_return_value = @ ga_viewport_nposted_get @ ( i_number_of_viewports ) dump i_return_value # Number of viewports marked as posted. dump i_number_of_viewports sa_viewport_list(1) = "" sa_viewport_list(2) = "" sa_viewport_list(3) = "" # Get the list of posted viewports. i_return_value = @ ga_viewport_posted_get @ ( sa_viewport_list ) dump i_return_value # The list of posted view ports. dump sa_viewport_list #---------------------------------------------------------------------

ga_viewport_range_get
# # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_viewport_range_get() This file opens a new database "new.db" and gets the name of the range used for displaying the results posted to the viewport. Later it creates a new range and sets this range to the

Main Index

Chapter 2: Basic Functions 111
Viewport Menu

# viewport. Finally it again gets the name # of the range. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_range_get() # has the following arguments: # # ga_viewport_range_get # ( viewport_list, # range ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_range[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_viewport_name = "default_viewport" # Get the name of the range. i_return_value = ga_viewport_range_get ( s_viewport_name, s_range ) dump i_return_value dump s_range # Create a new range. i_return_value = ga_range_create ( "new_range", 10 ) dump i_return_value

@ @ @

@ @ @

# Set the range "new_range" to "default_viewport". i_return_value = @ ga_viewport_range_set @ ( s_viewport_name, @ "new_range" ) dump i_return_value # Get the name of the range. i_return_value = @ ga_viewport_range_get @ ( s_viewport_name, @ s_range ) dump i_return_value dump s_range #---------------------------------------------------------------------

ga_viewport_range_set
# # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_viewport_range_set() This file opens a new database "new.db" and gets the name of the range used for displaying the results posted to the viewport. Later it creates a new range and sets this range to the

Main Index

112 PCL Reference Manual Examples
Viewport Menu

# viewport. Finally it again gets the name # of the range. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_range_set() # has the following arguments: # # ga_viewport_range_set # ( viewport_list, # range ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_range_g[32] STRING s_range[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_viewport_name = "default_viewport" # Get the name of the range. i_return_value = ga_viewport_range_get ( s_viewport_name, s_range_g ) dump i_return_value dump s_range_g # Create a new range. s_range = "new_range" i_return_value = ga_range_create ( s_range, 10 ) dump i_return_value # Set the name of the range to new_range. i_return_value = ga_viewport_range_set ( s_viewport_name, s_range ) dump i_return_value

@ @ @

@ @ @

@ @ @

# Get the name of the range. i_return_value = @ ga_viewport_range_get @ ( s_viewport_name, @ s_range_g ) dump i_return_value dump s_range_g #---------------------------------------------------------------------

ga_viewport_rename
# # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_viewport_rename() This file opens a new database "new.db" and gets the viewport name. Later it renames the

Main Index

Chapter 2: Basic Functions 113
Viewport Menu

# viewport and gets the changed name. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_rename() # has the following arguments: # # ga_viewport_rename # ( original_name, # new_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_original_name[32] STRING s_new_name[32] STRING sa_viewport_list[32](1) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Get the name of the viewport. i_return_value = ga_viewport_viewports_get ( sa_viewport_list ) dump i_return_value # The name of the viewport before renaming. dump sa_viewport_list s_original_name = sa_viewport_list(1) # Rename the viewport. s_new_name = "renamed_viewport" i_return_value = ga_viewport_rename ( s_original_name, s_new_name ) dump i_return_value @ @

@ @ @

# Get the name of the viewport. i_return_value = @ ga_viewport_viewports_get @ ( sa_viewport_list ) dump i_return_value # The name of the viewport after renaming. dump sa_viewport_list #---------------------------------------------------------------------

ga_viewport_size_get
# # # # # # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_viewport_size_get() This file opens a new database "new.db" and gets the size of the default viewport. Later it resizes the viewport to half its size and gets the size. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown

Main Index

114 PCL Reference Manual Examples
Viewport Menu

# menus on the menu bar. # # The function ga_viewport_size_get() # has the following arguments: # # ga_viewport_size_get # ( viewport_name, # width, # height ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] REAL r_width REAL r_height REAL r_width_s REAL r_height_s INTEGER i_update_control INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_viewport_name = "default_viewport" i_update_control = 1 # Get the viewport size. i_return_value = ga_viewport_size_get ( s_viewport_name, r_width, r_height ) dump i_return_value # The viewport sizes are dump r_width dump r_height @ @ @ @

# Set the viewport size to half of the original size. r_width_s = r_width/2 r_height_s = r_height/2 i_return_value = @ ga_viewport_size_set @ ( s_viewport_name, @ r_width_s, @ r_height_s, @ i_update_control ) dump i_return_value # Get the viewport size. i_return_value = @ ga_viewport_size_get @ ( s_viewport_name, @ r_width, @ r_height ) dump i_return_value # The viewport sizes are dump r_width dump r_height #---------------------------------------------------------------------

ga_viewport_size_set
# # # #

()

Purpose

:

This file provides an example of a call to the function ga_viewport_size_set()

Main Index

Chapter 2: Basic Functions 115
Viewport Menu

# This file opens a new database "new.db" and # gets the size of the default viewport. Later # it resizes the viewport to half its size and # gets the size. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_size_set() # has the following arguments: # # ga_viewport_size_set # ( viewport_name, # width, # height, # update_control ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] REAL r_width REAL r_height REAL r_width_g REAL r_height_g INTEGER i_update_control INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_viewport_name = "default_viewport" i_update_control = 1 # Get the viewport size. i_return_value = ga_viewport_size_get ( s_viewport_name, r_width_g, r_height_g ) dump i_return_value # The viewport sizes are dump r_width_g dump r_height_g @ @ @ @

# Set the viewport size to half of the original size. r_width = r_width_g/2 r_height = r_height_g/2 i_return_value = @ ga_viewport_size_set @ ( s_viewport_name, @ r_width, @ r_height, @ i_update_control ) dump i_return_value # Get the viewport size. i_return_value = ga_viewport_size_get ( s_viewport_name, r_width_g, r_height_g ) dump i_return_value # The viewport sizes are dump r_width_g dump r_height_g @ @ @ @

Main Index

116 PCL Reference Manual Examples
Viewport Menu

#---------------------------------------------------------------------

ga_viewport_spectrum_get

()

# # Purpose : This file provides an example of two calls # to the function ga_viewport_spectrum_get() # # This file opens a new database "new.db" and # gets the posting status of the spectrum to # the viewport. Later it changes the posting # status and finally gets the status. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_spectrum_get() # has the following arguments: # # ga_viewport_spectrum_get # ( viewport_name, # spectrum_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] INTEGER i_spectrum_status INTEGER i_spectrum_status_s INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # # Get the spectrum status. i_return_value = @ ga_viewport_spectrum_get @ ( s_viewport_name, @ i_spectrum_status ) dump i_return_value dump i_spectrum_status IF ( i_spectrum_status == 0 ) THEN i_spectrum_status_s = 1 ELSE i_spectrum_status_s = 0 END IF # Session file paused. Press "Resume" to continue.. # Note the change of spectrum status on the viewport after # resuming the session file. sf_pause() # Set the spectrum status. i_return_value = ga_viewport_spectrum_set ( s_viewport_name, i_spectrum_status_s ) dump i_return_value # Get the spectrum status. i_return_value = ga_viewport_spectrum_get ( s_viewport_name, @ @ @

@ @ @

Main Index

Chapter 2: Basic Functions 117
Viewport Menu

i_spectrum_status ) dump i_return_value dump i_spectrum_status #---------------------------------------------------------------------

ga_viewport_spectrum_set

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_spectrum_set() # # This file opens a new database "new.db" and # gets the posting status of the spectrum to # the viewport. Later it changes the posting # status and finally gets the status. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_spectrum_set() # has the following arguments: # # ga_viewport_spectrum_set # ( viewport_name, # spectrum_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] INTEGER i_spectrum_status INTEGER i_spectrum_status_g INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # # Get the spectrum status. i_return_value = @ ga_viewport_spectrum_get @ ( s_viewport_name, @ i_spectrum_status_g ) dump i_return_value dump i_spectrum_status_g IF ( i_spectrum_status_g == 0 ) THEN i_spectrum_status = 1 ELSE i_spectrum_status = 0 END IF # Session file paused. Press "Resume" to continue.. # Note the change of spectrum status on the viewport after resuming # the session file. sf_pause() # Set the spectrum status. i_return_value = ga_viewport_spectrum_set ( s_viewport_name, i_spectrum_status ) dump i_return_value # Get the spectrum status. @ @ @

Main Index

118 PCL Reference Manual Examples
Viewport Menu

i_return_value = @ ga_viewport_spectrum_get @ ( s_viewport_name, @ i_spectrum_status_g ) dump i_return_value dump i_spectrum_status_g #---------------------------------------------------------------------

ga_viewport_title_post

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_title_post() # # This file opens a new database "new.db" and # creates the title "VIEWPORT_TITLE" and posts # on the default viewport. Later it unposts # the title. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_title_post() # has the following arguments: # # ga_viewport_title_post # ( viewport_name, # title ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_title[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # s_viewport_name = "default_viewport" s_title = "VIEWPORT_TITLE" i_return_value = ga_title_create ( s_title, 3.0, 5.0, 2, 16 ) dump i_return_value i_return_value = ga_viewport_title_post ( s_viewport_name, s_title ) dump i_return_value @ @ @ @ @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Unpost the title i_return_value = ga_viewport_title_unpost ( s_viewport_name, s_title ) @ @ @

Main Index

Chapter 2: Basic Functions 119
Viewport Menu

dump i_return_value # Note that the tile has been unposted from the viewport. #---------------------------------------------------------------------

ga_viewport_title_unpost

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_title_unpost() # # This file opens a new database "new.db" and # creates the title "VIEWPORT_TITLE" and posts # it on the default viewport. Later it unposts # the title. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_title_unpost() # has the following arguments: # # ga_viewport_title_unpost # ( viewport_name, # title ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_title[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_viewport_name = "default_viewport" s_title = "VIEWPORT_TITLE" i_return_value = ga_title_create ( s_title, 3.0, 5.0, 2, 16 ) dump i_return_value # Post the title. i_return_value = ga_viewport_title_post ( s_viewport_name, s_title ) dump i_return_value @ @ @ @ @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Unpost the title. i_return_value = @ ga_viewport_title_unpost @ ( s_viewport_name, @ s_title ) dump i_return_value # Note that the tile has been unposted from the viewport. #---------------------------------------------------------------------

Main Index

120 PCL Reference Manual Examples
Viewport Menu

Main Index

Chapter 2: Basic Functions 121
Viewport Menu

ga_viewport_unpost

()

# # Purpose : This file provides an example of two calls # to the function ga_viewport_unpost() # # This file opens an existing database "view.db" # which has three viewports. This file unposts # two viewports in succession. # # Before running this session file run view.ses # to create view.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_unpost() # has the following arguments: # # ga_viewport_unpost # ( viewport_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") # Observe the three viewports. # Session file paused. Press "Resume" to continue.. sf_pause() # Unpost the viewport "view2" s_viewport_name = "view2" i_return_value = ga_viewport_unpost ( s_viewport_name ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Unpost the viewport "view1" s_viewport_name = "view1" i_return_value = @ ga_viewport_unpost @ ( s_viewport_name ) dump i_return_value #---------------------------------------------------------------------

Main Index

122 PCL Reference Manual Examples
Viewport Menu

ga_viewport_view_get

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_view_get() # # This file opens a new database "new.db" and # creates a surface and rotates it. Later it # creates a new view and assign the present # viewport view to the new view. Then it sets # the default view to the viewport. Finally it # sets the new view to the viewport. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_view_get() # has the following arguments: # # ga_viewport_view_get # ( viewport_name, # name_of_view ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_name_of_view[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_viewport_name = "default_viewport" s_name_of_view = "new_view" # Create a surface and rotate it. asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", @ "Coord 0", sv_asm_create_patch_xy_created ) ga_view_aa_set( -149.988297, 47.723133, -160.791473 ) # Create a new view. i_return_value = ga_view_create ( s_name_of_view, s_viewport_name ) dump i_return_value @ @ @

# Assign a view name to the current view parameters. i_return_value = @ ga_viewport_view_get @ ( s_viewport_name, @ s_name_of_view ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() # Set the default_view to the viewport. s_name_of_view = "default_view" i_return_value = ga_viewport_view_set

@ @

Main Index

Chapter 2: Basic Functions 123
Viewport Menu

s_viewport_name, s_name_of_view ) dump i_return_value

(

@

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the new_view to the viewport. s_name_of_view = "new_view" i_return_value = ga_viewport_view_set ( s_viewport_name, s_name_of_view ) dump i_return_value

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_viewport_view_name

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_view_name() # # This file opens a new database "new.db" and # gets the name of the view of the default # view port. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_view_name() # has the following arguments: # # ga_viewport_view_name # ( viewport_name, # name_of_view ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_name_of_view[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_viewport_name = "default_viewport" i_return_value = ga_viewport_view_name ( s_viewport_name, s_name_of_view ) dump i_return_value @ @ @

# The name of the view in the viewport is dump s_name_of_view #---------------------------------------------------------------------

Main Index

124 PCL Reference Manual Examples
Viewport Menu

.

ga_viewport_view_set

()

# # Purpose : This file provides an example of two calls # to the function ga_viewport_view_set() # # This file opens a new database "new.db" and # creates a surface and rotates it. Later it # creates a new view and assign the present # viewport view to the new view. Then it sets # the default view to the viewport. Finally it # sets the new view to the viewport. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_view_set() # has the following arguments: # # ga_viewport_view_set # ( viewport_name, # name_of_view ) # #--------------------------------------------------------------------# Variable Declarations STRING s_viewport_name[32] STRING s_name_of_view[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_viewport_name = "default_viewport" s_name_of_view = "new_view" # Create a new view. i_return_value = ga_view_create ( s_name_of_view, s_viewport_name ) dump i_return_value

@ @ @

# Create a surface and rotate it. asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", @ "Coord 0", sv_asm_create_patch_xy_created ) ga_view_aa_set( -149.988297, 47.723133, -160.791473 ) # Assign a view name to the current view parameters. i_return_value = @ ga_viewport_view_get @ ( s_viewport_name, @ s_name_of_view ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() # Set the new_view to the viewport. s_name_of_view = "default_view" i_return_value = ga_viewport_view_set ( s_viewport_name, s_name_of_view )

@ @ @

Main Index

Chapter 2: Basic Functions 125
Viewport Menu

dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() # Set the new_view to the viewport. s_name_of_view = "new_view" i_return_value = @ ga_viewport_view_set @ ( s_viewport_name, @ s_name_of_view ) dump i_return_value SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_viewport_viewports_get

()

# # Purpose : This file provides an example of a call to the # function ga_viewport_viewports_get() # # This file opens a existing database "view.db" # which has three viewports. Later it gets the # number and the list of viewports in the # database. # # Before running this session file run view.ses # to create view.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_viewport_viewports_get() # has the following arguments: # # ga_viewport_viewports_get # ( viewportlist ) # #--------------------------------------------------------------------# Variable Declarations STRING sa_viewportlist[32](VIRTUAL) INTEGER i_number_of_viewports INTEGER i_return_value #--------------------------------------------------------------------# Open the database "view.db" uil_file_open.go("view.db") # Get the number of viewports in the database. i_return_value = ga_viewport_nviewports_get ( i_number_of_viewports ) dump i_return_value dump i_number_of_viewports @ @

SYS_ALLOCATE_ARRAY(sa_viewportlist,1,i_number_of_viewports) # Get the list of viewports. i_return_value = ga_viewport_viewports_get ( sa_viewportlist ) dump i_return_value dump sa_viewportlist SYS_FREE_ARRAY(sa_viewportlist) @ @

Main Index

126 PCL Reference Manual Examples
Viewport Menu

#---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 127
Viewing Menu

Viewing Menu
This section contains examples of functions that are used to create, delete, modify and retrieve the settings of named views stored in the database.
ga_view_aa_get

()

# # Purpose : This file provides an example of a call to the # function ga_view_aa_get() # # This session file will open a new database by # name’new.db’ and will create a solid. The # viewing direction will be changed using # function ’ga_view_aa_set()’ and the direction # will be read back by using function # ’ga_view_aa_get()’. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_aa_get() # has the following arguments: # # ga_view_aa_get # ( name_of_view, # angle_x, # angle_y, # angle_z ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_angle_x REAL r_angle_y REAL r_angle_z INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to along X axis for the current view. r_angle_y = 90 # i_return_value = @ ga_view_aa_set @ ( r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value

Main Index

128 PCL Reference Manual Examples
Viewing Menu

#--------------------------------------------------------------------# Calling function to read rotation around the global model # coordinate system for the current view. # i_return_value = @ ga_view_aa_get @ ( s_name_of_view, @ r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value dump r_angle_x,r_angle_y,r_angle_z sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_aa_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_aa_set() # # This session file will open a new database by # name’new.db’ and will create a solid. The # viewing direction will be changed using # function ’ga_view_aa_set()’ and the direction # will be read back by using function # ’ga_view_aa_get()’. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_aa_set() # has the following arguments: # # ga_view_aa_set # ( angle_x, # angle_y, # angle_z ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_angle_x REAL r_angle_y REAL r_angle_z INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to along X axis for the current view. r_angle_y = 90 #

Main Index

Chapter 2: Basic Functions 129
Viewing Menu

i_return_value = ga_view_aa_set ( r_angle_x, r_angle_y, r_angle_z ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Calling function to read rotation around the global model # coordinate system for the current view. # i_return_value = @ ga_view_aa_get @ ( s_name_of_view, @ r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value dump r_angle_x,r_angle_y,r_angle_z sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_ar_set

()

# # Purpose : This file provides an example of two calls to # the function ga_view_ar_set() # # This session file will open a new database by # name’new.db’ and will create a solid. The # viewing direction will be changed using # function ’ga_view_ar_set()’ and the direction # will be read back by using function # ’ga_view_aa_get()’. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_ar_set() # has the following arguments: # # ga_view_ar_set # ( angle_x, # angle_y, # angle_z ) # #--------------------------------------------------------------------# Variable Declarations REAL r_angle_x REAL r_angle_y REAL r_angle_z INTEGER i_return_value STRING s_name_of_view[8] STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("2","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@

Main Index

130 PCL Reference Manual Examples
Viewing Menu

"[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Calling function to rotate model around X axis of the global model # coordinate system for the current view. r_angle_y = 90 # i_return_value = @ ga_view_ar_set @ ( r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value #--------------------------------------------------------------------# Calling function to read rotation around the global model # coordinate system for the current view. # i_return_value = @ ga_view_aa_get @ ( s_name_of_view, @ r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value dump r_angle_x,r_angle_y,r_angle_z #--------------------------------------------------------------------# Calling function again to rotate model around X axis of the global # model coordinate system for the current view. r_angle_x = 0 r_angle_y = 90 r_angle_z = 0 # i_return_value = @ ga_view_ar_set @ ( r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value #--------------------------------------------------------------------# Calling function to read rotation around the global model # coordinate system for the current view. # i_return_value = @ ga_view_aa_get @ ( s_name_of_view, @ r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value dump r_angle_x,r_angle_y,r_angle_z sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_back_get
# # # # #

()

Purpose

:

This file provides an example of a call to the function ga_view_back_get() This session file will open a new database by

Main Index

Chapter 2: Basic Functions 131
Viewing Menu

# name ’new.db’ and will create a solid. The back # clipping will be set to ON. The function # ’ga_view_back_set’ will be used to set the back # clipping plane to -1. and function # ’ga_view_back_get’ will read the same distance. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_back_get() # has the following arguments: # # ga_view_back_get # ( name_of_view, # distance ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_distance INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Setting the clipping status to ON. i_return_value = ga_view_clipping_set(TRUE) dump i_return_value #--------------------------------------------------------------------# Calling function to set the back clipping plane distance to -1. r_distance = -1. # i_return_value = @ ga_view_back_set @ ( r_distance ) dump i_return_value # Resetting variable to zero. r_distance = 0. #--------------------------------------------------------------------# Calling function to read the location of the back clipping plane. # i_return_value = @ ga_view_back_get @ ( s_name_of_view, @ r_distance ) dump i_return_value dump r_distance sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

Main Index

132 PCL Reference Manual Examples
Viewing Menu

ga_view_back_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_back_set() # # This session file will open a new database by # name ’new.db’ and will create a solid. The back # clipping will be set to ON. The function # ’ga_view_back_set’ will be used to set the back # clipping plane to -1. and function # ’ga_view_back_get’ will read the same distance. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_back_set() # has the following arguments: # # ga_view_back_set # ( distance ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_distance INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Setting the clipping status to ON. i_return_value = ga_view_clipping_set(TRUE) dump i_return_value #--------------------------------------------------------------------# Calling function to set the back clipping plane distance to -1. r_distance = -1. # i_return_value = @ ga_view_back_set @ ( r_distance ) dump i_return_value # Resetting variable to zero. r_distance = 0. #--------------------------------------------------------------------# Calling function to read the location of the back clipping plane. # i_return_value = @ ga_view_back_get @ ( s_name_of_view, @

Main Index

Chapter 2: Basic Functions 133
Viewing Menu

r_distance ) dump i_return_value dump r_distance sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_capping_get

()

# # Purpose : This file provides an example of a call to the # function ga_view_capping_get() # # This session file will create a new database by # name ’new.db’ and create a solid. The solid # will be clipped at the front plane location. # And function ’ga_view_capping_set’ will be # called with two different values. Before # calling second time the session file will # paused. Function ’ga_view_capping_get’ will be # called to read the clipping status. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_capping_get() # has the following arguments: # # ga_view_capping_get # ( name_of_view, # capping_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] LOGICAL l_capping_status INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to clip the model using front clipping plane. i_return_value = ga_view_front_set( 1. ) dump i_return_value i_return_value = ga_view_clipping_set( TRUE ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the capping status of the current view. # i_return_value = @ ga_view_capping_get @

Main Index

134 PCL Reference Manual Examples
Viewing Menu

s_name_of_view, @ l_capping_status ) dump i_return_value dump l_capping_status #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Setting capping status to ON state for the current view. l_capping_status = TRUE # i_return_value = @ ga_view_capping_set @ ( l_capping_status ) dump i_return_value #--------------------------------------------------------------------# Resetting the variable to False. l_capping_status = FALSE #--------------------------------------------------------------------# Calling function to read the capping status of the current view. # i_return_value = @ ga_view_capping_get @ ( s_name_of_view, @ l_capping_status ) dump i_return_value dump l_capping_status sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

(

ga_view_capping_set

()

# # Purpose : This file provides an example of two call to # the function ga_view_capping_set() # # This session file will create a new database by # name ’new.db’ and create a solid. The solid # will be clipped at the front plane location. # And function ’ga_view_capping_set’ will be # called with two different values. Before # calling second time the session file will # paused. Function ’ga_view_capping_get’ will be # called to read the clipping status. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_capping_set() # has the following arguments: # # ga_view_capping_set # ( capping_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] LOGICAL l_capping_status INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db"

Main Index

Chapter 2: Basic Functions 135
Viewing Menu

uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to clip the model using front clipping plane. i_return_value = ga_view_front_set( 1. ) dump i_return_value i_return_value = ga_view_clipping_set( TRUE ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the capping status of the current view. # i_return_value = @ ga_view_capping_get @ ( s_name_of_view, @ l_capping_status ) dump i_return_value dump l_capping_status #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Setting capping status to ON state for the current view. l_capping_status = TRUE # i_return_value = @ ga_view_capping_set @ ( l_capping_status ) dump i_return_value #--------------------------------------------------------------------# Resetting the variable to False. l_capping_status = FALSE #--------------------------------------------------------------------# Calling function to read the capping status of the current view. # i_return_value = @ ga_view_capping_get @ ( s_name_of_view, @ l_capping_status ) dump i_return_value dump l_capping_status sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_center_get
# # # # # # # #

()

Purpose

:

This file provides an example of two call to the function ga_view_center_get() This session file will open a new database by name ’new.db’ and will create a solid. The view will be set to Isometric View 1 and the coordinates of the center will be read using

Main Index

136 PCL Reference Manual Examples
Viewing Menu

# function ’ga_view_center_get’. The coordinates # will be set to a new value using # ’ga_view_center_set’. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_center_get() # has the following arguments: # # ga_view_center_get # ( name_of_view, # coordinate_x, # coordinate_y ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_coordinate_x REAL r_coordinate_y INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to get the coordinates at the screen center. # i_return_value = @ ga_view_center_get @ ( s_name_of_view, @ r_coordinate_x, @ r_coordinate_y ) dump i_return_value dump r_coordinate_x,r_coordinate_y #--------------------------------------------------------------------# Setting the center to new value of (2.,2.) r_coordinate_x = 2. r_coordinate_y = 2. # i_return_value = @ ga_view_center_set @ ( r_coordinate_x, @ r_coordinate_y ) dump i_return_value # Resetting the variables to zero. r_coordinate_x = 0. r_coordinate_y = 0. #--------------------------------------------------------------------# Calling function to get the coordinates at the screen center. # i_return_value = @ ga_view_center_get @

Main Index

Chapter 2: Basic Functions 137
Viewing Menu

s_name_of_view, r_coordinate_x, r_coordinate_y ) dump i_return_value dump r_coordinate_x,r_coordinate_y

(

@ @

sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_center_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_center_set() # # This session file will open a new database by # name ’new.db’ and will create a solid. The view # will be set to Isometric View 1 and the # coordinates of the center will be read using # function ’ga_view_center_get’. The coordinates # will be set to a new value using # ’ga_view_center_set’. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_center_set() # has the following arguments: # # ga_view_center_set # ( coordinate_x, # coordinate_y ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_coordinate_x REAL r_coordinate_y INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to get the coordinates at the screen center. # i_return_value = @ ga_view_center_get @ ( s_name_of_view, @ r_coordinate_x, @ r_coordinate_y ) dump i_return_value

Main Index

138 PCL Reference Manual Examples
Viewing Menu

dump r_coordinate_x,r_coordinate_y #--------------------------------------------------------------------# Setting the center to new value of (2.,2.) r_coordinate_x = 2. r_coordinate_y = 2. # i_return_value = @ ga_view_center_set @ ( r_coordinate_x, @ r_coordinate_y ) dump i_return_value # Resetting the variables to zero. r_coordinate_x = 0. r_coordinate_y = 0. #--------------------------------------------------------------------# Calling function to get the coordinates at the screen center. # i_return_value = @ ga_view_center_get @ ( s_name_of_view, @ r_coordinate_x, @ r_coordinate_y ) dump i_return_value dump r_coordinate_x,r_coordinate_y sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_clipping_get

()

# # Purpose : This file provides an example of a call to the # function ga_view_clipping_get() # # This session file will create a new database by # name ’new.db’ and will create a solid. The back # clipping plane distance will be set to -1. # After setting the clipping status to true the # solid on the screen will be clipped. Function # ’ga_view_clipping_get’ will be called to read # the clipping status. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_clipping_get() # has the following arguments: # # ga_view_clipping_get # ( name_of_view, # clipping_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] LOGICAL l_clipping_status INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 139
Viewing Menu

# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to setting the back clipping plane distance to -1. i_return_value = ga_view_back_set ( -1. ) dump i_return_value #--------------------------------------------------------------------# Setting the clipping status to ON. l_clipping_status = TRUE # i_return_value = @ ga_view_clipping_set @ ( l_clipping_status ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the clipping status for the current view. # i_return_value = @ ga_view_clipping_get @ ( s_name_of_view, @ l_clipping_status ) dump i_return_value dump l_clipping_status sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_clipping_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_clipping_set() # # This session file will create a new database by # name ’new.db’ and will create a solid. The back # clipping plane distance will be set to -1. # After setting the clipping status to true the # solid on the screen will be clipped. Function # ’ga_view_clipping_get’ will be called to read # the clipping status. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_clipping_set() # has the following arguments: # # ga_view_clipping_set # ( clipping_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] LOGICAL l_clipping_status INTEGER i_return_value

Main Index

140 PCL Reference Manual Examples
Viewing Menu

STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to setting the back clipping plane distance to -1. i_return_value = ga_view_back_set ( -1. ) dump i_return_value #--------------------------------------------------------------------# Setting the clipping status to ON. l_clipping_status = TRUE # i_return_value = @ ga_view_clipping_set @ ( l_clipping_status ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the clipping status for the current view. # i_return_value = @ ga_view_clipping_get @ ( s_name_of_view, @ l_clipping_status ) dump i_return_value dump l_clipping_status sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_corners_set
# # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_view_corners_set() This session file will create a new database by name ’new.db’ and create a solid. The view will be modified by calling the function ’ga_view_corners_set’. Session will be paused before setting the view. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_view_corners_set() has the following arguments: ga_view_corners_set ( point_1, point_2, aspect_ratio )

Main Index

Chapter 2: Basic Functions 141
Viewing Menu

# #--------------------------------------------------------------------# Variable Declarations REAL ra_point_1(3) REAL ra_point_2(3) REAL r_aspect_ratio INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to set the view to a different angle # and zoom factor. ra_point_1 = [-10.,-20.,-30] ra_point_2 = [10.,20.,30] r_aspect_ratio = 5. # i_return_value = @ ga_view_corners_set @ ( ra_point_1, @ ra_point_2, @ r_aspect_ratio ) dump i_return_value sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_create
# # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_view_create() This session file will create a new database by name ’new.db’and a solid will be created. A new viewport will be created and the view from the this viewport will be used to creat a new view and will be posted to default_viewport. The number of views in the database will be read. Based on the number, memory will be allocated and the view names will be read. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_view_create() has the following arguments: ga_view_create

Main Index

142 PCL Reference Manual Examples
Viewing Menu

# ( name_of_view, # viewport_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] STRING s_viewport_name[8] INTEGER i_return_value STRING sav_view_list[16](VIRTUAL) INTEGER i_number_of_views STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Creating a viewport and changing the view therein to bottom view. i_return_value = ga_viewport_create( "new_viewport", 5, 5, 5, 5 ) dump i_return_value i_return_value = ga_viewport_view_set( "new_viewport", "bottom_view" ) dump i_return_value #--------------------------------------------------------------------# Creating a new view by name ’new_view’ and # posting it to ’default_viewport’. s_name_of_view = "new_view" s_viewport_name = "default_viewport" # i_return_value = @ ga_view_create @ ( s_name_of_view, @ s_viewport_name ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the number of views in the database. # i_return_value = ga_view_nviews_get ( i_number_of_views ) dump i_return_value dump i_number_of_views # Allocating memory space for the string array. sys_allocate_array(sav_view_list,1,i_number_of_views+1) #--------------------------------------------------------------------# Calling function to read the view names from the database. # i_return_value = ga_view_views_get ( sav_view_list ) dump i_return_value dump sav_view_list sys_free_array(sav_view_list) sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 143
Viewing Menu

ga_view_delete

()

# # Purpose : This file provides an example of a call to the # function ga_view_delete() # # This session file will create a new database by # name ’new.db’. The names of the views available # in the database will be read. This will be done # before and after the view deletion. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_delete() # has the following arguments: # # ga_view_delete # ( name_of_view ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[16] INTEGER i_return_value STRING sav_view_list[16](VIRTUAL) INTEGER i_number_of_views #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Calling function to get the number of views in the database. # i_return_value = ga_view_nviews_get ( i_number_of_views ) dump i_return_value dump i_number_of_views # Allocating memory space for the string array. sys_allocate_array(sav_view_list,1,i_number_of_views+1) #--------------------------------------------------------------------# Calling function to read the view names from the database. # i_return_value = ga_view_views_get ( sav_view_list ) dump i_return_value dump sav_view_list #--------------------------------------------------------------------# Deleting first view from the list. s_name_of_view = sav_view_list(1) # i_return_value = @ ga_view_delete @ ( s_name_of_view ) $# Delete view? $? YES 11002001 dump i_return_value #--------------------------------------------------------------------# Calling function to get the number of views in the database. # i_return_value = ga_view_nviews_get ( i_number_of_views ) dump i_return_value dump i_number_of_views # Allocating memory space for the string array. sys_allocate_array(sav_view_list,1,i_number_of_views+1)

Main Index

144 PCL Reference Manual Examples
Viewing Menu

#--------------------------------------------------------------------# Calling function to read the view names from the database. # i_return_value = ga_view_views_get ( sav_view_list ) dump i_return_value dump sav_view_list sys_free_array(sav_view_list) #---------------------------------------------------------------------

ga_view_dist_get

()

# # Purpose : This file provides an example of a call to the # function ga_view_dist_get() # # This session file will create a new database by # name ’new.db’ and create a solid. Status of # perspective view will be set on. Function # ’ga_view_dist_get’ will get the distance # between view plane and view center and function # ’ga_view_dist_set’ will set the distance. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_dist_get() # has the following arguments: # # ga_view_dist_get # ( name_of_view, # distance ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_distance INTEGER i_return_value LOGICAL l_perspective_status STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Calling function to set perspective status of current view to ON. l_perspective_status = TRUE # i_return_value = @ ga_view_perspective_set @ ( l_perspective_status ) dump i_return_value #--------------------------------------------------------------------# Calling function to set the distance of view plane from the view # center for perspective view. r_distance = 10

Main Index

Chapter 2: Basic Functions 145
Viewing Menu

# i_return_value = @ ga_view_dist_set @ ( r_distance ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the distance of view plane from the # view center. # i_return_value = @ ga_view_dist_get @ ( s_name_of_view, @ r_distance ) dump i_return_value dump r_distance sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_dist_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_dist_set() # # This session file will create a new database by # name ’new.db’ and create a solid. Status of # perspective view will be set on. Function # ’ga_view_dist_get’ will get the distance # between view plane and view center and function # ’ga_view_dist_set’ will set the distance. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_dist_set() # has the following arguments: # # ga_view_dist_set # ( distance ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_distance INTEGER i_return_value LOGICAL l_perspective_status STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Calling function to set perspective status of current view to ON. l_perspective_status = TRUE # i_return_value = @

Main Index

146 PCL Reference Manual Examples
Viewing Menu

ga_view_perspective_set ( l_perspective_status ) dump i_return_value

@

#--------------------------------------------------------------------# Calling function to set the distance of view plane from the view # center for perspective view. r_distance = 10 # i_return_value = @ ga_view_dist_set @ ( r_distance ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the distance of view plane from the # view center. # i_return_value = @ ga_view_dist_get @ ( s_name_of_view, @ r_distance ) dump i_return_value dump r_distance sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_exist_get

()

# # Purpose : This file provides an example of two calls to # the function ga_view_exist_get() # # This session file will open a new database by # name ’new.db’. View name ’new_view’ will be # checked for existence.Function ’ga_view_create’ # will be used to create ’new_view’ and existence # of this view will be checked again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_exist_get() # has the following arguments: # # ga_view_exist_get # ( name_of_view, # view_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] INTEGER i_view_status INTEGER i_return_value STRING s_viewport_name[8] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Checking existence of view named ’new_view’. s_name_of_view = "new_view" # i_return_value = @

Main Index

Chapter 2: Basic Functions 147
Viewing Menu

ga_view_exist_get @ ( s_name_of_view, @ i_view_status ) dump i_return_value dump i_view_status #--------------------------------------------------------------------# Creating a view by name ’new_view’ and posting it to # current viewport. # i_return_value = @ ga_view_create @ ( s_name_of_view, @ s_viewport_name ) dump i_return_value #--------------------------------------------------------------------# Checking existence of view named ’new_view’. # i_return_value = @ ga_view_exist_get @ ( s_name_of_view, @ i_view_status ) dump i_return_value dump i_view_status #---------------------------------------------------------------------

ga_view_fov_get

()

# # Purpose : This file provides an example of a call to the # function ga_view_fov_get() # # This session file will open a new database by # name ’new.db’ and create a solid.The function # ’ga_view_fov_set’ will be setting the field of # view angle to 1.0 the effect can be seen on the # screen. Function ’ga_view_fov_get’ will be # getting the number 1.0 as field of view angle. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_fov_get() # has the following arguments: # # ga_view_fov_get # ( name_of_view, # fov_angle ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_fov_angle INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@

Main Index

148 PCL Reference Manual Examples
Viewing Menu

"[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to set the field of view angle for current view. r_fov_angle = 1.0 # i_return_value = @ ga_view_fov_set @ ( r_fov_angle ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the field of view angle for current view. # i_return_value = @ ga_view_fov_get @ ( s_name_of_view, @ r_fov_angle ) dump i_return_value dump r_fov_angle sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_fov_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_fov_set() # # This session file will open a new database by # name ’new.db’ and create a solid.The function # ’ga_view_fov_set’ will be setting the field of # view angle to 1.0 the effect can be seen on the # screen. Function ’ga_view_fov_get’ will be # getting the number 1.0 as field of view angle. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_fov_set() # has the following arguments: # # ga_view_fov_set # ( fov_angle ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_fov_angle INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @

Main Index

Chapter 2: Basic Functions 149
Viewing Menu

asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to set the field of view angle for current view. r_fov_angle = 1.0 # i_return_value = @ ga_view_fov_set @ ( r_fov_angle ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the field of view angle for current view. # i_return_value = @ ga_view_fov_get @ ( s_name_of_view, @ r_fov_angle ) dump i_return_value dump r_fov_angle sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_from_get

()

# # Purpose : This file provides an example of a call to the # function ga_view_from_get() # # This session file will open a new database by # name ’new.db’ and create a solid. Function # ’ga_view_from_set’ will be used to set the # observation point to a different value. And # function ’ga_view_from_get’ will get the new # changed observation point. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_from_get() # has the following arguments: # # ga_view_from_get # ( name_of_view, # position ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL ra_position(3) INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #---------------------------------------------------------------------

Main Index

150 PCL Reference Manual Examples
Viewing Menu

# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to set the observation point for current view. ra_position = [-0.3, 4., 5.] # i_return_value = @ ga_view_from_set @ ( ra_position ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the observation point for current view. # i_return_value = @ ga_view_from_get @ ( s_name_of_view, @ ra_position ) dump i_return_value dump ra_position sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_from_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_from_set() # # This session file will open a new database by # name ’new.db’ and create a solid. Function # ’ga_view_from_set’ will be used to set the # observation point to a different value. And # function ’ga_view_from_get’ will get the new # changed observation point. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_from_set() # has the following arguments: # # ga_view_from_set # ( position ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL ra_position(3) INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

Chapter 2: Basic Functions 151
Viewing Menu

#--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to set the observation point for current view. ra_position = [-0.3, 4., 5.] # i_return_value = @ ga_view_from_set @ ( ra_position ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the observation point for current view. # i_return_value = @ ga_view_from_get @ ( s_name_of_view, @ ra_position ) dump i_return_value dump ra_position sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_front_get

()

# # Purpose : This file provides an example of a call to the # function ga_view_front_get() # # This session file will create a new database by # name ’new.db’ and create a solid. Clipping will # be set on and front clipping plane distance # will be changed using function # ’ga_view_front_set’.Function ’ga_view_front_get # when called gets the clipping plane distance. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_front_get() # has the following arguments: # # ga_view_front_get # ( name_of_view, # distance ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_distance INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db"

Main Index

152 PCL Reference Manual Examples
Viewing Menu

uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Setting the clipping status to ON. i_return_value = ga_view_clipping_set ( TRUE ) dump i_return_value #--------------------------------------------------------------------# Calling function to reduce the front clipping plane distance from # center of the current view. r_distance = 1.0 # i_return_value = @ ga_view_front_set @ ( r_distance ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the front clipping plane distance from # center of the current view. # i_return_value = @ ga_view_front_get @ ( s_name_of_view, @ r_distance ) dump i_return_value dump r_distance sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_front_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_front_set() # # This session file will create a new database by # name ’new.db’ and create a solid. Clipping will # be set on and front clipping plane distance # will be changed using function # ’ga_view_front_set’.Function ’ga_view_front_get # when called gets the clipping plane distance. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_front_set() # has the following arguments: # # ga_view_front_set # ( distance ) # #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 153
Viewing Menu

# Variable Declarations STRING s_name_of_view[8] REAL r_distance INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Setting the clipping status to ON. i_return_value = ga_view_clipping_set ( TRUE ) dump i_return_value #--------------------------------------------------------------------# Calling function to reduce the front clipping plane distance from # center of the current view. r_distance = 1.0 # i_return_value = @ ga_view_front_set @ ( r_distance ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the front clipping plane distance from # center of the current view. # i_return_value = @ ga_view_front_get @ ( s_name_of_view, @ r_distance ) dump i_return_value dump r_distance sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_model_scale_get
# # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_view_model_scale_get() This session file will create a new database by name ’new.db’ and create a solid. Function ’ga_view_model_scale_set’ will be called to change the scale of the model and effect will be visible on the screen. And also ’ga_view_model_scale_get’ function will return the scale factors. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

Main Index

154 PCL Reference Manual Examples
Viewing Menu

# The function ga_view_model_scale_get() # has the following arguments: # # ga_view_model_scale_get # ( name_of_view, # scale_x, # scale_y, # scale_z ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_scale_x REAL r_scale_y REAL r_scale_z INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Calling function to change model scale in current view. r_scale_x = 0.5 r_scale_y = 1.5 # i_return_value = @ ga_view_model_scale_set @ ( r_scale_x, @ r_scale_y, @ r_scale_z ) dump i_return_value #--------------------------------------------------------------------# Calling function to read model scale in current view. # i_return_value = @ ga_view_model_scale_get @ ( s_name_of_view, @ r_scale_x, @ r_scale_y, @ r_scale_z ) dump i_return_value dump r_scale_z,r_scale_y,r_scale_x sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_model_scale_set
# # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_view_model_scale_set() This session file will create a new database by name ’new.db’ and create a solid. Function ’ga_view_model_scale_set’ will be called to change the scale of the model and effect will be visible on the screen. And also ’ga_view_model_scale_get’ function will return

Main Index

Chapter 2: Basic Functions 155
Viewing Menu

# the scale factors. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_model_scale_set() # has the following arguments: # # ga_view_model_scale_set # ( scale_x, # scale_y, # scale_z ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_scale_x REAL r_scale_y REAL r_scale_z INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Calling function to change model scale in current view. r_scale_x = 0.5 r_scale_y = 1.5 # i_return_value = @ ga_view_model_scale_set @ ( r_scale_x, @ r_scale_y, @ r_scale_z ) dump i_return_value #--------------------------------------------------------------------# Calling function to read model scale in current view. # i_return_value = @ ga_view_model_scale_get @ ( s_name_of_view, @ r_scale_x, @ r_scale_y, @ r_scale_z ) dump i_return_value dump r_scale_z,r_scale_y,r_scale_x sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_nviews_get
# # # #

()

Purpose

:

This file provides an example of a call to the function ga_view_nviews_get()

Main Index

156 PCL Reference Manual Examples
Viewing Menu

# This session file will create a new database by # name ’new.db’. The number of views available by # default in the database will be read. Based on # the number, memory will be allocated and the # view names will be read. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_nviews_get() # has the following arguments: # # ga_view_nviews_get # ( number_of_views ) # #--------------------------------------------------------------------# Variable Declarations STRING sav_view_list[16](VIRTUAL) INTEGER i_number_of_views INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Calling function to get the number of views in the database. # i_return_value = @ ga_view_nviews_get @ ( i_number_of_views ) dump i_return_value dump i_number_of_views # Allocating memory space for the string array. sys_allocate_array(sav_view_list,1,i_number_of_views+1) #--------------------------------------------------------------------# Calling function to read the view names from the database. # i_return_value = @ ga_view_views_get @ ( sav_view_list ) dump i_return_value dump sav_view_list sys_free_array(sav_view_list) #---------------------------------------------------------------------

ga_view_perspective_get
# # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of 2 calls to the function ga_view_perspective_get() This session file will create a new database by name ’new.db’ and create a solid. Function ’ga_view_perspective_get’ will give the current status for perspective view. Function ’ga_view_perspective_set’ will set the perspective view status to TRUE. Before setting the session file will be paused. The effect of setting will be visible on the viewport. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown

Main Index

Chapter 2: Basic Functions 157
Viewing Menu

# menus on the menu bar. # # The function ga_view_perspective_get() # has the following arguments: # # ga_view_perspective_get # ( name_of_view, # perspective_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[16] LOGICAL l_perspective_status INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Calling function to get perspective status of current view. # i_return_value = @ ga_view_perspective_get @ ( s_name_of_view, @ l_perspective_status ) dump i_return_value dump l_perspective_status #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to set perspective status of current view to ON. l_perspective_status = TRUE # i_return_value = @ ga_view_perspective_set @ ( l_perspective_status ) dump i_return_value #--------------------------------------------------------------------# Calling function again to get perspective status of current view. # i_return_value = @ ga_view_perspective_get @ ( s_name_of_view, @ l_perspective_status ) dump i_return_value dump l_perspective_status sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_perspective_set
# # # #

()

Purpose

:

This file provides an example of a call to the function ga_view_perspective_set()

Main Index

158 PCL Reference Manual Examples
Viewing Menu

# This session file will create a new database by # name ’new.db’ and create a solid. Function # ’ga_view_perspective_get’ will give the current # status for perspective view. Function # ’ga_view_perspective_set’ will set the # perspective view status to TRUE. Before setting # the session file will be paused. The effect of # setting will be visible on the viewport. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_perspective_set() # has the following arguments: # # ga_view_perspective_set # ( perspective_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[16] LOGICAL l_perspective_status INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Calling function to get perspective status of current view. # i_return_value = @ ga_view_perspective_get @ ( s_name_of_view, @ l_perspective_status ) dump i_return_value dump l_perspective_status #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to set perspective status of current view to ON. l_perspective_status = TRUE # i_return_value = @ ga_view_perspective_set @ ( l_perspective_status ) dump i_return_value #--------------------------------------------------------------------# Calling function again to get perspective status of current view. # i_return_value = @ ga_view_perspective_get @ ( s_name_of_view, @ l_perspective_status ) dump i_return_value dump l_perspective_status

Main Index

Chapter 2: Basic Functions 159
Viewing Menu

sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_plane_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_plane_set() # # This session file will open a new database by # name ’new.db’ and create a solid. Function will # be called to change the view plane. Before # changing view plane session file is paused # after creating the solid. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_plane_set() # has the following arguments: # # ga_view_plane_set # ( point_1, # point_2, # point_3 ) # #--------------------------------------------------------------------# Variable Declarations REAL ra_point_1(3) REAL ra_point_2(3) REAL ra_point_3(3) INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to set the view plane parallel to Y axis and # perpendicular to X-Z plane. ra_point_1 = [1., 1., 1.] ra_point_2 = [2., 0., 0.] ra_point_3 = [0., 0., 2.] # i_return_value = @ ga_view_plane_set @ ( ra_point_1, @ ra_point_2, @ ra_point_3 ) dump i_return_value #---------------------------------------------------------------------

Main Index

160 PCL Reference Manual Examples
Viewing Menu

ga_view_rename

()

# # Purpose : This file provides an example of a call to the # function ga_view_rename() # # This session file will create a new database by # name ’new.db’. The names of views available in # the database will be read. This will be done # before and after the view renaming. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_rename() # has the following arguments: # # ga_view_rename # ( original_name, # new_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_original_name[16] STRING s_new_name[16] INTEGER i_return_value STRING sav_view_list[16](VIRTUAL) INTEGER i_number_of_views #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Calling function to get the number of views in the database. # i_return_value = ga_view_nviews_get ( i_number_of_views ) dump i_return_value dump i_number_of_views # Allocating memory space for the string array. sys_allocate_array(sav_view_list,1,i_number_of_views+1) #--------------------------------------------------------------------# Calling function to read the view names from the database. # i_return_value = ga_view_views_get ( sav_view_list ) dump i_return_value dump sav_view_list #--------------------------------------------------------------------# Calling function to rename the first view as ’Renamed_view’. s_original_name = sav_view_list(1) s_new_name = "Renamed_view" # i_return_value = @ ga_view_rename @ ( s_original_name, @ s_new_name ) dump i_return_value #--------------------------------------------------------------------# Reallocating memory space for the string array. sys_allocate_array(sav_view_list,1,i_number_of_views+1) #--------------------------------------------------------------------# Calling function to read the view names from the database. #

Main Index

Chapter 2: Basic Functions 161
Viewing Menu

i_return_value = ga_view_views_get ( dump i_return_value dump sav_view_list

sav_view_list )

sys_free_array(sav_view_list) #---------------------------------------------------------------------

ga_view_sa_get

()

# # Purpose : This file provides an example of a call to the # function ga_view_sa_get() # # This session file will open a new database by # name ’new.db’ and create a solid. The view will # be rotated by using function ’ga_view_sa_set’ # and the function ’ga_view_sa_get’ will be used # to read the rotation about the screen # coordinate system. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_sa_get() # has the following arguments: # # ga_view_sa_get # ( name_of_view, # angle_x, # angle_y, # angle_z ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_angle_x REAL r_angle_y REAL r_angle_z INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. r_angle_x = 23. r_angle_y = -34. # i_return_value = @ ga_view_aa_set @ ( r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value #--------------------------------------------------------------------# Changing view direction by rotating X axis by 90 degrees.

Main Index

162 PCL Reference Manual Examples
Viewing Menu

r_angle_y = 90. # i_return_value = ga_view_sa_set ( r_angle_x, r_angle_y, r_angle_z ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Calling function to read the rotation around the # screen coordinate system. # i_return_value = @ ga_view_sa_get @ ( s_name_of_view, @ r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value dump r_angle_x,r_angle_y,r_angle_z sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_sa_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_sa_set() # # This session file will open a new database by # name ’new.db’ and create a solid. The view will # be rotated by using function ’ga_view_sa_set’ # and the function ’ga_view_sa_get’ will be used # to read the rotation about the screen # coordinate system. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_sa_set() # has the following arguments: # # ga_view_sa_set # ( angle_x, # angle_y, # angle_z ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_angle_x REAL r_angle_y REAL r_angle_z INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @

Main Index

Chapter 2: Basic Functions 163
Viewing Menu

asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. r_angle_x = 23. r_angle_y = -34. # i_return_value = @ ga_view_aa_set @ ( r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value #--------------------------------------------------------------------# Changing view direction by rotating X axis by 90 degrees. r_angle_y = 90. # i_return_value = @ ga_view_sa_set @ ( r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the rotation around the # screen coordinate system. # i_return_value = @ ga_view_sa_get @ ( s_name_of_view, @ r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value dump r_angle_x,r_angle_y,r_angle_z sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_screen_scale_get
# # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_view_screen_scale_get() This session file will open a new database by name ’new.db’ and create a solid. Function ’ga_view_screen_scale_set’ will be called to set the screen scale factor to a value other than 1. And function ’ga_view_screen_scale_get’ will read the scale factors. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_view_screen_scale_get() has the following arguments: ga_view_screen_scale_get ( name_of_view, scale_x,

Main Index

164 PCL Reference Manual Examples
Viewing Menu

# scale_y ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_scale_x REAL r_scale_y INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. # i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to change the screen scale in X and Y direction # for current view. r_scale_x = 0.5 r_scale_y = 1.5 # i_return_value = @ ga_view_screen_scale_set @ ( r_scale_x, @ r_scale_y ) dump i_return_value #--------------------------------------------------------------------# Calling function to read screen scale factors for current view. # i_return_value = @ ga_view_screen_scale_get @ ( s_name_of_view, @ r_scale_x, @ r_scale_y ) dump i_return_value dump r_scale_x,r_scale_y sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_screen_scale_set
# # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_view_screen_scale_set() This session file will open a new database by name ’new.db’ and create a solid. Function ’ga_view_screen_scale_set’ will be called to set the screen scale factor to a value other than 1. And function ’ga_view_screen_scale_get’ will read the scale factors. This file can be run by starting a session of Patran, and running this session file

Main Index

Chapter 2: Basic Functions 165
Viewing Menu

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_screen_scale_set() # has the following arguments: # # ga_view_screen_scale_set # ( scale_x, # scale_y ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_scale_x REAL r_scale_y INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. # i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to change the screen scale in X and Y direction # for current view. r_scale_x = 0.5 r_scale_y = 1.5 # i_return_value = @ ga_view_screen_scale_set @ ( r_scale_x, @ r_scale_y ) dump i_return_value #--------------------------------------------------------------------# Calling function to read screen scale factors for current view. # i_return_value = @ ga_view_screen_scale_get @ ( s_name_of_view, @ r_scale_x, @ r_scale_y ) dump i_return_value dump r_scale_x,r_scale_y sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_sr_set
# # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_view_sr_set() This session file will open a new database by

Main Index

166 PCL Reference Manual Examples
Viewing Menu

# name ’new.db’ and create a solid. The view will # be rotated by using function ’ga_view_sr_set’ # and the function ’ga_view_sr_get’ will be used # to read the rotation about the screen # coordinate system. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_sr_set() # has the following arguments: # # ga_view_sr_set # ( angle_x, # angle_y, # angle_z ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_angle_x REAL r_angle_y REAL r_angle_z INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. r_angle_x = 23. r_angle_y = -34. # i_return_value = @ ga_view_aa_set @ ( r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value #--------------------------------------------------------------------# Changing view direction by rotating X axis by 90 degrees. r_angle_y = 90. # i_return_value = @ ga_view_sr_set @ ( r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the rotation around the # screen coordinate system. # i_return_value = @ ga_view_sa_get @ ( s_name_of_view, @ r_angle_x, @

Main Index

Chapter 2: Basic Functions 167
Viewing Menu

r_angle_y, @ r_angle_z ) dump i_return_value dump r_angle_x,r_angle_y,r_angle_z #--------------------------------------------------------------------# Changing view direction again by rotating X axis by 90 degrees. r_angle_x = 0. r_angle_y = 90. r_angle_z = 0. # i_return_value = @ ga_view_sr_set @ ( r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the rotation around the # screen coordinate system. # i_return_value = @ ga_view_sa_get @ ( s_name_of_view, @ r_angle_x, @ r_angle_y, @ r_angle_z ) dump i_return_value dump r_angle_x,r_angle_y,r_angle_z sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_to_get

()

# # Purpose : This file provides an example of a call to the # function ga_view_to_get() # # This session file will open a new database by # name ’new.db’ and create a solid. Function # ’ga_view_to_set will be called to change the # point of view. And function ’ga_view_to_get’ # will read the point of view for the same view. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_to_get() # has the following arguments: # # ga_view_to_get # ( name_of_view, # center_point ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL ra_center_point(3) INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

168 PCL Reference Manual Examples
Viewing Menu

#--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to change the point of view in current view. ra_center_point= [4.5 2. 10.] # i_return_value = @ ga_view_to_set @ ( ra_center_point ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the point of view in current view. # i_return_value = @ ga_view_to_get @ ( s_name_of_view, @ ra_center_point ) dump i_return_value dump ra_center_point sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_to_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_to_set() # # This session file will open a new database by # name ’new.db’ and create a solid. Function # ’ga_view_to_set will be called to change the # point of view. And function ’ga_view_to_get’ # will read the point of view for the same view. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_to_set() # has the following arguments: # # ga_view_to_set # ( point ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL ra_point(3) INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 169
Viewing Menu

# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to change the point of view in current view. ra_point = [4.5 2. 10.] # i_return_value = @ ga_view_to_set @ ( ra_point ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the point of view in current view. # i_return_value = @ ga_view_to_get @ ( s_name_of_view, @ ra_point ) dump i_return_value dump ra_point sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_up_get

()

# # Purpose : This file provides an example of a call to the # function ga_view_up_get() # # This session file will create a new database by # name ’new.db’ and create a solid. Function # ’ga_view_up_set’ will be called to change the # up direction of the current view. And function # ’ga_view_up_get’ will be called to read the up # direction of the view plane. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_up_get() # has the following arguments: # # ga_view_up_get # ( name_of_view, # direction_vector ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL ra_direction_vector(3) INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

170 PCL Reference Manual Examples
Viewing Menu

#--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to change the direction vector to (0,2,0) for # current view. ra_direction_vector = [0. 2. 0.] # i_return_value = @ ga_view_up_set @ ( ra_direction_vector ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the direction vector for current view. # i_return_value = @ ga_view_up_get @ ( s_name_of_view, @ ra_direction_vector ) dump i_return_value dump ra_direction_vector sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_up_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_up_set() # # This session file will create a new database by # name ’new.db’ and create a solid. Function # ’ga_view_up_set’ will be called to change the # up direction of the current view. And function # ’ga_view_up_get’ will be called to read the up # direction of the view plane. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_up_set() # has the following arguments: # # ga_view_up_set # ( direction_vector ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL ra_direction_vector(3) INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db")

Main Index

Chapter 2: Basic Functions 171
Viewing Menu

$? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to change the direction vector to (0,2,0) for # current view. ra_direction_vector = [0. 2. 0.] # i_return_value = @ ga_view_up_set @ ( ra_direction_vector ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the direction vector for current view. # i_return_value = @ ga_view_up_get @ ( s_name_of_view, @ ra_direction_vector ) dump i_return_value dump ra_direction_vector sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_views_get

()

# # Purpose : This file provides an example of a call to the # function ga_view_views_get() # # This session file will create a new database by # name ’new.db’. The number of views available by # default in the database will be read. Based on # the number, memory will be allocated and the # view names will be read. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_views_get() # has the following arguments: # # ga_view_views_get # ( view_list ) # #--------------------------------------------------------------------# Variable Declarations STRING sav_view_list[16](VIRTUAL) INTEGER i_number_of_views INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

172 PCL Reference Manual Examples
Viewing Menu

#--------------------------------------------------------------------# Calling function to get the number of views in the database. # i_return_value = @ ga_view_nviews_get @ ( i_number_of_views ) dump i_return_value dump i_number_of_views # Allocating memory space for the string array. sys_allocate_array(sav_view_list,1,i_number_of_views+1) #--------------------------------------------------------------------# Calling function to read the view names from the database. # i_return_value = @ ga_view_views_get @ ( sav_view_list ) dump i_return_value dump sav_view_list sys_free_array(sav_view_list) #---------------------------------------------------------------------

ga_view_zoom_get

()

# # Purpose : This file provides an example of a call to the # function ga_view_zoom_get() # # This session file will create a new database by # name ’new.db’ and create a solid. Function # ’ga_view_zoom_set’ will be called to change the # zoom factor. And function ’ga_view_zoom_get’ # will read the zoom factor for the current view. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_zoom_get() # has the following arguments: # # ga_view_zoom_get # ( name_of_view, # zoom_factor ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_zoom_factor INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1.

Main Index

Chapter 2: Basic Functions 173
Viewing Menu

i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Calling function to change zoom factor to 3.5 in current view. r_zoom_factor = 3.5 # i_return_value = @ ga_view_zoom_set @ ( r_zoom_factor ) dump i_return_value #--------------------------------------------------------------------# Calling function to read zoom factor for current view. # i_return_value = @ ga_view_zoom_get @ ( s_name_of_view, @ r_zoom_factor ) dump i_return_value dump r_zoom_factor sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

ga_view_zoom_set

()

# # Purpose : This file provides an example of a call to the # function ga_view_zoom_set() # # This session file will create a new database by # name ’new.db’ and create a solid. Function # ’ga_view_zoom_set’ will be called to change the # zoom factor. And function ’ga_view_zoom_get’ # will read the zoom factor for the current view. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_view_zoom_set() # has the following arguments: # # ga_view_zoom_set # ( zoom_factor ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name_of_view[8] REAL r_zoom_factor INTEGER i_return_value STRING sv_asm_create_hpat_ver_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a solid. i_return_value = @ asm_const_hpat_vertex("1","[0,0,0]","[0,0,4]",@ "[9,0,3]", "[8,0,1]", "[0,4,0]", "[0,1,4]",@ "[9,2,3]", "[8,3,1]", sv_asm_create_hpat_ver_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Changing viewing direction to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0.)

Main Index

174 PCL Reference Manual Examples
Viewing Menu

dump i_return_value #--------------------------------------------------------------------# Calling function to change zoom factor to 3.5 in current view. r_zoom_factor = 3.5 # i_return_value = @ ga_view_zoom_set @ ( r_zoom_factor ) dump i_return_value #--------------------------------------------------------------------# Calling function to read zoom factor for current view. # i_return_value = @ ga_view_zoom_get @ ( s_name_of_view, @ r_zoom_factor ) dump i_return_value dump r_zoom_factor sys_free_string(sv_asm_create_hpat_ver_crtd_ids) #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 175
Display Menu

Ch apter 2: Basi c Functi on s PCL Ref eren ce Manual Examples PCL Reference Manual Examples

Display Menu
This section contains examples of functions that are used to control the values stored in the database that govern what and how geometric and finite element model entities are displayed in a viewport.
ga_display_autosubdivconst_get

()

# # Purpose : This file provides an example of 2 calls to the # function ga_display_autosubdivconst_get() # # In this example the field.db is opened and # displacement fringe results are posted. Then # this function is called to get the tolerance # value used in setting the ranges for spectrums. # Then the function # ga_display_autosubdivconst_set() is called to # set a different value to tolerance and this # function is called for the second time to get # the tolerance value. # # Before running this session file run field.ses # to create field.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_autosubdivconst_get() # has the following arguments: # # ga_display_autosubdivconst_get # ( display_name, # tolerance ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] REAL r_tolerance INTEGER i_return_value #--------------------------------------------------------------------# Open "field.db" uil_file_open.go( "field.db" ) # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Plot the displacement fringes i_return_value = res_init_fringe_plot( dump i_return_value )

i_return_value = res_create_fringe_plot_rec3( 1, 2, 1, 1, 1, 1, @ 0, 0, 1., "", 1, 2, 3, 23, 1, 1, 0., 30, 0, 1 ) dump i_return_value i_return_value = res_make_fringe_plot( 1, [1], [1], [""], [0.], @ ["Default, Static Subcase: Displacements, Translational"// @ " (VEC-MAG) -MSC.Nastran" ] ) dump i_return_value

Main Index

176 PCL Reference Manual Examples
Display Menu

i_return_value = res_deinit_fringe_plot( dump i_return_value

)

#--------------------------------------------------------------------# Get the tolerance value of the ranges spectrums s_display_name="general" i_return_value = ga_display_autosubdivconst_get ( s_display_name, r_tolerance ) dump i_return_value dump r_tolerance @ @ @

#--------------------------------------------------------------------# Set the tolerance value for spectrum i_return_value = ga_display_autosubdivconst_set ( s_display_name, 0.0001 ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Get the tolerance value of the ranges spectrums i_return_value = ga_display_autosubdivconst_get ( s_display_name, r_tolerance ) dump i_return_value dump r_tolerance @ @ @

#---------------------------------------------------------------------

ga_display_autosubdivconst_set
# # # # # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_display_autosubdivconst_set() In this example the field.db is opened and displacement fringe results are posted. Then the function ga_display_autosubdivconst_get() is called to get the tolerance value of the spectrum range. Then this function is called to set a new value for the tolerance and ga_display_autosubdivconst_get() is again called to get the tolerance value. Before running this session file run field.ses to create field.db This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_display_autosubdivconst_set() has the following arguments: ga_display_autosubdivconst_set ( display_name, tolerance )

Main Index

Chapter 2: Basic Functions 177
Display Menu

# #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] REAL r_tolerance INTEGER i_return_value #--------------------------------------------------------------------# Open "field.db" uil_file_open.go( "field.db" ) # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Plot the displacement fringes i_return_value = res_init_fringe_plot( dump i_return_value )

i_return_value = res_create_fringe_plot_rec3( 1, 2, 1, 1, 1, 1, @ 0, 0, 1., "", 1, 2, 3, 23, 1, 1, 0., 30, 0, 1 ) dump i_return_value i_return_value = res_make_fringe_plot( 1, [1], [1], [""], [0.], @ ["Default, Static Subcase: Displacements, Translational"// @ " (VEC-MAG) -MSC.Nastran" ] ) dump i_return_value i_return_value = res_deinit_fringe_plot( dump i_return_value )

#--------------------------------------------------------------------# Get the tolerance value of the ranges spectrums i_return_value = ga_display_autosubdivconst_get ( "general", r_tolerance ) dump i_return_value dump r_tolerance @ @ @

#--------------------------------------------------------------------# Set the tolerance value for spectrum r_tolerance = 0.0001 i_return_value = ga_display_autosubdivconst_set ( s_display_name, r_tolerance ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Reset the variable equal to 0.0 r_tolerance = 0.0 #--------------------------------------------------------------------# Get the tolerance value of the ranges spectrums i_return_value = @ ga_display_autosubdivconst_get @ ( "general", @ r_tolerance ) dump i_return_value dump r_tolerance #---------------------------------------------------------------------

Main Index

178 PCL Reference Manual Examples
Display Menu

ga_display_autosubdivide_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_autosubdivide_get() # # In this example field.db is opened and the # displacement fringe results are posted. Then # this function is called to get the status of # the autosubdivide flag. Then the # autosubdivide flag is changed using the # function ga_display_autosubdivide_set(). This # function is called for the second time to get # the status of the autosubdivide flag. # # Before running this session file run field.ses # to create field.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_autosubdivide_get() # has the following arguments: # # ga_display_autosubdivide_get # ( display_name, # autosubdivide_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_autosubdivide_status INTEGER i_return_value #--------------------------------------------------------------------# Open "field.db" uil_file_open.go( "field.db" ) # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Plot the displacement fringes i_return_value = res_init_fringe_plot( dump i_return_value )

i_return_value = res_create_fringe_plot_rec3( 1, 2, 1, 1, 1, 1, @ 0, 0, 1., "", 1, 2, 3, 23, 1, 1, 0., 30, 0, 1 ) dump i_return_value i_return_value = res_make_fringe_plot( 1, [1], [1], [""], [0.], @ ["Default, Static Subcase: Displacements, Translational"// @ " (VEC-MAG) -MSC.Nastran" ] ) dump i_return_value i_return_value = res_deinit_fringe_plot( dump i_return_value )

#--------------------------------------------------------------------# Get the status of the autosubdivide flag s_display_name = "general"

Main Index

Chapter 2: Basic Functions 179
Display Menu

i_return_value = ga_display_autosubdivide_get ( s_display_name, i_autosubdivide_status ) dump i_return_value dump i_autosubdivide_status

@ @ @

#--------------------------------------------------------------------# Set the status of the autosubdivide flag i_return_value = ga_display_autosubdivide_set ( s_display_name, 1 ) dump i_return_value @ @

#--------------------------------------------------------------------# Get the status of the autosubdivide flag i_return_value = ga_display_autosubdivide_get ( s_display_name, i_autosubdivide_status ) dump i_return_value dump i_autosubdivide_status @ @ @

#---------------------------------------------------------------------

ga_display_autosubdivide_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_autosubdivide_set() # # In this example field.db is opened and the # displacement fringe results are posted. Then # the function ga_display_autosubdivide_get() # is called to get the status of the # autosubdivide flag. Then the autosubdivide # flag is changed using this function. The # change is verified by getting the # autosubdivide flag in the end. # # Before running this session file run field.ses # to create field.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_autosubdivide_set() # has the following arguments: # # ga_display_autosubdivide_set # ( display_name, # autosubdivide_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_autosubdivide_status INTEGER i_return_value #--------------------------------------------------------------------# Open "field.db" uil_file_open.go( "field.db" )

Main Index

180 PCL Reference Manual Examples
Display Menu

# Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Plot the displacement fringes i_return_value = res_init_fringe_plot( dump i_return_value )

i_return_value = res_create_fringe_plot_rec3( 1, 2, 1, 1, 1, 1, @ 0, 0, 1., "", 1, 2, 3, 23, 1, 1, 0., 30, 0, 1 ) dump i_return_value i_return_value = res_make_fringe_plot( 1, [1], [1], [""], [0.], @ ["Default, Static Subcase: Displacements, Translational"// @ " (VEC-MAG) -MSC.Nastran" ] ) dump i_return_value i_return_value = res_deinit_fringe_plot( dump i_return_value )

#--------------------------------------------------------------------# Get the status of the autosubdivide flag i_return_value = ga_display_autosubdivide_get ( "general", i_autosubdivide_status ) dump i_return_value dump i_autosubdivide_status @ @ @

#--------------------------------------------------------------------# Set the status of the autosubdivide flag s_display_name = "general" i_autosubdivide_status = 1 i_return_value = ga_display_autosubdivide_set ( s_display_name, i_autosubdivide_status ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Reset the variable equal to zero i_autosubdivide_status = 0 #--------------------------------------------------------------------# Get the status of the autosubdivide flag i_return_value = @ ga_display_autosubdivide_get @ ( "general", @ i_autosubdivide_status ) dump i_return_value dump i_autosubdivide_status #---------------------------------------------------------------------

ga_display_backfacing_get
# # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_backfacing_get() This session file will open a new database by

Main Index

Chapter 2: Basic Functions 181
Display Menu

# name ’new.db’. Function # ’ga_display_backfacing_get’ will be called to # get the back facing status. The status will # then be set by using function # ’ga_display_backfacing_set’. Then the function # ’ga_display_backfacing_get’ will be called and # status will be read again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_backfacing_get() # has the following arguments: # # ga_display_backfacing_get # ( display_name, # backface_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_backface_status INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Calling function to get the back facing status. s_display_name = "general" # i_return_value = @ ga_display_backfacing_get @ ( s_display_name, @ i_backface_status ) dump i_return_value dump i_backface_status #--------------------------------------------------------------------# Calling function to set the back facing status. IF ( i_backface_status == 0)THEN i_backface_status = 1 ELSE i_backface_status = 0 ENDIF # i_return_value = @ ga_display_backfacing_set @ ( s_display_name, @ i_backface_status ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the back facing status. # i_return_value = @ ga_display_backfacing_get @ ( s_display_name, @ i_backface_status ) dump i_return_value dump i_backface_status #---------------------------------------------------------------------

Main Index

182 PCL Reference Manual Examples
Display Menu

ga_display_backfacing_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_backfacing_set() # # This session file will open a new database by # name ’new.db’. Function # ’ga_display_backfacing_get’ will be called to # get the back facing status. The status will # then be set by using function # ’ga_display_backfacing_set’. Then the function # ’ga_display_backfacing_get’ will be called and # status will be read again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_backfacing_set() # has the following arguments: # # ga_display_backfacing_set # ( display_name, # backface_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_backface_status INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Calling function to get the back facing status. s_display_name = "general" # i_return_value = @ ga_display_backfacing_get @ ( s_display_name, @ i_backface_status ) dump i_return_value dump i_backface_status #--------------------------------------------------------------------# Calling function to set the back facing status. IF ( i_backface_status == 0)THEN i_backface_status = 1 ELSE i_backface_status = 0 ENDIF # i_return_value = @ ga_display_backfacing_set @ ( s_display_name, @ i_backface_status ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the back facing status. # i_return_value = @ ga_display_backfacing_get @ ( s_display_name, @

Main Index

Chapter 2: Basic Functions 183
Display Menu

i_backface_status ) dump i_return_value dump i_backface_status #---------------------------------------------------------------------

ga_display_bumpmap_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_bumpmap_get() # # This session file will create a new database by # name ’new.db’ and create a surface. The surface # will be meshed and the bump map value will be # get by using function ’ga_display_bumpmap_get’. # The bump map value will be set by using # function ’ga_display_bumpmap_set’ and the bump # map value will be get again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_bumpmap_get() # has the following arguments: # # ga_display_bumpmap_get # ( display_name, # bumpmap_id, # bump_map_number ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_bumpmap_id INTEGER i_bump_map_number INTEGER i_return_value STRING sv_asm_line_3point_crtd_ids[VIRTUAL] STRING sv_sgm_sweep_surface_e_crtd_ids[VIRTUAL] INTEGER i_fem_create_num_nodes INTEGER i_fem_create_num_elems STRING sv_fem_create_nodes_created[VIRTUAL] STRING sv_fem_create_elems_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a surface by extruding a curve and mesh it. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[1 -0.5 0]", "[1.5 0.25 0]", 1, 0.5, @ sv_asm_line_3point_crtd_ids ) dump i_return_value i_return_value = @ sgm_const_surface_extrude( "1", "<0 0 01>",1.,@ 0., "[0 0 0]", "Coord 0", "Curve 1 ", @ sv_sgm_sweep_surface_e_crtd_ids ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, @ "Surface 1 ", 1, [0.5], "Quad8", "1", "1" @ ,"Coord 0","Coord 0",i_fem_create_num_nodes@

Main Index

184 PCL Reference Manual Examples
Display Menu

, i_fem_create_num_elems, @ sv_fem_create_nodes_created, sv_fem_create_elems_created ) dump i_return_value i_return_value = ga_view_aa_set( 30., 0., -15. ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the bump map number. s_display_name = "general" # i_return_value = @ ga_display_bumpmap_get @ ( s_display_name, @ i_bumpmap_id, @ i_bump_map_number ) dump i_return_value, i_bumpmap_id, i_bump_map_number #--------------------------------------------------------------------# Calling function to set the bump map number. i_bump_map_number = 30 # i_return_value = @ ga_display_bumpmap_set @ ( s_display_name, @ i_bumpmap_id, @ i_bump_map_number ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the bump map number. # i_return_value = @ ga_display_bumpmap_get @ ( s_display_name, @ i_bumpmap_id, @ i_bump_map_number ) dump i_return_value, i_bumpmap_id, i_bump_map_number sys_free_string(sv_asm_line_3point_crtd_ids) sys_free_string(sv_sgm_sweep_surface_e_crtd_ids) sys_free_string(sv_fem_create_nodes_created) sys_free_string(sv_fem_create_elems_created) #---------------------------------------------------------------------

ga_display_bumpmap_set # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_display_bumpmap_set() This session file will create a new database by name ’new.db’ and create a surface. The surface will be meshed and the bump map value will be get by using function ’ga_display_bumpmap_get’. The bump map value will be set by using function ’ga_display_bumpmap_set’ and the bump map value will be get again. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_display_bumpmap_set() has the following arguments:

Main Index

Chapter 2: Basic Functions 185
Display Menu

# # ga_display_bumpmap_set # ( display_name, # bumpmap_id, # bump_map_number ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_bumpmap_id INTEGER i_bump_map_number INTEGER i_return_value STRING sv_asm_line_3point_crtd_ids[VIRTUAL] STRING sv_sgm_sweep_surface_e_crtd_ids[VIRTUAL] INTEGER i_fem_create_num_nodes INTEGER i_fem_create_num_elems STRING sv_fem_create_nodes_created[VIRTUAL] STRING sv_fem_create_elems_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a surface by extruding a curve and mesh it. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[1 -0.5 0]", "[1.5 0.25 0]", 1, 0.5, @ sv_asm_line_3point_crtd_ids ) dump i_return_value i_return_value = @ sgm_const_surface_extrude( "1", "<0 0 01>",1.,@ 0., "[0 0 0]", "Coord 0", "Curve 1 ", @ sv_sgm_sweep_surface_e_crtd_ids ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, @ "Surface 1 ", 1, [0.5], "Quad8", "1", "1" @ ,"Coord 0","Coord 0",i_fem_create_num_nodes@ , i_fem_create_num_elems, @ sv_fem_create_nodes_created, sv_fem_create_elems_created ) dump i_return_value i_return_value = ga_view_aa_set( 30., 0., -15. ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the bump map number. s_display_name = "general" # i_return_value = @ ga_display_bumpmap_get @ ( s_display_name, @ i_bumpmap_id, @ i_bump_map_number ) dump i_return_value, i_bumpmap_id, i_bump_map_number #--------------------------------------------------------------------# Calling function to set the bump map number. i_bump_map_number = 30 #

Main Index

186 PCL Reference Manual Examples
Display Menu

i_return_value = @ ga_display_bumpmap_set @ ( s_display_name, @ i_bumpmap_id, @ i_bump_map_number ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the bump map number. # i_return_value = @ ga_display_bumpmap_get @ ( s_display_name, @ i_bumpmap_id, @ i_bump_map_number ) dump i_return_value, i_bumpmap_id, i_bump_map_number sys_free_string(sv_asm_line_3point_crtd_ids) sys_free_string(sv_sgm_sweep_surface_e_crtd_ids) sys_free_string(sv_fem_create_nodes_created) sys_free_string(sv_fem_create_elems_created) #--------------------------------------------------------------------ga_display_contour_lblspcng_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_contour_lblspcng_get() # # This session file will open a database # ’spool.db’ and will plot contours for # fillet_pressure load set. The label spacing for # contours will be get. The label spacing will be # set and get again after resuming from pause. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_contour_lblspcng_get() # has the following arguments: # # ga_display_contour_lblspcng_get # ( display_name, # label_spacing ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_label_spacing INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") #--------------------------------------------------------------------# Displaying contours for ’fillet_pressure’ load set. i_return_value = @ loadsbcs_plot_contours( "Pressure", 0., @ "Bot Surf Pressure", "Resultant", @ [ "fillet_pressure"], ["fem_model"] )

Main Index

Chapter 2: Basic Functions 187
Display Menu

dump i_return_value #--------------------------------------------------------------------# Calling function to get the label spacing. s_display_name = "general" # i_return_value = @ ga_display_contour_lblspcng_get @ ( s_display_name, @ i_label_spacing ) dump i_return_value, i_label_spacing #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to set the label spacing. i_label_spacing = 30 # i_return_value = @ ga_display_contour_lblspcng_set @ ( s_display_name, @ i_label_spacing ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the label spacing. # i_return_value = @ ga_display_contour_lblspcng_get @ ( s_display_name, @ i_label_spacing ) dump i_return_value, i_label_spacing #---------------------------------------------------------------------

ga_display_contour_lblspcng_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_contour_lblspcng_set() # # This session file will open a database # ’spool.db’ and will plot contours for # fillet_pressure load set. The label spacing for # contours will be get. The label spacing will be # set and get again after resuming from pause. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_contour_lblspcng_set() # has the following arguments: # # ga_display_contour_lblspcng_set # ( display_name, # label_spacing ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_label_spacing INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db")

Main Index

188 PCL Reference Manual Examples
Display Menu

#--------------------------------------------------------------------# Displaying contours for ’fillet_pressure’ load set. i_return_value = @ loadsbcs_plot_contours( "Pressure", 0., @ "Bot Surf Pressure", "Resultant", @ [ "fillet_pressure"], ["fem_model"] ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the label spacing. s_display_name = "general" # i_return_value = @ ga_display_contour_lblspcng_get @ ( s_display_name, @ i_label_spacing ) dump i_return_value, i_label_spacing #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to set the label spacing. i_label_spacing = 30 # i_return_value = @ ga_display_contour_lblspcng_set @ ( s_display_name, @ i_label_spacing ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the label spacing. # i_return_value = @ ga_display_contour_lblspcng_get @ ( s_display_name, @ i_label_spacing ) dump i_return_value, i_label_spacing #---------------------------------------------------------------------

ga_display_create

()

# # Purpose : This file provides an example of a call to the # function ga_display_create() # # This file opens a new database "new.db" and # gets the named display property names. Later # it creates a new named display property name # and gets the list. Finally it deletes the named # display property name and gets the list of # named display property names. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_create() # has the following arguments: # # ga_display_create # ( display_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sa_display_list[32](4) INTEGER i_return_value

Main Index

Chapter 2: Basic Functions 189
Display Menu

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # s_display_name = "new_display_property" s_display_name = "new_display_property" i_return_value = ga_display_displays_get ( sa_display_list ) dump i_return_value # The list of display property names. dump sa_display_list # Reset the list. sa_display_list(1) sa_display_list(2) sa_display_list(3) sa_display_list(4) = = = = "" "" "" "" @ @ @ @

# Create the named display property. i_return_value = ga_display_create ( s_display_name ) dump i_return_value i_return_value = ga_display_displays_get ( sa_display_list ) dump i_return_value # The list of display property names. dump sa_display_list # Reset the list. sa_display_list(1) sa_display_list(2) sa_display_list(3) sa_display_list(4) = = = = "" "" "" ""

@ @

# Delete the named display property. i_return_value = ga_display_delete ( s_display_name ) dump i_return_value

@ @

i_return_value = @ ga_display_displays_get @ ( sa_display_list ) dump i_return_value # The list of display property names. dump sa_display_list #---------------------------------------------------------------------

ga_display_deform_scale_get
# # # # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_deform_scale_get() This file opens the existing database "spool.db" and reads the deformation results. It then gets the deformation scale for the named display property. Finally it sets the deformation scale and gets it.

Main Index

190 PCL Reference Manual Examples
Display Menu

# 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. # Finally copy the file "spool_res_deform.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_deform_scale_get() # has the following arguments: # # ga_display_deform_scale_get # ( display_name, # deformation_scale ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] REAL r_deformation_scale INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results sf_play("spool_res_deform.ses") # s_display_name = "general" s_display_name = "general" # Get the deformation scale. i_return_value = ga_display_deform_scale_get ( s_display_name, r_deformation_scale ) dump i_return_value dump r_deformation_scale # Set the deformation scale. IF (r_deformation_scale == 0.1 ) THEN r_deformation_scale = 0.9 ELSE r_deformation_scale = 0.1 ENDIF # Note the change of deformation on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() i_return_value = ga_display_deform_scale_set ( s_display_name, r_deformation_scale ) dump i_return_value # Reset the value. r_deformation_scale = 0.0 # Get the deformation scale. i_return_value = @ ga_display_deform_scale_get @ ( s_display_name, @ r_deformation_scale ) dump i_return_value dump r_deformation_scale #--------------------------------------------------------------------@ @ @ @ @ @

Main Index

Chapter 2: Basic Functions 191
Display Menu

ga_display_deform_scale_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_deform_scale_set() # # This file opens the existing database # "spool.db" and reads the deformation results. # It then gets the deformation scale for the # named display property. Finally it sets the # deformation scale and gets it. # # 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. # Finally copy the file "spool_res_deform.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_deform_scale_set() # has the following arguments: # # ga_display_deform_scale_set # ( display_name, # deformation_scale ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] REAL r_deformation_scale INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results sf_play("spool_res_deform.ses") # s_display_name = "general" s_display_name = "general" # Get the deformation scale. i_return_value = ga_display_deform_scale_get ( s_display_name, r_deformation_scale ) dump i_return_value dump r_deformation_scale # Set the deformation scale. IF (r_deformation_scale == 0.1 ) THEN r_deformation_scale = 0.9 ELSE r_deformation_scale = 0.1 ENDIF # Note the change of deformation on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() i_return_value = ga_display_deform_scale_set ( s_display_name, r_deformation_scale ) dump i_return_value @ @ @ @ @ @

Main Index

192 PCL Reference Manual Examples
Display Menu

# Reset the value. r_deformation_scale = 0.0 # Get the deformation scale. i_return_value = @ ga_display_deform_scale_get @ ( s_display_name, @ r_deformation_scale ) dump i_return_value dump r_deformation_scale #---------------------------------------------------------------------

ga_display_deform_scalintrp_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_deform_scalintrp_get() # # This file opens a existing database "spool.db" # and reads in the deformation results. Later # it gets the interpretation value for the # deformed entity scale. Finally it changes the # interpretation value and gets it. # # 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. # Finally copy the file "spool_res_deform.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_deform_scalintrp_get() # has the following arguments: # # ga_display_deform_scalintrp_get # ( display_name, # interpretation ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING s_interpretation[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_deform.ses") # s_display_name = "general" s_display_name = "general" # Get the interpretation value. i_return_value = ga_display_deform_scalintrp_get ( s_display_name, s_interpretation ) dump i_return_value dump s_interpretation # Set the interpretation value. IF (s_interpretation == "VALUE" ) THEN s_interpretation = "PERCENTAGE" @ @ @

Main Index

Chapter 2: Basic Functions 193
Display Menu

ELSE s_interpretation = "VALUE" ENDIF # Note the change of deformation on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() i_return_value = ga_display_deform_scalintrp_set ( s_display_name, s_interpretation ) dump i_return_value # Reset the value. s_interpretation = "" # Get the interpretation value. i_return_value = @ ga_display_deform_scalintrp_get @ ( s_display_name, @ s_interpretation ) dump i_return_value dump s_interpretation #--------------------------------------------------------------------@ @ @

ga_display_deform_scalintrp_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_deform_scalintrp_set() # # This file opens a existing database "spool.db" # and reads in the deformation results. Later # it gets the interpretation value for the # deformed entity scale. Finally it changes the # interpretation value and gets it. # # 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. # Finally copy the file "spool_res_deform.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_deform_scalintrp_set() # has the following arguments: # # ga_display_deform_scalintrp_set # ( display_name, # interpretation ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING s_interpretation[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_deform.ses") # s_display_name = "general" s_display_name = "general"

Main Index

194 PCL Reference Manual Examples
Display Menu

# Get the interpretation value. i_return_value = ga_display_deform_scalintrp_get ( s_display_name, s_interpretation ) dump i_return_value dump s_interpretation # Set the interpretation value. IF (s_interpretation == "VALUE" ) THEN s_interpretation = "PERCENTAGE" ELSE s_interpretation = "VALUE" ENDIF

@ @ @

# Note the change of deformation on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() i_return_value = ga_display_deform_scalintrp_set ( s_display_name, s_interpretation ) dump i_return_value # Reset the value. s_interpretation = "" # Get the interpretation value. i_return_value = @ ga_display_deform_scalintrp_get @ ( s_display_name, @ s_interpretation ) dump i_return_value dump s_interpretation #--------------------------------------------------------------------@ @ @

ga_display_delete

()

# # Purpose : This file provides an example of a call to the # function ga_display_delete() # # This file opens a new database "new.db" and # gets the named display property names .Later # it creates a new named display property name # and gets the list. Finally it deletes the named # display property name and gets the list of # named display property names. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_delete() # has the following arguments: # # ga_display_delete # ( display_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sa_display_list[32](4) INTEGER i_return_value

Main Index

Chapter 2: Basic Functions 195
Display Menu

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # s_display_name = "new_display_property" s_display_name = "new_display_property" i_return_value = ga_display_displays_get ( sa_display_list ) dump i_return_value # The list of display property names. dump sa_display_list # Reset the list. sa_display_list(1) sa_display_list(2) sa_display_list(3) sa_display_list(4) = = = = "" "" "" "" @ @ @ @

# Create the named display property. i_return_value = ga_display_create ( s_display_name ) dump i_return_value i_return_value = ga_display_displays_get ( sa_display_list ) dump i_return_value # The list of display property names. dump sa_display_list # Reset the list. sa_display_list(1) sa_display_list(2) sa_display_list(3) sa_display_list(4) = = = = "" "" "" ""

@ @

# Delete the named display property. i_return_value = ga_display_delete ( s_display_name ) dump i_return_value

@ @

i_return_value = @ ga_display_displays_get @ ( sa_display_list ) dump i_return_value # The list of display property names. dump sa_display_list #---------------------------------------------------------------------

ga_display_diffuse_get
# # # # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_diffuse_get() This file opens a new database "new.db" and creates a surface and renders it. Later it sets the texture to rough appearance. Then it gets the diffuse reflectance value. Finally it sets the diffuse reflectance value and gets it.

Main Index

196 PCL Reference Manual Examples
Display Menu

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_diffuse_get() # has the following arguments: # # ga_display_diffuse_get # ( display_name, # diffuse_reflectance ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] REAL r_diffuse_reflectance INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and render it. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") # s_display_name = "general" s_display_name = "general" # Set the texture. i_return_value = ga_display_texture_set ( s_display_name, 1.0 ) dump i_return_value # Get the diffuse reflectance value. i_return_value = ga_display_diffuse_get ( s_display_name, r_diffuse_reflectance ) dump i_return_value dump r_diffuse_reflectance @ @ @

@ @ @

# Note the change on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the diffuse reflectance value. IF ( r_diffuse_reflectance == 1.0) THEN r_diffuse_reflectance = 0.0 ELSE r_diffuse_reflectance = 1.0 ENDIF i_return_value = ga_display_diffuse_set ( s_display_name, r_diffuse_reflectance ) dump i_return_value # Reset the value. r_diffuse_reflectance = 100.0 @ @ @

Main Index

Chapter 2: Basic Functions 197
Display Menu

# Get the diffuse reflectance value. i_return_value = ga_display_diffuse_get ( s_display_name, r_diffuse_reflectance ) dump i_return_value dump r_diffuse_reflectance

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_diffuse_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_diffuse_set() # # This file opens a new database "new.db" and # creates a surface and renders it. Later it # sets the texture to rough appearance. Then # it gets the diffuse reflectance value. Finally # it sets the diffuse reflectance value and gets # it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_diffuse_set() # has the following arguments: # # ga_display_diffuse_set # ( display_name, # diffuse_reflectance ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] REAL r_diffuse_reflectance INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and render it. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") # s_display_name = "general" s_display_name = "general" # Set the texture. i_return_value = ga_display_texture_set ( s_display_name, 1.0 ) dump i_return_value # Get the diffuse reflectance value. @ @ @

Main Index

198 PCL Reference Manual Examples
Display Menu

i_return_value = ga_display_diffuse_get ( s_display_name, r_diffuse_reflectance ) dump i_return_value dump r_diffuse_reflectance

@ @ @

# Note the change on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the diffuse reflectance value. IF ( r_diffuse_reflectance == 1.0) THEN r_diffuse_reflectance = 0.0 ELSE r_diffuse_reflectance = 1.0 ENDIF i_return_value = ga_display_diffuse_set ( s_display_name, r_diffuse_reflectance ) dump i_return_value # Reset the value. r_diffuse_reflectance = 100.0 # Get the diffuse reflectance value. i_return_value = ga_display_diffuse_get ( s_display_name, r_diffuse_reflectance ) dump i_return_value dump r_diffuse_reflectance @ @ @

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_displays_get

()

# # Purpose : This file provides an example of a call to the # function ga_display_displays_get() # # This file opens a new database "new.db" and # gets the list of the all the defined named # display properties. The new database contains # "general" and "simple" as the two default # display names. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_displays_get() # has the following arguments: # # ga_display_displays_get # ( display_list ) # #--------------------------------------------------------------------# Variable Declarations STRING sa_display_list[32](4) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db"

Main Index

Chapter 2: Basic Functions 199
Display Menu

uil_file_new.go("","new.db") $? YES 36000002 i_return_value = ga_display_displays_get ( sa_display_list ) dump i_return_value @ @

# The List of display property names are dump sa_display_list #---------------------------------------------------------------------

ga_display_edgecolor_get

()

# # Purpose : This file provides an example of two calls # to the function ga_display_edgecolor_get() # # This file opens a new database "new.db" and # creates a surface, shades it and gets the # edge color. Later it sets the edge color and # then again gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_edgecolor_get() # has the following arguments: # # ga_display_edgecolor_get # ( display_name, # color_index ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_color_index INTEGER i_edge_status INTEGER i_edge_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") # s_display_name = "general" s_display_name = "general" # Set the edgedisplay. i_edge_status = 1 i_return_value = ga_display_showedges_set ( s_display_name, i_edge_status ) dump i_return_value

@ @ @

Main Index

200 PCL Reference Manual Examples
Display Menu

# Get the edge color. i_return_value = ga_display_edgecolor_get ( s_display_name, i_color_index ) dump i_return_value dump i_color_index

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the edge color. IF ( i_color_index == 5 ) THEN i_color_index = 1 ELSE i_color_index = 5 END IF i_return_value = ga_display_edgecolor_set ( s_display_name, i_color_index ) dump i_return_value i_color_index = 0 # Get the edge color. i_return_value = ga_display_edgecolor_get ( s_display_name, i_color_index ) dump i_return_value dump i_color_index @ @ @

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_edgecolor_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_edgecolor_set() # # This file opens a new database "new.db" and # creates a surface, shades it and gets the # edge color. Later it sets the edge color and # then again gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_edgecolor_set() # has the following arguments: # # ga_display_edgecolor_set # ( display_name, # color_index ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_color_index INTEGER i_edge_status INTEGER i_return_value

Main Index

Chapter 2: Basic Functions 201
Display Menu

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") # s_display_name = "general" s_display_name = "general" # Set the edgedisplay. i_edge_status = 1 i_return_value = ga_display_showedges_set ( s_display_name, i_edge_status ) dump i_return_value # Get the edge color. i_return_value = ga_display_edgecolor_get ( s_display_name, i_color_index ) dump i_return_value dump i_color_index

@ @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the edge color. IF ( i_color_index == 5 ) THEN i_color_index = 1 ELSE i_color_index = 5 END IF i_return_value = ga_display_edgecolor_set ( s_display_name, i_color_index ) dump i_return_value # Reset the value. i_color_index = 0 # Get the edge color. i_return_value = ga_display_edgecolor_get ( s_display_name, i_color_index ) dump i_return_value dump i_color_index @ @ @ @ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_exist_get
# #

()

Purpose

:

This file provides an example of two calls

Main Index

202 PCL Reference Manual Examples
Display Menu

# to the function ga_display_exist_get() # # This file opens a new database "new.db" and # gets the existance status for an existing # and a non existing display name. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_exist_get() # has the following arguments: # # ga_display_exist_get # ( display_name, # display_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_display_status INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # s_display_name = "general" s_display_name = "general" # Check for existing display name. i_return_value = ga_display_exist_get ( s_display_name, i_display_status ) dump i_return_value # The existance status is dump i_display_status # s_display_name = "non_existant_display" s_display_name = "non_existant_display" # Check for non existing display name. i_return_value = ga_display_exist_get ( s_display_name, i_display_status ) dump i_return_value # The existance status is dump i_display_status @ @ @ @ @ @

# Note that the error occured during the second call to the # due to non existance of the specified display property name. #---------------------------------------------------------------------

ga_display_freefem_get
# # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_display_freefem_get() This file open a new database "new.db" and creates a surface and meshes it. Later it gets the style for FEM display. Finally it sets the style for FEM display and gets it.

Main Index

Chapter 2: Basic Functions 203
Display Menu

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_freefem_get() # has the following arguments: # # ga_display_freefem_get # ( display_name, # style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_fem_create_mesh_surfa_num_no INTEGER i_fem_create_mesh_surfa_num_el STRING sv_fem_create_mesh_s_nodes[VIRTUAL] STRING sv_fem_create_mesh_s_elems[VIRTUAL] INTEGER i_style INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and mesh it. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value i_return_value = mesh_seed_create ( "Surface 1.1 1.2 1.3 1.4 ", 1, 2, 0., 0., 0. ) dump i_return_value @ @ @

i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, @ "Surface 1 ", 1, [0.1], "Quad4", "1", "1", @ "Coord 0", "Coord 0", @ i_fem_create_mesh_surfa_num_no, @ i_fem_create_mesh_surfa_num_el, @ sv_fem_create_mesh_s_nodes, @ sv_fem_create_mesh_s_elems) dump i_return_value # s_display_name = "general" s_display_name = "general" # Get the style for free fem display. i_return_value = ga_display_freefem_get ( s_display_name, i_style ) dump i_return_value dump i_style @ @ @

# Note the change of display on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the style for free fem display. IF (i_style == 1 ) THEN i_style = 0

Main Index

204 PCL Reference Manual Examples
Display Menu

ELSE i_style = 1 ENDIF i_return_value = ga_display_freefem_set ( s_display_name, i_style ) dump i_return_value # Reset the value. i_style = 100 # Get the style for free fem display. i_return_value = ga_display_freefem_get ( s_display_name, i_style ) dump i_return_value dump i_style

@ @ @

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) SYS_FREE_STRING(sv_fem_create_mesh_s_nodes) SYS_FREE_STRING(sv_fem_create_mesh_s_elems) #---------------------------------------------------------------------

ga_display_freefem_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_freefem_set() # # This file open a new database "new.db" and # creates a surface and meshes it. Later it # gets the style for FEM display. Finally it # sets the style for FEM display and gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_freefem_set() # has the following arguments: # # ga_display_freefem_set # ( display_name, # style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_fem_create_mesh_surfa_num_no INTEGER i_fem_create_mesh_surfa_num_el STRING sv_fem_create_mesh_s_nodes[VIRTUAL] STRING sv_fem_create_mesh_s_elems[VIRTUAL] INTEGER i_style INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and mesh it. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@

Main Index

Chapter 2: Basic Functions 205
Display Menu

"Coord 0",sv_asm_create_patch_xy_created) dump i_return_value i_return_value = mesh_seed_create ( "Surface 1.1 1.2 1.3 1.4 ", 1, 2, 0., 0., 0. ) dump i_return_value @ @ @

i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, @ "Surface 1 ", 1, [0.1], "Quad4", "1", "1", @ "Coord 0", "Coord 0", @ i_fem_create_mesh_surfa_num_no, @ i_fem_create_mesh_surfa_num_el, @ sv_fem_create_mesh_s_nodes, @ sv_fem_create_mesh_s_elems) dump i_return_value # s_display_name = "general" s_display_name = "general" # Get the style for free fem display. i_return_value = ga_display_freefem_get ( s_display_name, i_style ) dump i_return_value dump i_style @ @ @

# Note the change of display on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the style for free fem display. IF (i_style == 1 ) THEN i_style = 0 ELSE i_style = 1 ENDIF i_return_value = ga_display_freefem_set ( s_display_name, i_style ) dump i_return_value # Reset the value. i_style = 100 # Get the style for free fem display. i_return_value = ga_display_freefem_get ( s_display_name, i_style ) dump i_return_value dump i_style

@ @ @

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) SYS_FREE_STRING(sv_fem_create_mesh_s_nodes) SYS_FREE_STRING(sv_fem_create_mesh_s_elems) #---------------------------------------------------------------------

ga_display_gloss_get
# # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_gloss_get()

Main Index

206 PCL Reference Manual Examples
Display Menu

# # This file opens a new database "new.db" and # creates a surface and renders it. Later it # sets the texture to rough appearance. Then # it gets the amount of glossiness. Finally it # sets the amount of glossiness and gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_gloss_get() # has the following arguments: # # ga_display_gloss_get # ( display_name, # gloss_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] REAL r_gloss_value INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and render it. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") # s_display_name = "general" s_display_name = "general" # Set the texture. i_return_value = ga_display_texture_set ( s_display_name, 1.0 ) dump i_return_value # Get the amount of glossiness. i_return_value = ga_display_gloss_get ( s_display_name, r_gloss_value ) dump i_return_value dump r_gloss_value @ @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the amount of glossiness. IF ( r_gloss_value == 1.0) THEN r_gloss_value = 0.0 ELSE r_gloss_value = 1.0 ENDIF i_return_value = ga_display_gloss_set @ @

Main Index

Chapter 2: Basic Functions 207
Display Menu

s_display_name, r_gloss_value ) dump i_return_value # Reset the value. r_gloss_value = 100.0 # Get the amount of glossiness. i_return_value = ga_display_gloss_get ( s_display_name, r_gloss_value ) dump i_return_value dump r_gloss_value

(

@

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_gloss_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_gloss_set() # # This file opens a new database "new.db" and # creates a surface and renders it. Later it # sets the texture to rough appearance. Then # it gets the amount of glossiness. Finally it # sets the amount of glossiness and gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_gloss_set() # has the following arguments: # # ga_display_gloss_set # ( display_name, # gloss_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] REAL r_gloss_value INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and render it. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") # s_display_name = "general" s_display_name = "general" # Set the texture. i_return_value = ga_display_texture_set ( s_display_name, @ @ @

Main Index

208 PCL Reference Manual Examples
Display Menu

1.0 ) dump i_return_value # Get the amount of glossiness. i_return_value = ga_display_gloss_get ( s_display_name, r_gloss_value ) dump i_return_value dump r_gloss_value @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the amount of glossiness. IF ( r_gloss_value == 1.0) THEN r_gloss_value = 0.0 ELSE r_gloss_value = 1.0 ENDIF i_return_value = ga_display_gloss_set ( s_display_name, r_gloss_value ) dump i_return_value # Reset the value. r_gloss_value = 100.0 # Get the amount of glossiness. i_return_value = ga_display_gloss_get ( s_display_name, r_gloss_value ) dump i_return_value dump r_gloss_value @ @ @ @ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_gravitation_get
# # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_gravitation_get() This session file will open database ’spool.db’ The gravitation status will be get. After a pause the gravitation status will be set to other value and get again. Before running this session file run spool.ses to create spool.db This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_display_gravitation_get() has the following arguments: ga_display_gravitation_get ( display_name, gravity_status )

Main Index

Chapter 2: Basic Functions 209
Display Menu

# #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_gravity_status INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") #--------------------------------------------------------------------# Calling function to get the gravitation status. s_display_name = "general" # i_return_value = @ ga_display_gravitation_get @ ( s_display_name, @ i_gravity_status ) dump i_return_value, i_gravity_status #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to set the gravitation status. i_gravity_status = 30 # i_return_value = @ ga_display_gravitation_set @ ( s_display_name, @ i_gravity_status ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the gravitation status. # i_return_value = @ ga_display_gravitation_get @ ( s_display_name, @ i_gravity_status ) dump i_return_value, i_gravity_status #---------------------------------------------------------------------

ga_display_gravitation_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_gravitation_set() # # This session file will open database ’spool.db’ # The gravitation status will be get. After a # pause the gravitation status will be set to # other value and get again. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_gravitation_set() # has the following arguments: # # ga_display_gravitation_set # ( display_name, # gravity_status ) # #---------------------------------------------------------------------

Main Index

210 PCL Reference Manual Examples
Display Menu

# Variable Declarations STRING s_display_name[32] INTEGER i_gravity_status INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") #--------------------------------------------------------------------# Calling function to get the gravitation status. s_display_name = "general" # i_return_value = @ ga_display_gravitation_get @ ( s_display_name, @ i_gravity_status ) dump i_return_value, i_gravity_status #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to set the gravitation status. i_gravity_status = 30 # i_return_value = @ ga_display_gravitation_set @ ( s_display_name, @ i_gravity_status ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the gravitation status. # i_return_value = @ ga_display_gravitation_get @ ( s_display_name, @ i_gravity_status ) dump i_return_value, i_gravity_status #---------------------------------------------------------------------

ga_display_hilight_get

()

# # Purpose : This file provides an example of two calls # to the function ga_display_hilight_get() # # This file opens a new database "new.db" and # creates a surface, renders it and sets the # texture to rough appearance. Later it get the # value used to control specular reflections. # Finally it sets the value and gets it again. # The specular reflections values available # are 200,50,5 and 12. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_hilight_get() # has the following arguments: # # ga_display_hilight_get # ( display_name, # specular_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32]

Main Index

Chapter 2: Basic Functions 211
Display Menu

STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_specular_value INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and render it. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle( "shaded/smooth") # s_display_name = "general" s_display_name = "general" # Set the texture. i_return_value = ga_display_texture_set ( s_display_name, 1.0 ) dump i_return_value @ @ @

# Get the value used to control specular reflections. i_return_value = @ ga_display_hilight_get @ ( s_display_name, @ i_specular_value ) dump i_return_value dump i_specular_value # Session file paused. Press "Resume" to continue.. sf_pause() # Set the value used to control specular reflections. IF (i_specular_value == 12 ) THEN i_specular_value = 50 ELSE i_specular_value = 12 ENDIF i_return_value = ga_display_hilight_set ( s_display_name, i_specular_value ) dump i_return_value # Reset the value. i_specular_value = 0 @ @ @

# Get the value used to control specular reflections. i_return_value = @ ga_display_hilight_get @ ( s_display_name, @ i_specular_value ) dump i_return_value dump i_specular_value SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_hilight_set
# #

()

Purpose

:

This file provides an example of a call

Main Index

212 PCL Reference Manual Examples
Display Menu

# to the function ga_display_hilight_set() # # This file opens a new database "new.db" and # creates a surface, renders it and sets the # texture to rough appearance. Later it gets the # value used to control specular reflections. # Finally it sets the value and gets it again. # The specular reflections values available # are 200,50,5 and 12. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_hilight_set() # has the following arguments: # # ga_display_hilight_set # ( display_name, # specular_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_specular_value INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and render it. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle( "shaded/smooth") # s_display_name = "general" s_display_name = "general" # Set the texture. i_return_value = ga_display_texture_set ( s_display_name, 1.0 ) dump i_return_value @ @ @

# Get the value used to control specular reflections. i_return_value = @ ga_display_hilight_get @ ( s_display_name, @ i_specular_value ) dump i_return_value dump i_specular_value # Session file paused. Press "Resume" to continue.. sf_pause() # Set the value used to control specular reflections. IF (i_specular_value == 12 ) THEN i_specular_value = 50 ELSE i_specular_value = 12 ENDIF

Main Index

Chapter 2: Basic Functions 213
Display Menu

i_return_value = ga_display_hilight_set ( s_display_name, i_specular_value ) dump i_return_value # Reset the value. i_specular_value = 0

@ @ @

# Get the value used to control specular reflections. i_return_value = @ ga_display_hilight_get @ ( s_display_name, @ i_specular_value ) dump i_return_value dump i_specular_value SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_labelcolor_get

()

# # Purpose : This file provides an example of two calls # to the function ga_display_labelcolor_get() # # This file opens a new database "new.db" and # creates a surface, renders it and turns on the # surface and point labels. Later it gets the # label color. Finally it sets the label color # and gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_labelcolor_get() # has the following arguments: # # ga_display_labelcolor_get # ( display_name, # label_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_label_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface,render it and set on the point and surface labels. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") point_label( TRUE ) surface_label( TRUE ) # s_display_name = "general"

Main Index

214 PCL Reference Manual Examples
Display Menu

s_display_name = "general" # Get the display label color. i_return_value = ga_display_labelcolor_get ( s_display_name, i_label_color ) dump i_return_value dump i_label_color @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the display label color. IF (i_label_color == 1 ) THEN i_label_color= 3 ELSE i_label_color = 1 ENDIF i_return_value = ga_display_labelcolor_set ( s_display_name, i_label_color ) dump i_return_value # Reset the value. i_label_color = 0 # Get the display label color. i_return_value = ga_display_labelcolor_get ( s_display_name, i_label_color ) dump i_return_value dump i_label_color @ @ @

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_labelcolor_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_labelcolor_set() # # This file opens a new database "new.db" and # creates a surface, renders it and turns on the # surface and point labels. Later it gets the # label color. Finally it sets the label color # gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_labelcolor_set() # has the following arguments: # # ga_display_labelcolor_set # ( display_name, # label_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL]

Main Index

Chapter 2: Basic Functions 215
Display Menu

INTEGER i_label_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface,render it and set on the point and surface labels. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") point_label( TRUE ) surface_label( TRUE ) # s_display_name = "general" s_display_name = "general" # Get the display label color. i_return_value = ga_display_labelcolor_get ( s_display_name, i_label_color ) dump i_return_value dump i_label_color @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the display label color. IF (i_label_color == 1 ) THEN i_label_color = 3 ELSE i_label_color = 1 ENDIF i_return_value = ga_display_labelcolor_set ( s_display_name, i_label_color ) dump i_return_value # Reset the value. i_label_color = 0 # Get the display label color. i_return_value = ga_display_labelcolor_get ( s_display_name, i_label_color ) dump i_return_value dump i_label_color @ @ @

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_lines_get
# # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_lines_get() This file opens a new database "new.db" and creates a surface and gets the number of visualization lines. Later it sets the number

Main Index

216 PCL Reference Manual Examples
Display Menu

# of visualization lines and gets it again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_lines_get() # has the following arguments: # # ga_display_lines_get # ( display_name, # line_number ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_line_number INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value # s_display_name = "general" s_display_name = "general" # Get the number of visualization lines. i_return_value = ga_display_lines_get ( s_display_name, i_line_number ) dump i_return_value dump i_line_number @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the number of visualization lines. IF (i_line_number == 1 ) THEN i_line_number = 2 ELSE i_line_number = 1 ENDIF i_return_value = ga_display_lines_set ( s_display_name, i_line_number ) dump i_return_value # Reset the value i_line_number = 0 # Get the number of visualization lines. i_return_value = ga_display_lines_get ( s_display_name, i_line_number ) dump i_return_value dump i_line_number @ @ @

@ @ @

Main Index

Chapter 2: Basic Functions 217
Display Menu

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_lines_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_lines_set() # # This file opens a new database "new.db" and # creates a surface and gets the number of # visualization lines. Later it sets the number # of visualization lines and gets it again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_lines_set() # has the following arguments: # # ga_display_lines_set # ( display_name, # line_number ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_line_number INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value # s_display_name = "general" s_display_name = "general" # Get the number of visualization lines. i_return_value = ga_display_lines_get ( s_display_name, i_line_number ) dump i_return_value dump i_line_number @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the number of visualization lines. IF (i_line_number == 1 ) THEN i_line_number = 2 ELSE i_line_number = 1 ENDIF i_return_value = ga_display_lines_set ( s_display_name, @ @ @

Main Index

218 PCL Reference Manual Examples
Display Menu

i_line_number ) dump i_return_value # Reset the value i_line_number = 0 # Get the number of visualization lines. i_return_value = ga_display_lines_get ( s_display_name, i_line_number ) dump i_return_value dump i_line_number @ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_linestyle_get

()

# # Purpose : This file provides an example of two calls # to the function ga_display_linestyle_get() # # This file opens a new database "new.db" and # creates a line and gets the linestyle for # the named display property. Later it sets the # linestyle for the named display property and # gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_linestyle_get() # has the following arguments: # # ga_display_linestyle_get # ( display_name, # line_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING s_line_style[32] 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 # Create a line. i_return_value = @ asm_const_line_2point( "1", "[0 0 0]", @ "[1 1 1 ]", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value # s_display_name = "general" s_display_name = "general" # Get the linestyle for named display property. i_return_value = @ ga_display_linestyle_get @ ( s_display_name, @ s_line_style ) dump i_return_value dump s_line_style

Main Index

Chapter 2: Basic Functions 219
Display Menu

# Set the linestyle for named display property. IF (s_line_style == "SOLID" ) THEN s_line_style = "DASHED" ELSE s_line_style = "SOLID" ENDIF i_return_value = ga_display_linestyle_set ( s_display_name, s_line_style ) dump i_return_value # Reset the value s_line_style = "" @ @ @

# Get the linestyle for named display property. i_return_value = @ ga_display_linestyle_get @ ( s_display_name, @ s_line_style ) dump i_return_value dump s_line_style sys_free_string(sv_asm_line_2point_created_ids) #---------------------------------------------------------------------

ga_display_linestyle_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_linestyle_set() # # This file opens a new database "new.db" and # creates a line and gets the linestyle for # the named display property. Later it sets the # linestyle for the named display property and # gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_linestyle_set() # has the following arguments: # # ga_display_linestyle_set # ( display_name, # line_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING s_line_style[32] 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 # Create a line. i_return_value = @ asm_const_line_2point( "1", "[0 0 0]", @ "[1 1 1 ]", 0, "", 50., 1, sv_asm_line_2point_created_ids )

Main Index

220 PCL Reference Manual Examples
Display Menu

dump i_return_value # s_display_name = "general" s_display_name = "general" # Get the linestyle for named display property. i_return_value = @ ga_display_linestyle_get @ ( s_display_name, @ s_line_style ) dump i_return_value dump s_line_style # Set the linestyle for named display property. IF (s_line_style == "SOLID" ) THEN s_line_style = "DASHED" ELSE s_line_style = "SOLID" ENDIF i_return_value = ga_display_linestyle_set ( s_display_name, s_line_style ) dump i_return_value # Reset the value s_line_style = "" @ @ @

# Get the linestyle for named display property. i_return_value = @ ga_display_linestyle_get @ ( s_display_name, @ s_line_style ) dump i_return_value dump s_line_style sys_free_string(sv_asm_line_2point_created_ids) #---------------------------------------------------------------------

ga_display_linewidth_get

()

# # Purpose : This file provides an example of two calls # to the function ga_display_linewidth_get() # # This file opens a new database "new.db" and # creates a surface and gets the line width for # named display property. Later it sets the line # width for the named display property and # gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_linewidth_get() # has the following arguments: # # ga_display_linewidth_get # ( display_name, # line_width ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_line_width

Main Index

Chapter 2: Basic Functions 221
Display Menu

STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface. asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0",sv_asm_create_patch_xy_created) # s_display_name = "general" s_display_name = "general" # Get the line width for the named display property. i_return_value = @ ga_display_linewidth_get @ ( s_display_name, @ i_line_width ) dump i_return_value dump i_line_width # Set the line width for the named display property. IF (i_line_width == 1 ) THEN i_line_width = 5 ELSE i_line_width = 1 ENDIF i_return_value = ga_display_linewidth_set ( s_display_name, i_line_width ) dump i_return_value # Reset the value i_line_width = 0 @ @ @ @

# Get the line width for the named display property. i_return_value = @ ga_display_linewidth_get @ ( s_display_name, @ i_line_width ) dump i_return_value dump i_line_width SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_linewidth_set
# # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_display_linewidth_set() This file opens a new database "new.db" and creates a surface and gets the line width for named display property. Later it sets the line width for the named display property and gets it. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_display_linewidth_set()

Main Index

222 PCL Reference Manual Examples
Display Menu

# has the following arguments: # # ga_display_linewidth_set # ( display_name, # line_width ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_line_width STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface. asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0",sv_asm_create_patch_xy_created) # s_display_name = "general" s_display_name = "general" # Get the line width for the named display property. i_return_value = @ ga_display_linewidth_get @ ( s_display_name, @ i_line_width ) dump i_return_value dump i_line_width # Set the line width for the named display property. IF (i_line_width == 1 ) THEN i_line_width = 5 ELSE i_line_width = 1 ENDIF i_return_value = ga_display_linewidth_set ( s_display_name, i_line_width ) dump i_return_value # Reset the value i_line_width = 0 @ @ @ @

# Get the line width for the named display property. i_return_value = @ ga_display_linewidth_get @ ( s_display_name, @ i_line_width ) dump i_return_value dump i_line_width SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_ndisplays_get
# # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_display_ndisplays_get() This file opens a new database "new.db" and counts the number of named display property lists. Later it gets the names of the display

Main Index

Chapter 2: Basic Functions 223
Display Menu

# properties. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_ndisplays_get() # has the following arguments: # # ga_display_ndisplays_get # ( number_of_displays ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_number_of_displays INTEGER i_return_value STRING sv_display_list[32](VIRTUAL) #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Get the number of named display i_return_value = ga_display_ndisplays_get ( i_number_of_displays ) dump i_return_value dump i_number_of_displays property. @ @

SYS_ALLOCATE_ARRAY(sv_display_list,1,i_number_of_displays) # Get the named display property. i_return_value = ga_display_displays_get ( sv_display_list ) dump i_return_value dump sv_display_list @ @

SYS_FREE_ARRAY(sv_display_list) #---------------------------------------------------------------------

ga_display_nlspc_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_nlspc_get() # # This file opens a new database "new.db" and # creates a curve. Later it gets the number # of segments per curve. Finally it sets the # number of segments per curve and gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_nlspc_get() # has the following arguments: # # ga_display_nlspc_get # ( display_name, # number_of_segments ) # #---------------------------------------------------------------------

Main Index

224 PCL Reference Manual Examples
Display Menu

# Variable Declarations STRING s_display_name[32] STRING sv_sgm_create_curve_2d_crtd_ids[VIRTUAL] INTEGER i_number_of_segments INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a surface. i_return_value = @ sgm_const_curve_2d_circle_v1( "2", 1, 1., @ "Coord 0.3", "", "[0 0 0]", TRUE, @ sv_sgm_create_curve_2d_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Get the number of line segments per curve. s_display_name = "general" i_return_value = @ ga_display_nlspc_get @ ( s_display_name, @ i_number_of_segments ) dump i_return_value dump i_number_of_segments #--------------------------------------------------------------------# Note the change on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the number of line segments per curve. IF (i_number_of_segments == 0 ) THEN i_number_of_segments = 3 ELSE i_number_of_segments = 0 ENDIF i_return_value = @ ga_display_nlspc_set @ ( s_display_name, @ i_number_of_segments ) dump i_return_value # Reset the value i_number_of_segments = 100 #--------------------------------------------------------------------# Get the number of line segments per curve. i_return_value = @ ga_display_nlspc_get @ ( s_display_name, @ i_number_of_segments ) dump i_return_value dump i_number_of_segments sys_free_string(sv_sgm_create_curve_2d_crtd_ids) #---------------------------------------------------------------------

ga_display_nlspc_set
# # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_display_nlspc_set() This file opens a new database "new.db" and creates a curve. Later it gets the number of segments per curve. Finally it sets the number of segments per curve and gets it.

Main Index

Chapter 2: Basic Functions 225
Display Menu

# This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_nlspc_set() # has the following arguments: # # ga_display_nlspc_set # ( display_name, # number_of_segments ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_sgm_create_curve_2d_crtd_ids[VIRTUAL] INTEGER i_number_of_segments INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a surface. i_return_value = @ sgm_const_curve_2d_circle_v1( "2", 1, 1., @ "Coord 0.3", "", "[0 0 0]", TRUE, @ sv_sgm_create_curve_2d_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Get the number of line segments per curve. s_display_name = "general" i_return_value = @ ga_display_nlspc_get @ ( s_display_name, @ i_number_of_segments ) dump i_return_value dump i_number_of_segments #--------------------------------------------------------------------# Note the change on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the number of line segments per curve. IF (i_number_of_segments == 0 ) THEN i_number_of_segments = 3 ELSE i_number_of_segments = 0 ENDIF i_return_value = @ ga_display_nlspc_set @ ( s_display_name, @ i_number_of_segments ) dump i_return_value # Reset the value i_number_of_segments = 100 #--------------------------------------------------------------------# Get the number of line segments per curve. i_return_value = @ ga_display_nlspc_get @ ( s_display_name, @ i_number_of_segments ) dump i_return_value dump i_number_of_segments sys_free_string(sv_sgm_create_curve_2d_crtd_ids) #---------------------------------------------------------------------

Main Index

226 PCL Reference Manual Examples
Display Menu

ga_display_nspe_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_nspe_get() # # This file opens a new database "new.db" and # creates a surface and meshes it. Later it gets # the number of segments per edge. Finally it # sets the number of segments per edge and # gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_nspe_get() # has the following arguments: # # ga_display_nspe_get # ( display_name, # number_of_segments ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_number_of_segments INTEGER i_return_value INTEGER i_fem_create_num_nodes INTEGER i_fem_create_num_elems STRING sv_fem_create_nodes_created[VIRTUAL] STRING sv_fem_create_elems_created[VIRTUAL] STRING sv_asm_line_3point_crtd_ids[VIRTUAL] STRING sv_sgm_sweep_surface_e_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a surface by extruding a curve and mesh it. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[1 -0.5 0]", "[1.5 0.25 0]", 1, 0.5, @ sv_asm_line_3point_crtd_ids ) dump i_return_value i_return_value = @ sgm_const_surface_extrude( "1", "<0 0 01>",1.,@ 0., "[0 0 0]", "Coord 0", "Curve 1 ", @ sv_sgm_sweep_surface_e_crtd_ids ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, @ "Surface 1 ", 1, [0.5], "Quad8", "1", "1" @ ,"Coord 0","Coord 0",i_fem_create_num_nodes@ , i_fem_create_num_elems, @ sv_fem_create_nodes_created, sv_fem_create_elems_created ) dump i_return_value i_return_value = ga_view_aa_set( 30., 0., -15. ) dump i_return_value node_label( TRUE ) #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 227
Display Menu

# Get the number of line segments per edge. s_display_name = "general" i_return_value = @ ga_display_nspe_get @ ( s_display_name, @ i_number_of_segments ) dump i_return_value dump i_number_of_segments #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the number of line segments per edge. IF (i_number_of_segments == 0 ) THEN i_number_of_segments = 10 ELSE i_number_of_segments = 0 ENDIF i_return_value = @ ga_display_nspe_set @ ( s_display_name, @ i_number_of_segments ) dump i_return_value # Reset the value i_number_of_segments = 100 #--------------------------------------------------------------------# Get the number of line segments per edge. i_return_value = @ ga_display_nspe_get @ ( s_display_name, @ i_number_of_segments ) dump i_return_value dump i_number_of_segments sys_free_string(sv_fem_create_nodes_created) sys_free_string(sv_fem_create_elems_created) sys_free_string(sv_asm_line_3point_crtd_ids) sys_free_string(sv_sgm_sweep_surface_e_crtd_ids) #---------------------------------------------------------------------

ga_display_nspe_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_nspe_set() # # This file opens a new database "new.db" and # creates a surface and meshes it. Later it gets # the number of segments per edge. Finally it # sets the number of segments per edge and # gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_nspe_set() # has the following arguments: # # ga_display_nspe_set # ( display_name, # number_of_segments ) # #--------------------------------------------------------------------# Variable Declarations

Main Index

228 PCL Reference Manual Examples
Display Menu

STRING s_display_name[32] INTEGER i_number_of_segments INTEGER i_return_value INTEGER i_fem_create_num_nodes INTEGER i_fem_create_num_elems STRING sv_fem_create_nodes_created[VIRTUAL] STRING sv_fem_create_elems_created[VIRTUAL] STRING sv_asm_line_3point_crtd_ids[VIRTUAL] STRING sv_sgm_sweep_surface_e_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a surface by extruding a curve and mesh it. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[1 -0.5 0]", "[1.5 0.25 0]", 1, 0.5, @ sv_asm_line_3point_crtd_ids ) dump i_return_value i_return_value = @ sgm_const_surface_extrude( "1", "<0 0 01>",1.,@ 0., "[0 0 0]", "Coord 0", "Curve 1 ", @ sv_sgm_sweep_surface_e_crtd_ids ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, @ "Surface 1 ", 1, [0.5], "Quad8", "1", "1" @ ,"Coord 0","Coord 0",i_fem_create_num_nodes@ , i_fem_create_num_elems, @ sv_fem_create_nodes_created, sv_fem_create_elems_created ) dump i_return_value i_return_value = ga_view_aa_set( 30., 0., -15. ) dump i_return_value node_label( TRUE ) #--------------------------------------------------------------------# Get the number of line segments per edge. s_display_name = "general" i_return_value = @ ga_display_nspe_get @ ( s_display_name, @ i_number_of_segments ) dump i_return_value dump i_number_of_segments #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the number of line segments per edge. IF (i_number_of_segments == 0 ) THEN i_number_of_segments = 10 ELSE i_number_of_segments = 0 ENDIF i_return_value = @ ga_display_nspe_set @ ( s_display_name, @ i_number_of_segments ) dump i_return_value # Reset the value i_number_of_segments = 100 #--------------------------------------------------------------------# Get the number of line segments per edge.

Main Index

Chapter 2: Basic Functions 229
Display Menu

i_return_value = ga_display_nspe_get ( s_display_name, i_number_of_segments ) dump i_return_value dump i_number_of_segments

@ @ @

sys_free_string(sv_fem_create_nodes_created) sys_free_string(sv_fem_create_elems_created) sys_free_string(sv_asm_line_3point_crtd_ids) sys_free_string(sv_sgm_sweep_surface_e_crtd_ids) #---------------------------------------------------------------------

ga_display_offsets_get

()

# # Purpose : This file provides an example of a call to # the function ga_display_offsets_get() # # This session file will create a new database by # name ’new.db’ and create a curve. Properties # will be applied to the curve by using a dummy # material and a beam section. The value of # offset status will be twice changed and the # vector plot of element offset will be taken. # The offset status will be get. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_offsets_get() # has the following arguments: # # ga_display_offsets_get # ( display_name, # offset_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_offset_status INTEGER i_return_value STRING sv_asm_line_2point_crtd_ids[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_nodes_created[VIRTUAL] STRING sv_elems_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a curve. i_return_value = @ asm_const_line_2point( "1", "[ 1 3 0 ] ", "[ 5@ 7 0 ] ", 0, "", 50., 1, sv_asm_line_2point_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Meshing the curve with a single element. i_return_value = @ fem_create_mesh_curv( "Curve 1 ", 10., "Bar2",@ "1", "1", "Coord 0", "Coord 0", i_num_nodes@ , i_num_elems, sv_nodes_created, sv_elems_created ) dump i_return_value

Main Index

230 PCL Reference Manual Examples
Display Menu

#--------------------------------------------------------------------# Create a beam section and assign property to the curve. i_return_value = @ beam_section_create( "bm", "I", ["1",".5",".5",".1",".1",".1"] ) dump i_return_value i_return_value = @ elementprops_create( "Ibeam", 11, 2, 42, 1, 1,@ 20, [13, 6, 4042, 4043, 2047, 2048, 1, 10, @ 11, 4026, 1026, 4044, 4045, 4037, 4047, @ 4048, 4050, 4051, 4053, 4054, 4056, 4057, @ 4061], [5, 2, 2, 2, 4, 4, 1, 1, 1, 1, 1, 1,@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6], @ ["m:dummy", "<1 1 1>", "<0.2 0. 0.2>", @ "<0.5 0. 0.5>", "", "", " 0.18000001", @ " 0.024600001", " 0.0021500001", " 0.", @ " 0.00063333334", " 0.44444445", @ " 0.55555558", "", " 0.5", " 0.25", " -0.5"@ , " 0.25", " -0.5", " -0.25", " 0.5", " -0.25", ""], "Curve 1" ) dump i_return_value #--------------------------------------------------------------------# Calling function to set the offset status. i_offset_status = 1 s_display_name = "general" # i_return_value = @ ga_display_offsets_set @ ( s_display_name, @ i_offset_status ) dump i_return_value #--------------------------------------------------------------------# Calling function to display the offset specified. i_return_value = @ elementprops_show( "Offset @ Node 1", @ "Vector Plot", ["default_group"] ) dump i_return_value #--------------------------------------------------------------------# Calling function to set the offset status. i_offset_status = 0 # i_return_value = @ ga_display_offsets_set @ ( s_display_name, @ i_offset_status ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to display the offset specified. i_return_value = @ elementprops_show( "Offset @ Node 1", @ "Vector Plot", ["default_group"] ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the offset status. # i_return_value = @ ga_display_offsets_get @ ( s_display_name, @ i_offset_status ) dump i_return_value, i_offset_status sys_free_string(sv_asm_line_2point_crtd_ids) sys_free_string(sv_nodes_created) sys_free_string(sv_elems_created) #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 231
Display Menu

ga_display_offsets_set

()

# # Purpose : This file provides an example of two calls to # the function ga_display_offsets_set() # # This session file will create a new database by # name ’new.db’ and create a curve. Properties # will be applied to the curve by using a dummy # material and a beam section. The value of # offset status will be twice changed and the # vector plot of element offset will be taken. # The offset status will be get. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_offsets_set() # has the following arguments: # # ga_display_offsets_set # ( display_name, # offset_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_offset_status INTEGER i_return_value STRING sv_asm_line_2point_crtd_ids[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_nodes_created[VIRTUAL] STRING sv_elems_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a curve. i_return_value = @ asm_const_line_2point( "1", "[ 1 3 0 ] ", "[ 5@ 7 0 ] ", 0, "", 50., 1, sv_asm_line_2point_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Meshing the curve with a single element. i_return_value = @ fem_create_mesh_curv( "Curve 1 ", 10., "Bar2",@ "1", "1", "Coord 0", "Coord 0", i_num_nodes@ , i_num_elems, sv_nodes_created, sv_elems_created ) dump i_return_value #--------------------------------------------------------------------# Create a beam section and assign property to the curve. i_return_value = @ beam_section_create( "bm", "I", ["1",".5",".5",".1",".1",".1"] ) dump i_return_value i_return_value = @ elementprops_create( "Ibeam", 11, 2, 42, 1, 1,@ 20, [13, 6, 4042, 4043, 2047, 2048, 1, 10, @ 11, 4026, 1026, 4044, 4045, 4037, 4047, @ 4048, 4050, 4051, 4053, 4054, 4056, 4057, @ 4061], [5, 2, 2, 2, 4, 4, 1, 1, 1, 1, 1, 1,@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6], @

Main Index

232 PCL Reference Manual Examples
Display Menu

["m:dummy", "<1 1 1>", "<0.2 0. 0.2>", @ "<0.5 0. 0.5>", "", "", " 0.18000001", @ " 0.024600001", " 0.0021500001", " 0.", @ " 0.00063333334", " 0.44444445", @ " 0.55555558", "", " 0.5", " 0.25", " -0.5"@ , " 0.25", " -0.5", " -0.25", " 0.5", " -0.25", ""], "Curve 1" ) dump i_return_value #--------------------------------------------------------------------# Calling function to set the offset status. i_offset_status = 1 s_display_name = "general" # i_return_value = @ ga_display_offsets_set @ ( s_display_name, @ i_offset_status ) dump i_return_value #--------------------------------------------------------------------# Calling function to display the offset specified. i_return_value = @ elementprops_show( "Offset @ Node 1", @ "Vector Plot", ["default_group"] ) dump i_return_value #--------------------------------------------------------------------# Calling function to set the offset status. i_offset_status = 0 # i_return_value = @ ga_display_offsets_set @ ( s_display_name, @ i_offset_status ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to display the offset specified. i_return_value = @ elementprops_show( "Offset @ Node 1", @ "Vector Plot", ["default_group"] ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the offset status. # i_return_value = @ ga_display_offsets_get @ ( s_display_name, @ i_offset_status ) dump i_return_value, i_offset_status sys_free_string(sv_asm_line_2point_crtd_ids) sys_free_string(sv_nodes_created) sys_free_string(sv_elems_created) #---------------------------------------------------------------------

ga_display_parametric_get
# # # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_parametric_get() This file opens a new database "new.db" and creates a surface and gets the status for display of parametric directions. Later it sets the status for display of parametric directions and gets it again.

Main Index

Chapter 2: Basic Functions 233
Display Menu

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_parametric_get() # has the following arguments: # # ga_display_parametric_get # ( display_name, # parametric_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_parametric_status STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface. i_return_value = @ asm_const_patch_xyz( "1","<1 1 0>","[0 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value # s_display_name = "general" s_display_name = "general" # Get the status for display of parametric directions. i_return_value = @ ga_display_parametric_get @ ( s_display_name, @ i_parametric_status ) dump i_return_value dump i_parametric_status # Note the display of parametric directions on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the status for display of parametric directions. IF (i_parametric_status == 0 ) THEN i_parametric_status = 1 ELSE i_parametric_status = 0 ENDIF i_return_value = ga_display_parametric_set ( s_display_name, i_parametric_status ) dump i_return_value # Reset the value i_parametric_status = 100 @ @ @

# Get the status for display of parametric directions. i_return_value = @ ga_display_parametric_get @ ( s_display_name, @ i_parametric_status ) dump i_return_value dump i_parametric_status

Main Index

234 PCL Reference Manual Examples
Display Menu

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_parametric_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_parametric_set() # # This file opens a new database "new.db" and # creates a surface and gets the status for # display of parametric directions. Later it # sets the status for display of parametric # directions and gets it again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_parametric_set() # has the following arguments: # # ga_display_parametric_set # ( display_name, # parametric_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_parametric_status STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface. i_return_value = @ asm_const_patch_xyz( "1","<1 1 0>","[0 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value # s_display_name = "general" s_display_name = "general" # Get the status for display of parametric directions. i_return_value = @ ga_display_parametric_get @ ( s_display_name, @ i_parametric_status ) dump i_return_value dump i_parametric_status # Note the display of parametric directions on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the status for display of parametric directions. IF (i_parametric_status == 0 ) THEN i_parametric_status = 1 ELSE i_parametric_status = 0 ENDIF i_return_value = @

Main Index

Chapter 2: Basic Functions 235
Display Menu

ga_display_parametric_set ( s_display_name, i_parametric_status ) dump i_return_value # Reset the value i_parametric_status = 100

@ @

# Get the status for display of parametric directions. i_return_value = @ ga_display_parametric_get @ ( s_display_name, @ i_parametric_status ) dump i_return_value dump i_parametric_status SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_rename

()

# # Purpose : This file provides an example of a call to the # function ga_display_rename() # # This file opens a new database "new.db" and # gets the names of display property list. Later # it renames the named display property "general" # to "new_display_name" and again gets the names # of display property list. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_rename() # has the following arguments: # # ga_display_rename # ( original_name, # new_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_original_name[32] STRING s_new_name[32] STRING sa_display_list[32](4) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # s_original_name = "general" s_original_name = "general" # s_new_name = "new_display_name" s_new_name = "new_display_name" i_return_value = @ ga_display_displays_get @ ( sa_display_list ) dump i_return_value # The list of named display properties (Before renaming). dump sa_display_list i_return_value = @

Main Index

236 PCL Reference Manual Examples
Display Menu

ga_display_rename ( s_original_name, s_new_name ) dump i_return_value

@ @

i_return_value = @ ga_display_displays_get @ ( sa_display_list ) dump i_return_value # The list of named display properties (After renaming). dump sa_display_list # Note the change of display property name # "general" to "new_display_name" #---------------------------------------------------------------------

ga_display_result_label_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_result_label_get() # # In this example field.db is opened and # displacement fringe results are posted. Then # this function is called to get the status # value for display of results labels. The # result label status is changed using function # ga_display_result_label_set() and this # function is again called to get the status # value for display of result labels. # # Before running this session file run field.ses # to create field.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_result_label_get() # has the following arguments: # # ga_display_result_label_get # ( display_name, # result_label_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_result_label_status INTEGER i_return_value #--------------------------------------------------------------------# Open "field.db" uil_file_open.go( "field.db" ) # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Plot the displacement fringes i_return_value = res_init_fringe_plot( dump i_return_value )

i_return_value = res_create_fringe_plot_rec3( 1, 2, 1, 1, 1, 1, @ 0, 0, 1., "", 1, 2, 3, 23, 1, 1, 0., 30, 0, 1 )

Main Index

Chapter 2: Basic Functions 237
Display Menu

dump i_return_value i_return_value = res_make_fringe_plot( 1, [1], [1], [""], [0.], @ ["Default, Static Subcase: Displacements, Translational"// @ " (VEC-MAG) -MSC.Nastran" ] ) dump i_return_value i_return_value = res_deinit_fringe_plot( dump i_return_value )

#--------------------------------------------------------------------# Get the status value for display of results labels. s_display_name = "general" @ @ @

i_return_value = ga_display_result_label_get ( s_display_name, i_result_label_status ) dump i_return_value dump i_result_label_status

#--------------------------------------------------------------------# Set the status value for display of results labels. i_return_value = @ ga_display_result_label_set @ ( s_display_name, 1 ) dump i_return_value #--------------------------------------------------------------------# Get the status value for display of results labels. i_return_value = @ ga_display_result_label_get @ ( s_display_name, @ i_result_label_status ) dump i_return_value dump i_result_label_status #---------------------------------------------------------------------

ga_display_result_label_set
# # # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_display_result_label_set() In this example field.db is opened and displacement fringe results are posted. Then the function ga_display_result_label_get() is called to get the status value for display of results labels. The result label status is changed using this function. The change in the result label status values is verified in the end. Before running this session file run field.ses to create field.db This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_display_result_label_set() has the following arguments: ga_display_result_label_set

Main Index

238 PCL Reference Manual Examples
Display Menu

# ( display_name, # result_label_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_result_label_status INTEGER i_return_value #--------------------------------------------------------------------# Open "field.db" uil_file_open.go( "field.db" ) # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Plot the displacement fringes i_return_value = res_init_fringe_plot( dump i_return_value )

i_return_value = res_create_fringe_plot_rec3( 1, 2, 1, 1, 1, 1, @ 0, 0, 1., "", 1, 2, 3, 23, 1, 1, 0., 30, 0, 1 ) dump i_return_value i_return_value = res_make_fringe_plot( 1, [1], [1], [""], [0.], @ ["Default, Static Subcase: Displacements, Translational"// @ " (VEC-MAG) -MSC.Nastran" ] ) dump i_return_value i_return_value = res_deinit_fringe_plot( dump i_return_value )

#--------------------------------------------------------------------# Get the status value for display of results labels. i_return_value = ga_display_result_label_get ( "general", i_result_label_status ) dump i_return_value dump i_result_label_status @ @ @

#--------------------------------------------------------------------# Set the status value for display of results labels. s_display_name = "general" i_result_label_status = 1 i_return_value = ga_display_result_label_set ( s_display_name, i_result_label_status ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Reset the variable equal to 0 i_result_label_status = 0 #--------------------------------------------------------------------# Get the status value for display of results labels. i_return_value = ga_display_result_label_get ( s_display_name, i_result_label_status ) dump i_return_value @ @ @

Main Index

Chapter 2: Basic Functions 239
Display Menu

dump i_result_label_status #---------------------------------------------------------------------

ga_display_result_lblformat_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_result_lblformat_get() # # In this example field.db is opened and the # displacement fringe results are posted. Then # this function is called to get the format # value of the result labels. The format value # of result label is changed using function # ga_display_result_lblformat_set() and this # function is called again to get the format. # # Before running this session file run field.ses # to create field.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_result_lblformat_get() # has the following arguments: # # ga_display_result_lblformat_get # ( display_name, # label_format ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[16] STRING s_label_format[16] INTEGER i_return_value #--------------------------------------------------------------------# Open "field.db" uil_file_open.go( "field.db" ) # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Plot the displacement fringes i_return_value = res_init_fringe_plot( dump i_return_value )

i_return_value = res_create_fringe_plot_rec3( 1, 2, 1, 1, 1, 1, @ 0, 0, 1., "", 1, 2, 3, 23, 1, 1, 0., 30, 0, 1 ) dump i_return_value i_return_value = res_make_fringe_plot( 1, [1], [1], [""], [0.], @ ["Default, Static Subcase: Displacements, Translational"// @ " (VEC-MAG) -MSC.Nastran" ] ) dump i_return_value i_return_value = res_deinit_fringe_plot( dump i_return_value )

#--------------------------------------------------------------------# Get the format value of the result labels

Main Index

240 PCL Reference Manual Examples
Display Menu

s_display_name = "general" i_return_value = ga_display_result_lblformat_get ( s_display_name, s_label_format ) dump i_return_value dump s_label_format @ @ @

#--------------------------------------------------------------------# Set the format value of the result labels i_return_value = @ ga_display_result_lblformat_set @ ( s_display_name, @ "LETTER" ) dump i_return_value #--------------------------------------------------------------------# Get the format value of the result labels i_return_value = @ ga_display_result_lblformat_get @ ( s_display_name, @ s_label_format ) dump i_return_value dump s_label_format #---------------------------------------------------------------------

ga_display_result_lblformat_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_result_lblformat_set() # # In this example field.db is opened and the # displacement fringe results are posted. Then # the function,ga_display_result_lblformat_get() # is called to get the format value of the # result labels. The format value of result # label is changed using this function. The # change in format is verified in the end. # # Before running this session file run field.ses # to create field.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_result_lblformat_set() # has the following arguments: # # ga_display_result_lblformat_set # ( display_name, # label_format ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[16] STRING s_label_format[16] INTEGER i_return_value #--------------------------------------------------------------------# Open "field.db" uil_file_open.go( "field.db" )

Main Index

Chapter 2: Basic Functions 241
Display Menu

# Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Plot the displacement fringes i_return_value = res_init_fringe_plot( dump i_return_value )

i_return_value = res_create_fringe_plot_rec3( 1, 2, 1, 1, 1, 1, @ 0, 0, 1., "", 1, 2, 3, 23, 1, 1, 0., 30, 0, 1 ) dump i_return_value i_return_value = res_make_fringe_plot( 1, [1], [1], [""], [0.], @ ["Default, Static Subcase: Displacements, Translational"// @ " (VEC-MAG) -MSC.Nastran" ] ) dump i_return_value i_return_value = res_deinit_fringe_plot( dump i_return_value )

#--------------------------------------------------------------------# Get the format value of the result labels i_return_value = ga_display_result_lblformat_get ( "general", s_label_format ) dump i_return_value dump s_label_format @ @ @

#--------------------------------------------------------------------# Set the format value of the result labels s_display_name = "general" s_label_format = "LETTER" i_return_value = ga_display_result_lblformat_set ( s_display_name, s_label_format ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Resetting the variable to null string s_label_format = "" #--------------------------------------------------------------------# Get the format value of the result labels i_return_value = ga_display_result_lblformat_get ( s_display_name, s_label_format ) dump i_return_value dump s_label_format @ @ @

#---------------------------------------------------------------------

ga_display_showedges_get
# # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_showedges_get()

Main Index

242 PCL Reference Manual Examples
Display Menu

# This file opens a new database "new.db" and # creates a surface,shades it. Later it gets # the status of showing edges. Finally it sets # the status and gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_showedges_get() # has the following arguments: # # ga_display_showedges_get # ( display_name, # edge_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_edge_status INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # s_display_name = "general" s_display_name = "general" # Create a surface. i_return_value = @ asm_const_patch_xyz( "1","<1 1 0>","[0 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") # Get the status for showing edge. i_return_value = ga_display_showedges_get ( s_display_name, i_edge_status ) dump i_return_value dump i_edge_status @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the status for showing edge. IF (i_edge_status == 0 ) THEN i_edge_status = 1 ELSE i_edge_status = 0 ENDIF i_return_value = ga_display_showedges_set ( s_display_name, i_edge_status ) dump i_return_value # Reset the value to some value. i_edge_status = 100 # Get the status for showing edge. i_return_value = ga_display_showedges_get @ @

@ @ @

Main Index

Chapter 2: Basic Functions 243
Display Menu

s_display_name, i_edge_status ) dump i_return_value dump i_edge_status

(

@

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_showedges_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_showedges_set() # # This file opens a new database "new.db" and # creates a surface,shades it. Later it gets # the status of showing edges. Finally it sets # the status and gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_showedges_set() # has the following arguments: # # ga_display_showedges_set # ( display_name, # edge_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_edge_status INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # s_display_name = "general" s_display_name = "general" # Create a surface. i_return_value = @ asm_const_patch_xyz( "1","<1 1 0>","[0 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") # Get the status for showing edge. i_return_value = ga_display_showedges_get ( s_display_name, i_edge_status ) dump i_return_value dump i_edge_status @ @ @

# Note the change in the edge. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the status for showing edge. IF (i_edge_status == 0 ) THEN

Main Index

244 PCL Reference Manual Examples
Display Menu

i_edge_status = 1 ELSE i_edge_status = 0 ENDIF i_return_value = ga_display_showedges_set ( s_display_name, i_edge_status ) dump i_return_value # Set the value to some value. i_edge_status = 100 # Get the status for showing edge. i_return_value = ga_display_showedges_get ( s_display_name, i_edge_status ) dump i_return_value dump i_edge_status

@ @ @

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_shrfem_get

()

# # Purpose : This file provides an example of two calls # to the function ga_display_shrfem_get() # # This file open a new database "new.db" and # creates a surface and meshes it. Later it # shrinks the fem entities. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_shrfem_get() # has the following arguments: # # ga_display_shrfem_get # ( display_name, # shrink_factor ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] REAL r_shrink_factor INTEGER i_fem_create_mesh_surfa_num_no INTEGER i_fem_create_mesh_surfa_num_el STRING sv_fem_create_mesh_s_nodes[VIRTUAL] STRING sv_fem_create_mesh_s_elems[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and mesh it. i_return_value = @ asm_const_patch_xyz( "1","<1 1 0>","[0 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value

Main Index

Chapter 2: Basic Functions 245
Display Menu

i_return_value = mesh_seed_create ( "Surface 1.1 1.2 1.3 1.4 ", 1, 2, 0., 0., 0. ) dump i_return_value

@ @ @

i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, @ "Surface 1 ", 1, [0.1], "Quad4", "1", "1", @ "Coord 0", "Coord 0", @ i_fem_create_mesh_surfa_num_no, @ i_fem_create_mesh_surfa_num_el, @ sv_fem_create_mesh_s_nodes, @ sv_fem_create_mesh_s_elems) dump i_return_value # s_display_name = "general" s_display_name = "general" i_return_value = ga_display_shrfem_get ( s_display_name, r_shrink_factor ) dump i_return_value dump r_shrink_factor @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the shrink factor. r_shrink_factor = 0.5 i_return_value = ga_display_shrfem_set ( s_display_name, r_shrink_factor ) dump i_return_value # Reset the value r_shrink_factor = 100.0 i_return_value = ga_display_shrfem_get ( s_display_name, r_shrink_factor ) dump i_return_value dump r_shrink_factor

@ @ @

@ @ @

SYS_FREE_STRING(sv_fem_create_mesh_s_nodes) SYS_FREE_STRING(sv_fem_create_mesh_s_elems) SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_shrfem_set
# # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_display_shrfem_set() This file open a new database "new.db" and creates a surface and meshes it. Later it shrinks the fem entities. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

Main Index

246 PCL Reference Manual Examples
Display Menu

# The function ga_display_shrfem_set() # has the following arguments: # # ga_display_shrfem_set # ( display_name, # shrink_factor ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] REAL r_shrink_factor INTEGER i_fem_create_mesh_surfa_num_no INTEGER i_fem_create_mesh_surfa_num_el STRING sv_fem_create_mesh_s_nodes[VIRTUAL] STRING sv_fem_create_mesh_s_elems[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and mesh it. i_return_value = @ asm_const_patch_xyz( "1","<1 1 0>","[0 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value i_return_value = mesh_seed_create ( "Surface 1.1 1.2 1.3 1.4 ", 1, 2, 0., 0., 0. ) dump i_return_value @ @ @

i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, @ "Surface 1 ", 1, [0.1], "Quad4", "1", "1", @ "Coord 0", "Coord 0", @ i_fem_create_mesh_surfa_num_no, @ i_fem_create_mesh_surfa_num_el, @ sv_fem_create_mesh_s_nodes, @ sv_fem_create_mesh_s_elems) dump i_return_value # s_display_name = "general" s_display_name = "general" i_return_value = ga_display_shrfem_get ( s_display_name, r_shrink_factor ) dump i_return_value dump r_shrink_factor @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the shrink factor. r_shrink_factor = 0.5 i_return_value = ga_display_shrfem_set ( s_display_name, r_shrink_factor ) dump i_return_value # Reset the value r_shrink_factor = 100.0 i_return_value =

@ @ @

@

Main Index

Chapter 2: Basic Functions 247
Display Menu

ga_display_shrfem_get ( s_display_name, r_shrink_factor ) dump i_return_value dump r_shrink_factor

@ @

SYS_FREE_STRING(sv_fem_create_mesh_s_nodes) SYS_FREE_STRING(sv_fem_create_mesh_s_elems) SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_silhouette_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_silhouette_get() # # In this example field.db database is opened and # displacement deformation plot is posted. Then # this function is called to get the status of # the silhouette display. The status is changed # and this function is called again for getting # the status of the silhouette display. # # Before running this session file run field.ses # to create field.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_silhouette_get() # has the following arguments: # # ga_display_silhouette_get # ( display_name, # silhouette_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_silhouette_status INTEGER i_return_value #--------------------------------------------------------------------# Open "field.db" uil_file_open.go( "field.db" ) # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Plot displacement deformation i_return_value = res_init_deform_plot( dump i_return_value ) @

i_return_value = res_create_deform_plot_rec2( 2, 2, 1, 3, [27, 28, 29, 0, 0, 0], 1, 1, 0., 8, 0, 1, 0, [0., 0., 0.] ) dump i_return_value

i_return_value = res_make_deform_plot( 1, [1], [1], [""], [0.], @ ["Default, Static Subcase: Displacements, Translational"// @ " -MSC.Nastran"] ) dump i_return_value

Main Index

248 PCL Reference Manual Examples
Display Menu

i_return_value = res_deinit_deform_plot( dump i_return_value

)

#--------------------------------------------------------------------# Get the status on display of silhouettes s_display_name = "general" i_return_value = ga_display_silhouette_get ( s_display_name, i_silhouette_status ) dump i_return_value dump i_silhouette_status @ @ @

#--------------------------------------------------------------------# Set the status on display of silhouettes i_return_value = ga_display_silhouette_set ( s_display_name, 1 ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Get the status on display of silhouettes i_return_value = ga_display_silhouette_get ( s_display_name, i_silhouette_status ) dump i_return_value dump i_silhouette_status @ @ @

#---------------------------------------------------------------------

ga_display_silhouette_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_silhouette_set() # # In this example field.db database is opened and # displacement deformation plot is posted. Then # the status of the silhouette display is get. # The status will be changed using this function # and the status of the silhouette display is get # again. # # Before running this session file run field.ses # to create field.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_silhouette_set() # has the following arguments: # # ga_display_silhouette_set # ( display_name, # silhouette_status ) # #--------------------------------------------------------------------# Variable Declarations

Main Index

Chapter 2: Basic Functions 249
Display Menu

STRING s_display_name[32] INTEGER i_silhouette_status INTEGER i_return_value #--------------------------------------------------------------------# Open "field.db" uil_file_open.go( "field.db" ) # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Plot displacement deformation i_return_value = res_init_deform_plot( dump i_return_value ) @

i_return_value = res_create_deform_plot_rec2( 2, 2, 1, 3, [27, 28, 29, 0, 0, 0], 1, 1, 0., 8, 0, 1, 0, [0., 0., 0.] ) dump i_return_value

i_return_value = res_make_deform_plot( 1, [1], [1], [""], [0.], @ ["Default, Static Subcase: Displacements, Translational"// @ " -MSC.Nastran"] ) dump i_return_value i_return_value = res_deinit_deform_plot( dump i_return_value )

#--------------------------------------------------------------------# Get the status on display of silhouettes s_display_name = "general" i_return_value = ga_display_silhouette_get ( s_display_name, i_silhouette_status ) dump i_return_value dump i_silhouette_status @ @ @

#--------------------------------------------------------------------# Set the status on display of silhouettes i_silhouette_status = 1 i_return_value = ga_display_silhouette_set ( s_display_name, i_silhouette_status ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Resetting the variable to 0 i_silhouette_status = 0 #--------------------------------------------------------------------# Get the status on display of silhouettes i_return_value = ga_display_silhouette_get ( s_display_name, i_silhouette_status ) dump i_return_value dump i_silhouette_status @ @ @

#---------------------------------------------------------------------

Main Index

250 PCL Reference Manual Examples
Display Menu

ga_display_specular_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_specular_get() # # This file opens a new database "new.db" and # creates a surface and renders it. Later it # sets the texture to rough appearance. Then # it gets the status of color used for shading # of specular reflections. Finally it sets # the status of color and gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_specular_get() # has the following arguments: # # ga_display_specular_get # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_color_value INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and render it. i_return_value = @ asm_const_patch_xyz( "1","<1 1 0>","[0 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") # s_display_name = "general" s_display_name = "general" # Set the texture. i_return_value = ga_display_texture_set ( s_display_name, 1.0 ) dump i_return_value @ @ @

# Get the value used to control the color used for shading of # specular reflections. i_return_value = @ ga_display_specular_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value # Session file paused. Press "Resume" to continue.. sf_pause()

Main Index

Chapter 2: Basic Functions 251
Display Menu

# Set the value used to control the color used for shading of # specular reflections. IF ( i_color_value == 1) THEN i_color_value = 2 ELSE i_color_value = 1 ENDIF i_return_value = ga_display_specular_set ( s_display_name, i_color_value ) dump i_return_value # Reset the value. i_color_value = 0 @ @ @

# Get the value used to control the color used for shading of # specular reflections. i_return_value = @ ga_display_specular_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_specular_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_specular_set() # # This file opens a new database "new.db" and # creates a surface and renders it. Later it # sets the texture to rough appearance. Then # it gets the status of color used for shading # of specular reflections. Finally it sets # the status of color and gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_specular_set() # has the following arguments: # # ga_display_specular_set # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_color_value INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and render it. i_return_value = @ asm_const_patch_xyz( "1","<1 1 0>","[0 0 0]", @

Main Index

252 PCL Reference Manual Examples
Display Menu

"Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") # s_display_name = "general" s_display_name = "general" # Set the texture. i_return_value = ga_display_texture_set ( s_display_name, 1.0 ) dump i_return_value @ @ @

# Get the value used to control the color used for shading of # specular reflections. i_return_value = @ ga_display_specular_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value # Note the change on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the value used to control the color used for shading of # specular reflections. IF ( i_color_value == 1) THEN i_color_value = 2 ELSE i_color_value = 1 ENDIF i_return_value = ga_display_specular_set ( s_display_name, i_color_value ) dump i_return_value # Reset the value. i_color_value = 0 @ @ @

# Get the value used to control the color used for shading of # specular reflections. i_return_value = @ ga_display_specular_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_subdivision_get
# # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_subdivision_get() This session file will open a new database by name ’new.db’ and create a surface. The surface will be meshed using Quad8 elements and the subdivision tolerance will be read. After a

Main Index

Chapter 2: Basic Functions 253
Display Menu

# pause the tolerance will be set and get again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_subdivision_get() # has the following arguments: # # ga_display_subdivision_get # ( display_name, # tolerance ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] REAL r_tolerance INTEGER i_return_value INTEGER i_fem_create_num_nodes INTEGER i_fem_create_num_elems STRING sv_fem_create_nodes_created[VIRTUAL] STRING sv_fem_create_elems_created[VIRTUAL] STRING sv_asm_line_3point_crtd_ids[VIRTUAL] STRING sv_sgm_sweep_surface_e_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a surface by extruding a curve and mesh it. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[1 -0.5 0]", "[1.5 0.25 0]", 1, 0.5, @ sv_asm_line_3point_crtd_ids ) dump i_return_value i_return_value = @ sgm_const_surface_extrude( "1", "<0 0 01>",1.,@ 0., "[0 0 0]", "Coord 0", "Curve 1 ", @ sv_sgm_sweep_surface_e_crtd_ids ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, @ "Surface 1 ", 1, [0.5], "Quad8", "1", "1" @ ,"Coord 0","Coord 0",i_fem_create_num_nodes@ , i_fem_create_num_elems, @ sv_fem_create_nodes_created, sv_fem_create_elems_created ) dump i_return_value i_return_value = ga_view_aa_set( 30., 0., -15. ) dump i_return_value node_label( TRUE ) #--------------------------------------------------------------------# Calling function to get the subdivision tolerance. s_display_name = "general" # i_return_value = @ ga_display_subdivision_get @ ( s_display_name, @ r_tolerance ) dump i_return_value, r_tolerance #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #---------------------------------------------------------------------

Main Index

254 PCL Reference Manual Examples
Display Menu

# Calling function to set the subdivision tolerance. r_tolerance = 0.005 # i_return_value = @ ga_display_subdivision_set @ ( s_display_name, @ r_tolerance ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the subdivision tolerance. # i_return_value = @ ga_display_subdivision_get @ ( s_display_name, @ r_tolerance ) dump i_return_value, r_tolerance sys_free_string(sv_fem_create_nodes_created) sys_free_string(sv_fem_create_elems_created) sys_free_string(sv_asm_line_3point_crtd_ids) sys_free_string(sv_sgm_sweep_surface_e_crtd_ids) #---------------------------------------------------------------------

ga_display_subdivision_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_subdivision_set() # # This session file will open a new database by # name ’new.db’ and create a surface. The surface # will be meshed using Quad8 elements and the # subdivision tolerance will be read. After a # pause the tolerance will be set and get again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_subdivision_set() # has the following arguments: # # ga_display_subdivision_set # ( display_name, # tolerance ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] REAL r_tolerance INTEGER i_return_value INTEGER i_fem_create_num_nodes INTEGER i_fem_create_num_elems STRING sv_fem_create_nodes_created[VIRTUAL] STRING sv_fem_create_elems_created[VIRTUAL] STRING sv_asm_line_3point_crtd_ids[VIRTUAL] STRING sv_sgm_sweep_surface_e_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a surface by extruding a curve and mesh it. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[1 -0.5 0]", "[1.5 0.25 0]", 1, 0.5, @

Main Index

Chapter 2: Basic Functions 255
Display Menu

sv_asm_line_3point_crtd_ids ) dump i_return_value i_return_value = @ sgm_const_surface_extrude( "1", "<0 0 01>",1.,@ 0., "[0 0 0]", "Coord 0", "Curve 1 ", @ sv_sgm_sweep_surface_e_crtd_ids ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, @ "Surface 1 ", 1, [0.5], "Quad8", "1", "1" @ ,"Coord 0","Coord 0",i_fem_create_num_nodes@ , i_fem_create_num_elems, @ sv_fem_create_nodes_created, sv_fem_create_elems_created ) dump i_return_value i_return_value = ga_view_aa_set( 30., 0., -15. ) dump i_return_value node_label( TRUE ) #--------------------------------------------------------------------# Calling function to get the subdivision tolerance. s_display_name = "general" # i_return_value = @ ga_display_subdivision_get @ ( s_display_name, @ r_tolerance ) dump i_return_value, r_tolerance #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to set the subdivision tolerance. r_tolerance = 0.005 # i_return_value = @ ga_display_subdivision_set @ ( s_display_name, @ r_tolerance ) dump i_return_value #--------------------------------------------------------------------# Calling function to get the subdivision tolerance. # i_return_value = @ ga_display_subdivision_get @ ( s_display_name, @ r_tolerance ) dump i_return_value, r_tolerance sys_free_string(sv_fem_create_nodes_created) sys_free_string(sv_fem_create_elems_created) sys_free_string(sv_asm_line_3point_crtd_ids) sys_free_string(sv_sgm_sweep_surface_e_crtd_ids) #---------------------------------------------------------------------

ga_display_texture_get
# # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_texture_get() This file opens a new database "new.db" and creates a surface and renders it. Later it gets the texture. Finally it sets the texture and gets it.

Main Index

256 PCL Reference Manual Examples
Display Menu

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_texture_get() # has the following arguments: # # ga_display_texture_get # ( display_name, # texture_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] REAL r_texture_value INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and render it. i_return_value = @ asm_const_patch_xyz( "1","<1 1 0>","[0 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") # s_display_name = "general" s_display_name = "general" # Get the texture value. i_return_value = ga_display_texture_get ( s_display_name, r_texture_value ) dump i_return_value dump r_texture_value @ @ @

# Note the change on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the texture value. IF ( r_texture_value == 1.0) THEN r_texture_value = 0.0 ELSE r_texture_value = 1.0 ENDIF i_return_value = ga_display_texture_set ( s_display_name, r_texture_value ) dump i_return_value # Reset the value. r_texture_value = 100.0 # Get the texture value. i_return_value = ga_display_texture_get ( s_display_name, r_texture_value ) dump i_return_value @ @ @

@ @ @

Main Index

Chapter 2: Basic Functions 257
Display Menu

dump r_texture_value SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_texture_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_texture_set() # # This file opens a new database "new.db" and # creates a surface and renders it. Later it # gets the texture. Finally it sets the texture # and gets it. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_texture_set() # has the following arguments: # # ga_display_texture_set # ( display_name, # texture_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING sv_asm_create_patch_xy_created[VIRTUAL] REAL r_texture_value INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface and render it. i_return_value = @ asm_const_patch_xyz( "1","<1 1 0>","[0 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value renderstyle("shaded/smooth") # s_display_name = "general" s_display_name = "general" # Get the texture value. i_return_value = ga_display_texture_get ( s_display_name, r_texture_value ) dump i_return_value dump r_texture_value @ @ @

# Note the change on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the texture value. IF ( r_texture_value == 1.0) THEN r_texture_value = 0.0 ELSE

Main Index

258 PCL Reference Manual Examples
Display Menu

r_texture_value = 1.0 ENDIF i_return_value = ga_display_texture_set ( s_display_name, r_texture_value ) dump i_return_value # Reset the value. r_texture_value = 100.0 # Get the texture value. i_return_value = ga_display_texture_get ( s_display_name, r_texture_value ) dump i_return_value dump r_texture_value @ @ @

@ @ @

SYS_FREE_STRING(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

ga_display_transparency_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_transparency_get() # # This session file will create a new database by # name ’new.db’ and create a solid. The solid # will be rendered with shaded style and the # transparency value will be get. After a pause # the transparency value will be set and get # again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_transparency_get() # has the following arguments: # # ga_display_transparency_get # ( display_name, # transparency_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] REAL r_transparency_value INTEGER i_return_value STRING sv_asm_create_hpat_xyz_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a hpat and rendering with smooth shade. i_return_value = @ asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]",@ "Coord 0", sv_asm_create_hpat_xyz_crtd_ids ) dump i_return_value i_return_value = renderstyle( "Shaded/Smooth" ) dump i_return_value @

Main Index

Chapter 2: Basic Functions 259
Display Menu

#--------------------------------------------------------------------# Calling function to read the transparency value. s_display_name = "general" # i_return_value = @ ga_display_transparency_get @ ( s_display_name, @ r_transparency_value ) dump i_return_value, r_transparency_value #--------------------------------------------------------------------# Calling function to set the transparency value. r_transparency_value = 0.5 # i_return_value = @ ga_display_transparency_set @ ( s_display_name, @ r_transparency_value ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the transparency value. # i_return_value = @ ga_display_transparency_get @ ( s_display_name, @ r_transparency_value ) dump i_return_value, r_transparency_value sys_free_string(sv_asm_create_hpat_xyz_crtd_ids) #---------------------------------------------------------------------

ga_display_transparency_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_transparency_set() # # This session file will create a new database by # name ’new.db’ and create a solid. The solid # will be rendered with shaded style and the # transparency value will be get. After a pause # the transparency value will be set and get # again. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_transparency_set() # has the following arguments: # # ga_display_transparency_set # ( display_name, # transparency_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] REAL r_transparency_value INTEGER i_return_value STRING sv_asm_create_hpat_xyz_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a hpat and rendering with smooth shade.

Main Index

260 PCL Reference Manual Examples
Display Menu

i_return_value = @ asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]",@ "Coord 0", sv_asm_create_hpat_xyz_crtd_ids ) dump i_return_value i_return_value = @ renderstyle( "Shaded/Smooth" ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the transparency value. s_display_name = "general" # i_return_value = @ ga_display_transparency_get @ ( s_display_name, @ r_transparency_value ) dump i_return_value, r_transparency_value #--------------------------------------------------------------------# Calling function to set the transparency value. r_transparency_value = 0.5 # i_return_value = @ ga_display_transparency_set @ ( s_display_name, @ r_transparency_value ) dump i_return_value #--------------------------------------------------------------------# Calling function to read the transparency value. # i_return_value = @ ga_display_transparency_get @ ( s_display_name, @ r_transparency_value ) dump i_return_value, r_transparency_value sys_free_string(sv_asm_create_hpat_xyz_crtd_ids) #---------------------------------------------------------------------

ga_display_undeform_color_get
# # # # # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_undeform_color_get() This file opens an existing database and reads in the results. Later it gets the color for display of undeformed entities. Finally it sets the color and gets it. 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. Finally copy the file "spool_res_deform.ses" to the current working directory. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_display_undeform_color_get() has the following arguments: ga_display_undeform_color_get ( display_name, color_value )

Main Index

Chapter 2: Basic Functions 261
Display Menu

#--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_color_value INTEGER i_return_value INTEGER i_flag #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_deform.ses") # s_display_name = "general" s_display_name = "general" # Set the undeform plot. i_flag = 1 i_return_value = ga_display_undeform_set ( s_display_name, i_flag ) dump i_return_value

@ @ @

# Get the color for display of undeformed entities. i_return_value = @ ga_display_undeform_color_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value # Session file paused. Press "Resume" to continue.. sf_pause() # Set the color for display of undeformed entities. IF (i_color_value == 4 ) THEN i_color_value = 5 ELSE i_color_value = 4 ENDIF i_return_value = ga_display_undeform_color_set ( s_display_name, i_color_value ) dump i_return_value # Reset the value i_color_value = 0 @ @ @

# Get the color for display of undeformed entities. i_return_value = @ ga_display_undeform_color_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value #---------------------------------------------------------------------

ga_display_undeform_color_set
# # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_display_undeform_color_set() This file opens an existing database and reads in the results. Later it gets the color for display of undeformed entities. Finally it sets the color and gets it.

Main Index

262 PCL Reference Manual Examples
Display Menu

# # 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. # Finally copy the file "spool_res_deform.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_undeform_color_set() # has the following arguments: # # ga_display_undeform_color_set # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_color_value INTEGER i_return_value INTEGER i_flag #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_deform.ses") # s_display_name = "general" s_display_name = "general" # Set the undeform plot. i_flag = 1 i_return_value = ga_display_undeform_set ( s_display_name, i_flag ) dump i_return_value

@ @ @

# Get the color for display of undeformed entities. i_return_value = @ ga_display_undeform_color_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value # Note the change of color on viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the color for display of undeformed entities. IF (i_color_value == 4 ) THEN i_color_value = 5 ELSE i_color_value = 4 ENDIF i_return_value = ga_display_undeform_color_set ( s_display_name, i_color_value ) dump i_return_value # Reset the value i_color_value = 0 # @ @ @

Get the color for display of undeformed entities.

Main Index

Chapter 2: Basic Functions 263
Display Menu

i_return_value = @ ga_display_undeform_color_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value #---------------------------------------------------------------------

ga_display_undeform_get

()

# # Purpose : This file provides an example of two calls # to the function ga_display_undeform_get() # # This file opens an existing database and reads # in the results. Later it gets the status for # control of display of undeformed entities. # Finally it sets the status and gets it. # # 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. # Finally copy the file "spool_res_deform.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_undeform_get() # has the following arguments: # # ga_display_undeform_get # ( display_name, # undeform_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_undeform_status INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_deform.ses") # s_display_name = "general" s_display_name = "general" # Get the status for control of display of undeformed entities. i_return_value = @ ga_display_undeform_get @ ( s_display_name, @ i_undeform_status ) dump i_return_value dump i_undeform_status # Note the change on plot on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the status for control of display of undeformed entities. IF (i_undeform_status == 0 ) THEN i_undeform_status = 1 ELSE i_undeform_status = 0 ENDIF

Main Index

264 PCL Reference Manual Examples
Display Menu

i_return_value = ga_display_undeform_set ( s_display_name, i_undeform_status ) dump i_return_value # Reset the value i_undeform_status = 100

@ @ @

# Get the status for control of display of undeformed entities. i_return_value = @ ga_display_undeform_get @ ( s_display_name, @ i_undeform_status ) dump i_return_value dump i_undeform_status #---------------------------------------------------------------------

ga_display_undeform_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_undeform_set() # # This file opens an existing database and reads # in the results. Later it gets the status for # control of display of undeformed entities. # Finally it sets the status and gets it. # # 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. # Finally copy the file "spool_res_deform.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_undeform_set() # has the following arguments: # # ga_display_undeform_set # ( display_name, # undeform_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_undeform_status INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_deform.ses") # s_display_name = "general" s_display_name = "general" # Get the status for control of display of undeformed entities. i_return_value = @ ga_display_undeform_get @ ( s_display_name, @ i_undeform_status ) dump i_return_value dump i_undeform_status

Main Index

Chapter 2: Basic Functions 265
Display Menu

# Note the change of plot on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the status for control of display of undeformed entities. IF (i_undeform_status == 0 ) THEN i_undeform_status = 1 ELSE i_undeform_status = 0 ENDIF i_return_value = ga_display_undeform_set ( s_display_name, i_undeform_status ) dump i_return_value # Reset the value i_undeform_status = 100 @ @ @

# Get the status for control of display of undeformed entities. i_return_value = @ ga_display_undeform_get @ ( s_display_name, @ i_undeform_status ) dump i_return_value dump i_undeform_status #---------------------------------------------------------------------

ga_display_undeform_style_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_undeform_style_get() # # This file opens an existing database and reads # in the results. Later it gets the style for # display of lines that comprise undeformed # entities. Finally it sets the style # and gets it. # # Before running this session file run spool.ses # to create spool.db.The file # "spool_res_deform.ses" should be present in # the current directory. # # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_undeform_style_get() # has the following arguments: # # ga_display_undeform_style_get # ( display_name, # curve_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING s_curve_style[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_deform.ses")

Main Index

266 PCL Reference Manual Examples
Display Menu

# s_display_name = "general" s_display_name = "general" # Get the style for display of lines that # comprise undeformed entities. i_return_value = ga_display_undeform_style_get ( s_display_name, s_curve_style ) dump i_return_value dump s_curve_style # Set the style for display of lines that # comprise undeformed entities. IF (s_curve_style == "SOLID" ) THEN s_curve_style = "DASHED" ELSE s_curve_style = "SOLID" ENDIF i_return_value = ga_display_undeform_style_set ( s_display_name, s_curve_style ) dump i_return_value # Reset the value s_curve_style = "" @ @ @

@ @ @

# Get the style for display of lines that # comprise undeformed entities. i_return_value = @ ga_display_undeform_style_get @ ( s_display_name, @ s_curve_style ) dump i_return_value dump s_curve_style #---------------------------------------------------------------------

ga_display_undeform_style_set
# # # # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_display_undeform_style_set() This file opens an existing database and reads in the results. Later it gets the style for display of lines that comprise undeformed entities. Finally it sets the style and gets it. Before running this session file run spool.ses to create spool.db.The file "spool_res_deform.ses" should be present in the current directory. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_display_undeform_style_set() has the following arguments: ga_display_undeform_style_set ( display_name, curve_style )

Main Index

Chapter 2: Basic Functions 267
Display Menu

# #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING s_curve_style[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_deform.ses") # s_display_name = "general" s_display_name = "general" # Get the style for display of lines that # comprise undeformed entities. i_return_value = ga_display_undeform_style_get ( s_display_name, s_curve_style ) dump i_return_value dump s_curve_style # Set the style for display of lines that # comprise undeformed entities. IF (s_curve_style == "SOLID" ) THEN s_curve_style = "DASHED" ELSE s_curve_style = "SOLID" ENDIF i_return_value = ga_display_undeform_style_set ( s_display_name, s_curve_style ) dump i_return_value # Reset the value s_curve_style = "" @ @ @

@ @ @

# Get the style for display of lines that # comprise undeformed entities. i_return_value = @ ga_display_undeform_style_get @ ( s_display_name, @ s_curve_style ) dump i_return_value dump s_curve_style #---------------------------------------------------------------------

ga_display_vector_color_get
# # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_vector_color_get() This file opens an existing database "spool.db" and reads the results. Later it gets the vector color used for display. Finally it sets the vector color and gets it. 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. Finally copy the file "spool_res_vector.ses" to the current working directory. This file can be run by starting a session of Patran, and running this session file

Main Index

268 PCL Reference Manual Examples
Display Menu

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector_color_get() # has the following arguments: # # ga_display_vector_color_get # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_color_value INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_vector.ses") # s_display_name = "general" s_display_name = "general" # Set the color style. i_return_value = ga_display_vector_colorstyl_set ( s_display_name, "VALUE" ) dump i_return_value # Get the vector color. i_return_value = ga_display_vector_color_get ( s_display_name, i_color_value ) dump i_return_value dump i_color_value @ @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the vector color. IF (i_color_value == 2) THEN i_color_value = 5 ELSE i_color_value = 2 ENDIF i_return_value = ga_display_vector_color_set ( s_display_name, i_color_value ) dump i_return_value # Reset the value i_color_value = 0 @ @ @

# Get the vector color. i_return_value = @ ga_display_vector_color_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 269
Display Menu

ga_display_vector_color_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_vector_color_set() # # This file opens an existing database "spool.db" # and reads the results. Later it gets the vector # color used for display. Finally it sets the # vector color and gets it. # # 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. # Finally copy the file "spool_res_vector.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector_color_set() # has the following arguments: # # ga_display_vector_color_set # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_color_value INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_vector.ses") # s_display_name = "general" s_display_name = "general" # Set the color style. i_return_value = ga_display_vector_colorstyl_set ( s_display_name, "VALUE" ) dump i_return_value # Get the vector color. i_return_value = ga_display_vector_color_get ( s_display_name, i_color_value ) dump i_return_value dump i_color_value @ @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the vector color. IF (i_color_value == 2) THEN i_color_value = 5 ELSE i_color_value = 2 ENDIF

Main Index

270 PCL Reference Manual Examples
Display Menu

i_return_value = ga_display_vector_color_set ( s_display_name, i_color_value ) dump i_return_value # Reset the value i_color_value = 0

@ @ @

# Get the vector color. i_return_value = @ ga_display_vector_color_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value #---------------------------------------------------------------------

ga_display_vector_colorstyl_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_vector_colorstyl_get() # # This file opens an existing database "spool.db" # and reads in the results. It gets the style # used to plot vectors. Later it sets the style # and gets it. # # 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. # Finally copy the file "spool_res_vector.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector_colorstyl_get() # has the following arguments: # # ga_display_vector_colorstyl_get # ( display_name, # vector_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING s_vector_style[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_vector.ses") # s_display_name = "general" s_display_name = "general" # Get the vector color style. i_return_value = ga_display_vector_colorstyl_get ( s_display_name, s_vector_style ) dump i_return_value dump s_vector_style # @ @ @

Session file paused. Press "Resume" to continue..

Main Index

Chapter 2: Basic Functions 271
Display Menu

sf_pause() # Set the vector color style. IF (s_vector_style == "VALUE") THEN s_vector_style = "COMPONENT" ELSE s_vector_style = "VALUE" ENDIF i_return_value = ga_display_vector_colorstyl_set ( s_display_name, s_vector_style ) dump i_return_value # Reset the value s_vector_style = "" @ @ @

# Get the vector color style. i_return_value = @ ga_display_vector_colorstyl_get @ ( s_display_name, @ s_vector_style ) dump i_return_value dump s_vector_style #---------------------------------------------------------------------

ga_display_vector_colorstyl_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_vector_colorstyl_set() # # This file opens an existing database "spool.db" # and reads in the results. It gets the style # used to plot vectors. Later it sets the style # and gets it. # # 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. # Finally copy the file "spool_res_vector.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector_colorstyl_set() # has the following arguments: # # ga_display_vector_colorstyl_set # ( display_name, # vector_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING s_vector_style[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_vector.ses") # s_display_name = "general" s_display_name = "general"

Main Index

272 PCL Reference Manual Examples
Display Menu

# Get the vector color style. i_return_value = ga_display_vector_colorstyl_get ( s_display_name, s_vector_style ) dump i_return_value dump s_vector_style

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the vector color style. IF (s_vector_style == "VALUE") THEN s_vector_style = "COMPONENT" ELSE s_vector_style = "VALUE" ENDIF i_return_value = ga_display_vector_colorstyl_set ( s_display_name, s_vector_style ) dump i_return_value # Reset the value s_vector_style = "" @ @ @

# Get the vector color style. i_return_value = @ ga_display_vector_colorstyl_get @ ( s_display_name, @ s_vector_style ) dump i_return_value dump s_vector_style #---------------------------------------------------------------------

ga_display_vector_facolor_get

()

# # Purpose : This file provides an example of two calls to # the function ga_display_vector_facolor_get() # # This file opens an existing database "spool.db" # and plots the applied loads. Later it gets the # colors used to display the functional # assignment vectors. Finally it sets the colors # used for functional assignment vectors and gets # it again. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector_facolor_get() # has the following arguments: # # ga_display_vector_facolor_get # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32]

Main Index

Chapter 2: Basic Functions 273
Display Menu

INTEGER ia_color_value(5) INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db". uil_file_open.go("spool.db") i_return_value = @ loadsbcs_plot_markers( ["400_psi"], ["default_group"] ) dump i_return_value # s_display_name = "general" s_display_name = "general" # Get the colors used to display functional assignment vectors i_return_value = @ ga_display_vector_facolor_get @ ( s_display_name, @ ia_color_value ) dump i_return_value dump ia_color_value # Session file paused. Press "Resume" to continue.. sf_pause() # Set the colors used to display functional assignment vectors ia_color_value = [ 2, 2, 2, 2, 2] i_return_value = ga_display_vector_facolor_set ( s_display_name, ia_color_value ) dump i_return_value # Reset the values ia_color_value = [ 0, 0, 0, 0, 0] # Get the colors used to display functional assignment vectors i_return_value = @ ga_display_vector_facolor_get @ ( s_display_name, @ ia_color_value ) dump i_return_value dump ia_color_value #--------------------------------------------------------------------@ @ @

ga_display_vector_facolor_set
# # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_vector_facolor_get() This file opens an existing database "spool.db" and plots the applied loads. Later it gets the colors used to display the functional assignment vectors. Finally it sets the colors used for functional assignment vectors and gets it again. Before running this session file run spool.ses to create spool.db This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

Main Index

274 PCL Reference Manual Examples
Display Menu

# The function ga_display_vector_facolor_set() # has the following arguments: # # ga_display_vector_facolor_set # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER ia_color_value(5) INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db". uil_file_open.go("spool.db") i_return_value = @ loadsbcs_plot_markers( ["400_psi"], ["default_group"] ) dump i_return_value # s_display_name = "general" s_display_name = "general" # Get the colors used to display functional assignment vectors i_return_value = @ ga_display_vector_facolor_get @ ( s_display_name, @ ia_color_value ) dump i_return_value dump ia_color_value # Session file paused. Press "Resume" to continue.. sf_pause() # Set the colors used to display functional assignment vectors ia_color_value = [ 2, 2, 2, 2, 2] i_return_value = ga_display_vector_facolor_set ( s_display_name, ia_color_value ) dump i_return_value # Reset the values ia_color_value = [ 0, 0, 0, 0, 0] # Get the colors used to display functional assignment vectors i_return_value = @ ga_display_vector_facolor_get @ ( s_display_name, @ ia_color_value ) dump i_return_value dump ia_color_value #--------------------------------------------------------------------@ @ @

ga_display_vector_falabel_get
# # # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_vector_falabel_get() This file opens an existing database "spool.db" and plots the applied loads. Later it gets the status for display of labels for functional assignments. Finally it sets the status and gets it.

Main Index

Chapter 2: Basic Functions 275
Display Menu

# # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector_falabel_get() # has the following arguments: # # ga_display_vector_falabel_get # ( display_name, # label_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_label_status INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db". uil_file_open.go("spool.db") i_return_value = loadsbcs_plot_markers( ["400_psi"], ["default_group"] ) dump i_return_value # s_display_name = "general" s_display_name = "general" # Get the status for display of label for # functional assignment vectors. i_return_value = ga_display_vector_falabel_get ( s_display_name, i_label_status ) dump i_return_value dump i_label_status @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the status for display of label for # functional assignment vectors. IF (i_label_status == 0) THEN i_label_status = 1 ELSE i_label_status = 0 ENDIF i_return_value = ga_display_vector_falabel_set ( s_display_name, i_label_status ) dump i_return_value # Reset the value i_label_status = 100 # Get the status for display of label for # functional assignment vectors. i_return_value = ga_display_vector_falabel_get ( s_display_name, i_label_status ) dump i_return_value @ @ @

@ @ @

Main Index

276 PCL Reference Manual Examples
Display Menu

dump i_label_status #---------------------------------------------------------------------

ga_display_vector_falabel_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_vector_falabel_set() # # This file opens an existing database "spool.db" # and plots the applied loads. Later it gets the # status for display of labels for functional # assignments. Finally it sets the status and # gets it. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector_falabel_set() # has the following arguments: # # ga_display_vector_falabel_set # ( display_name, # label_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_label_status INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db". uil_file_open.go("spool.db") i_return_value = loadsbcs_plot_markers( ["400_psi"], ["default_group"] ) dump i_return_value # s_display_name = "general" s_display_name = "general" # Get the status for display of label for # functional assignment vectors. i_return_value = ga_display_vector_falabel_get ( s_display_name, i_label_status ) dump i_return_value dump i_label_status @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the status for display of label for # functional assignment vectors. IF (i_label_status == 0) THEN i_label_status = 1 ELSE i_label_status = 0 ENDIF

Main Index

Chapter 2: Basic Functions 277
Display Menu

i_return_value = ga_display_vector_falabel_set ( s_display_name, i_label_status ) dump i_return_value # Reset the value i_label_status = 100

@ @ @

# Get the status for display of label for # functional assignment vectors. i_return_value = @ ga_display_vector_falabel_get @ ( s_display_name, @ i_label_status ) dump i_return_value dump i_label_status #---------------------------------------------------------------------

ga_display_vector_length_get

()

# # Purpose : This file provides an example of two calls # to the function ga_display_vector_length_get() # # This file opens an existing database "spool.db" # and reads the results. Later it gets the value # used to control the length style of the plotted # vectors. Finally it sets the value used to # control the length style of the plotted vectors # and gets it. # # 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. # Finally copy the file "spool_res_vector.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector_length_get() # has the following arguments: # # ga_display_vector_length_get # ( display_name, # vector_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING s_vector_style[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_vector.ses") # s_display_name = "general" s_display_name = "general" # Get the length style of vector. i_return_value = ga_display_vector_length_get ( s_display_name, s_vector_style ) @ @ @

Main Index

278 PCL Reference Manual Examples
Display Menu

dump i_return_value dump s_vector_style # Session file paused. Press "Resume" to continue.. sf_pause() # Set the length style of vector. IF (s_vector_style == "CONSTANT/SCREEN") THEN s_vector_style = "SCALED/SCREEN" ELSE s_vector_style = "CONSTANT/SCREEN" ENDIF i_return_value = ga_display_vector_length_set ( s_display_name, s_vector_style ) dump i_return_value # Reset the value s_vector_style = "" @ @ @

# Get the length style of vector. i_return_value = @ ga_display_vector_length_get @ ( s_display_name, @ s_vector_style ) dump i_return_value dump s_vector_style #---------------------------------------------------------------------

ga_display_vector_length_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_vector_length_set() # # This file opens an existing database "spool.db" # and reads the results. Later it gets the value # used to control the length style of the plotted # vectors. Finally it sets the value used to # control the length style of the plotted vectors # and gets it. # # 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. # Finally copy the file "spool_res_vector.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector_length_set() # has the following arguments: # # ga_display_vector_length_set # ( display_name, # vector_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] STRING s_vector_style[32] INTEGER i_return_value #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 279
Display Menu

# Open the database "spool.db" and read the results. sf_play("spool_res_vector.ses") # s_display_name = "general" s_display_name = "general" # Get the length style of vector. i_return_value = ga_display_vector_length_get ( s_display_name, s_vector_style ) dump i_return_value dump s_vector_style @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the length style of vector. IF (s_vector_style == "CONSTANT/SCREEN") THEN s_vector_style = "SCALED/SCREEN" ELSE s_vector_style = "CONSTANT/SCREEN" ENDIF i_return_value = ga_display_vector_length_set ( s_display_name, s_vector_style ) dump i_return_value # Reset the value s_vector_style = "" @ @ @

# Get the length style of vector. i_return_value = @ ga_display_vector_length_get @ ( s_display_name, @ s_vector_style ) dump i_return_value dump s_vector_style #---------------------------------------------------------------------

ga_display_vector_reslabel_get
# # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_vector_reslabel_get() This file opens an existing database and reads the results. Later it gets value used to control the display of results vectors. Finally it sets the value and gets it. "spool.db" the status labels on status

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. Finally copy the file "spool_res_vector.ses" to the current working directory. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar. The function ga_display_vector_reslabel_get() has the following arguments:

Main Index

280 PCL Reference Manual Examples
Display Menu

# # ga_display_vector_reslabel_get # ( display_name, # label_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_label_status INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_vector.ses") # s_display_name = "general" s_display_name = "general" # Get the status value for display of labels on result vectors. i_return_value = @ ga_display_vector_reslabel_get @ ( s_display_name, @ i_label_status ) dump i_return_value dump i_label_status # Session file paused. Press "Resume" to continue.. sf_pause() # Set the status value for display of labels on result vectors. IF (i_label_status == 0) THEN i_label_status = 1 ELSE i_label_status = 0 ENDIF i_return_value = ga_display_vector_reslabel_set ( s_display_name, i_label_status ) dump i_return_value # Reset the value i_label_status = 100 @ @ @

# Get the status value for display of labels on result vectors. i_return_value = @ ga_display_vector_reslabel_get @ ( s_display_name, @ i_label_status ) dump i_return_value dump i_label_status #---------------------------------------------------------------------

ga_display_vector_reslabel_set
# # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_display_vector_reslabel_set() This file opens an existing database and reads the results. Later it gets value used to control the display of results vectors. Finally it sets the value and gets it. "spool.db" the status labels on status

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.

Main Index

Chapter 2: Basic Functions 281
Display Menu

# Finally copy the file "spool_res_vector.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector_reslabel_set() # has the following arguments: # # ga_display_vector_reslabel_set # ( display_name, # label_status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_label_status INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_vector.ses") # s_display_name = "general" s_display_name = "general" # Get the status value for display of labels on result vectors. i_return_value = @ ga_display_vector_reslabel_get @ ( s_display_name, @ i_label_status ) dump i_return_value dump i_label_status # Session file paused. Press "Resume" to continue.. sf_pause() # Set the status value for display of labels on result vectors. IF (i_label_status == 0) THEN i_label_status = 1 ELSE i_label_status = 0 ENDIF i_return_value = ga_display_vector_reslabel_set ( s_display_name, i_label_status ) dump i_return_value # Reset the value i_label_status = 100 @ @ @

# Get the status value for display of labels on result vectors. i_return_value = @ ga_display_vector_reslabel_get @ ( s_display_name, @ i_label_status ) dump i_return_value dump i_label_status #---------------------------------------------------------------------

ga_display_vector_scale_get
# # #

()

Purpose

:

This file provides an example of two calls to the function ga_display_vector_scale_get()

Main Index

282 PCL Reference Manual Examples
Display Menu

# # This file opens an existing database "spool.db" # and reads the results. Later it gets the vector # scale used for display. Finally it sets the # vector scale and gets it. # # 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. # Finally copy the file "spool_res_vector.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector_scale_get() # has the following arguments: # # ga_display_vector_scale_get # ( display_name, # vector_scale ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] REAL r_vector_scale INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_vector.ses") # s_display_name = "general" s_display_name = "general" # Get the vector scale. i_return_value = ga_display_vector_scale_get ( s_display_name, r_vector_scale ) dump i_return_value dump r_vector_scale @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the vector scale. IF (r_vector_scale == 0.1) THEN r_vector_scale = 0.2 ELSE r_vector_scale = 0.1 ENDIF i_return_value = ga_display_vector_scale_set ( s_display_name, r_vector_scale ) dump i_return_value # Reset the value r_vector_scale = 0.0 # Get the vector scale. i_return_value = ga_display_vector_scale_get ( s_display_name, r_vector_scale ) dump i_return_value @ @ @

@ @ @

Main Index

Chapter 2: Basic Functions 283
Display Menu

dump r_vector_scale #---------------------------------------------------------------------

ga_display_vector_scale_set

()

# # Purpose : This file provides an example of a call to the # function ga_display_vector_scale_set() # # This file opens an existing database "spool.db" # and reads the results. Later it gets the vector # scale used for display. Finally it sets the # vector scale and gets it. # # 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. # Finally copy the file "spool_res_vector.ses" # to the current working directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector_scale_set() # has the following arguments: # # ga_display_vector_scale_set # ( display_name, # vector_scale ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] REAL r_vector_scale INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_vector.ses") # s_display_name = "general" s_display_name = "general" # Get the vector scale. i_return_value = ga_display_vector_scale_get ( s_display_name, r_vector_scale ) dump i_return_value dump r_vector_scale @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the vector scale. IF (r_vector_scale == 0.1) THEN r_vector_scale = 0.2 ELSE r_vector_scale = 0.1 ENDIF i_return_value = ga_display_vector_scale_set ( s_display_name, r_vector_scale ) @ @ @

Main Index

284 PCL Reference Manual Examples
Display Menu

dump i_return_value # Reset the value r_vector_scale = 0.0 # Get the vector scale. i_return_value = @ ga_display_vector_scale_get @ ( s_display_name, @ r_vector_scale ) dump i_return_value dump r_vector_scale #---------------------------------------------------------------------

ga_display_vector1_color_get

()

# # Purpose : This file provides an example of two calls # to the function ga_display_vector1_color_get() # # This file opens an existing database "spool.db" # and reads the results. Later it gets the first # vector component color used for display. # Finally it sets the vector color and gets it. # When setting the first component color the # other component colors are set to black. # # Before running this session file run spool.ses # to create spool.db. The file # "spool_res_tensor.ses" should be present in the # current directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector1_color_get() # has the following arguments: # # ga_display_vector1_color_get # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_color_value INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_tensor.ses") # s_display_name = "general" s_display_name = "general" # Set the color style. i_return_value = ga_display_vector_colorstyl_set ( s_display_name, "COMPONENT" ) dump i_return_value # Get the vector color. i_return_value = ga_display_vector1_color_get ( s_display_name, i_color_value ) @ @ @

@ @ @

Main Index

Chapter 2: Basic Functions 285
Display Menu

dump i_return_value dump i_color_value # Set the vector color black for component 2 and 3. i_return_value = @ ga_display_vector2_color_set @ ( s_display_name, @ 0 ) i_return_value = @ ga_display_vector3_color_set @ ( s_display_name, @ 0 ) # Note the change of vector color on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the vector color. IF (i_color_value == 1) THEN i_color_value = 2 ELSE i_color_value = 1 ENDIF i_return_value = ga_display_vector1_color_set ( s_display_name, i_color_value ) dump i_return_value # Reset the value i_color_value = 0 @ @ @

# Get the vector color. i_return_value = @ ga_display_vector1_color_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value #---------------------------------------------------------------------

ga_display_vector1_color_set
# # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function ga_display_vector1_color_set() This file opens an existing database "spool.db" and reads the results. Later it gets the first vector component color used for display. Finally it sets the vector color and gets it. When setting the first component color the other component colors are set to black. Before running this session file run spool.ses to create spool.db. The file "spool_res_tensor.ses" should be present in the current directory. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function ga_display_vector1_color_set()

Main Index

286 PCL Reference Manual Examples
Display Menu

# has the following arguments: # # ga_display_vector1_color_set # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_color_value INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_tensor.ses") # s_display_name = "general" s_display_name = "general" # Set the color style. i_return_value = ga_display_vector_colorstyl_set ( s_display_name, "COMPONENT" ) dump i_return_value # Get the vector color. i_return_value = ga_display_vector1_color_get ( s_display_name, i_color_value ) dump i_return_value dump i_color_value @ @ @

@ @ @

# Set the vector color black for component 2 and 3. i_return_value = @ ga_display_vector2_color_set @ ( s_display_name, @ 0 ) i_return_value = @ ga_display_vector3_color_set @ ( s_display_name, @ 0 ) # Note the change of vector color on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the vector color. IF (i_color_value == 1) THEN i_color_value = 2 ELSE i_color_value = 1 ENDIF i_return_value = ga_display_vector1_color_set ( s_display_name, i_color_value ) dump i_return_value # Reset the value i_color_value = 0 # Get the vector color. i_return_value = ga_display_vector1_color_get ( s_display_name, i_color_value ) dump i_return_value @ @ @

@ @ @

Main Index

Chapter 2: Basic Functions 287
Display Menu

dump i_color_value #---------------------------------------------------------------------

ga_display_vector2_color_get

()

# # Purpose : This file provides an example of two calls # to the function ga_display_vector2_color_get() # # This file opens an existing database "spool.db" # and reads the results. Later it gets the second # vector component color used for display. # Finally it sets the vector color and gets it. # When setting the second component color the # other component colors are set to black. # # Before running this session file run spool.ses # to create spool.db.The file # "spool_res_tensor.ses" should be present in the # current directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector2_color_get() # has the following arguments: # # ga_display_vector2_color_get # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_color_value INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_tensor.ses") # s_display_name = "general" s_display_name = "general" # Set the color style. i_return_value = ga_display_vector_colorstyl_set ( s_display_name, "COMPONENT" ) dump i_return_value # Get the vector color. i_return_value = ga_display_vector2_color_get ( s_display_name, i_color_value ) dump i_return_value dump i_color_value @ @ @

@ @ @

# Set the vector color black for component 1 and 3. i_return_value = @ ga_display_vector1_color_set @ ( s_display_name, @ 0 ) i_return_value = @ ga_display_vector3_color_set @

Main Index

288 PCL Reference Manual Examples
Display Menu

(

s_display_name, 0 )

@

# Note the change of vector color on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the vector color. IF (i_color_value == 1) THEN i_color_value = 2 ELSE i_color_value = 1 ENDIF i_return_value = ga_display_vector2_color_set ( s_display_name, i_color_value ) dump i_return_value # Reset the value i_color_value = 0 @ @ @

# Get the vector color. i_return_value = @ ga_display_vector2_color_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value #---------------------------------------------------------------------

ga_display_vector2_color_set

()

# # Purpose : This file provides an example of a call # to the function ga_display_vector2_color_set() # # This file opens an existing database "spool.db" # and reads the results. Later it gets the second # vector component color used for display. # Finally it sets the vector color and gets it. # When setting the second component color the # other component colors are set to black. # # Before running this session file run spool.ses # to create spool.db.The file # "spool_res_tensor.ses" should be present in the # current directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector2_color_set() # has the following arguments: # # ga_display_vector2_color_set # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_color_value INTEGER i_return_value

Main Index

Chapter 2: Basic Functions 289
Display Menu

#--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_tensor.ses") # s_display_name = "general" s_display_name = "general" # Set the color style. i_return_value = ga_display_vector_colorstyl_set ( s_display_name, "COMPONENT" ) dump i_return_value # Get the vector color. i_return_value = ga_display_vector2_color_get ( s_display_name, i_color_value ) dump i_return_value dump i_color_value @ @ @

@ @ @

# Set the vector color black for component 1 and 3. i_return_value = @ ga_display_vector1_color_set @ ( s_display_name, @ 0 ) i_return_value = @ ga_display_vector3_color_set @ ( s_display_name, @ 0 ) # Note the change of vector color on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the vector color. IF (i_color_value == 1) THEN i_color_value = 2 ELSE i_color_value = 1 ENDIF i_return_value = ga_display_vector2_color_set ( s_display_name, i_color_value ) dump i_return_value # Reset the value i_color_value = 0 @ @ @

# Get the vector color. i_return_value = @ ga_display_vector2_color_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value #---------------------------------------------------------------------

ga_display_vector3_color_get
# # # # Purpose :

()
This file provides an example of two calls to the function ga_display_vector3_color_get()

Main Index

290 PCL Reference Manual Examples
Display Menu

# This file opens an existing database "spool.db" # and reads the results. Later it gets the third # vector component color used for display. # Finally it sets the vector color and gets it. # When setting the third component color the # other component colors are set to black. # # Before running this session file run spool.ses # to create spool.db.The file # "spool_res_tensor.ses" should be present in the # current directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector3_color_get() # has the following arguments: # # ga_display_vector3_color_get # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_color_value INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_tensor.ses") # s_display_name = "general" s_display_name = "general" # Set the color style. i_return_value = ga_display_vector_colorstyl_set ( s_display_name, "COMPONENT" ) dump i_return_value # Get the vector color. i_return_value = ga_display_vector3_color_get ( s_display_name, i_color_value ) dump i_return_value dump i_color_value @ @ @

@ @ @

# Set the vector color black for component 1 and 2. i_return_value = @ ga_display_vector1_color_set @ ( s_display_name, @ 0 ) i_return_value = @ ga_display_vector2_color_set @ ( s_display_name, @ 0 ) # Note the change of vector color on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the vector color. IF (i_color_value == 1) THEN i_color_value = 2

Main Index

Chapter 2: Basic Functions 291
Display Menu

ELSE i_color_value = 1 ENDIF i_return_value = ga_display_vector3_color_set ( s_display_name, i_color_value ) dump i_return_value # Reset the value i_color_value = 0 @ @ @

# Get the vector color. i_return_value = @ ga_display_vector3_color_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value #---------------------------------------------------------------------

ga_display_vector3_color_set

()

# # Purpose : This file provides an example of a call # to the function ga_display_vector3_color_set() # # This file opens an existing database "spool.db" # and reads the results. Later it gets the third # vector component color used for display. # Finally it sets the vector color and gets it. # When setting the third component color the # other component colors are set to black. # # Before running this session file run spool.ses # to create spool.db.The file # "spool_res_tensor.ses" should be present in the # current directory. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function ga_display_vector3_color_set() # has the following arguments: # # ga_display_vector3_color_set # ( display_name, # color_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_name[32] INTEGER i_color_value INTEGER i_return_value #--------------------------------------------------------------------# Open the database "spool.db" and read the results. sf_play("spool_res_tensor.ses") # s_display_name = "general" s_display_name = "general" # Set the color style. i_return_value = ga_display_vector_colorstyl_set ( s_display_name, @ @ @

Main Index

292 PCL Reference Manual Examples
Display Menu

"COMPONENT" ) dump i_return_value # Get the vector color. i_return_value = ga_display_vector3_color_get ( s_display_name, i_color_value ) dump i_return_value dump i_color_value @ @ @

# Set the vector color black for component 1 and 2. i_return_value = @ ga_display_vector1_color_set @ ( s_display_name, @ 0 ) i_return_value = @ ga_display_vector2_color_set @ ( s_display_name, @ 0 ) # Note the change of vector color on the viewport. # Session file paused. Press "Resume" to continue.. sf_pause() # Set the vector color. IF (i_color_value == 1) THEN i_color_value = 2 ELSE i_color_value = 1 ENDIF i_return_value = ga_display_vector3_color_set ( s_display_name, i_color_value ) dump i_return_value # Reset the value i_color_value = 0 @ @ @

# Get the vector color. i_return_value = @ ga_display_vector3_color_get @ ( s_display_name, @ i_color_value ) dump i_return_value dump i_color_value #---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 293
Tools Menu

Tools Menu
This section contains examples of functions used to create and manipulate lists of geometric and finite element model entities using the list processor and the list processor format.
list_create_boolean_list

()

# # Purpose : This file provides an example of a call to the # function list_create_boolean_list() # # This function creates a list of entities by # combining the contents of the global string # "lista" and "listb" using the type of operation # specified by the input string "boolean" and # placing the the results in the global string # "listc" # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. The string for # list "s_blist_a" and "s_blist_b" are then # defined. The boolean operation carried out in # this example is "and". The return list is # verified after the boolean operation. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_boolean_list() # has the following arguments: # # list_create_boolean_list # ( blist_a, # blist_b, # btype, # bret_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_blist_a[32] STRING s_blist_b[32] STRING s_btype[7] STRING sv_bret_list[VIRTUAL] INTEGER i_return_value STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value

Main Index

294 PCL Reference Manual Examples
Tools Menu

i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", sv_sgm_surface ) dump i_return_value

@ @

@ @

@ @ @

#--------------------------------------------------------------------# Create boolean list s_blist_a = "Point 1:4" s_blist_b = "Point 1 2" s_btype = "and" i_return_value = list_create_boolean_list ( s_blist_a, s_blist_b, s_btype, sv_bret_list ) dump i_return_value dump sv_bret_list @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_bret_list) #---------------------------------------------------------------------

list_create_curve_ass_geo
# # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_create_curve_ass_geo() This function creates a list of all curves associated with a list of geometric entities. In this example a new database is opened. Geometry consisting of a single curve and surface of dimension 2 X 1 is created. The list of curves associated with "Surface 1" is obtained using this function in "lista" and "sv_return_list". This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function list_create_curve_ass_geo() has the following arguments: list_create_curve_ass_geo

Main Index

Chapter 2: Basic Functions 295
Tools Menu

# ( entity_list, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_entity_list[32] STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", sv_sgm_surface ) dump i_return_value @ @

@ @

@ @ @

#--------------------------------------------------------------------# Create list of all curves associated with "Surface 1 " s_entity_list s_target = "Surface 1" = "lista" @ @ @ @

i_return_value = list_create_curve_ass_geo ( s_entity_list, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_return_list) #---------------------------------------------------------------------

Main Index

296 PCL Reference Manual Examples
Tools Menu

list_create_curve_ass_group

()

# # Purpose : This file provides an example of a call to the # function list_create_curve_ass_group() # # This function creates a list of all curves # associated with specified group. # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. The list of # curves associated with "default_group" is # obtained using this function in "lista" # and "sv_return_list". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_curve_ass_group() # has the following arguments: # # list_create_curve_ass_group # ( group_list, # number_of_groups, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING sa_group_list[32](1) INTEGER i_number_of_groups STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value @ @

@ @

Main Index

Chapter 2: Basic Functions 297
Tools Menu

i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", sv_sgm_surface ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create list of all curves present in "default_group " sa_group_list(1) = "default_group" i_number_of_groups = 1 s_target = "lista" i_return_value = list_create_curve_ass_group ( sa_group_list, i_number_of_groups, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_elem_ass_geo

()

# # Purpose : This file provides an example of a call to the # function list_create_elem_ass_geo() # # This function creates a list of all elements # associated with a list of geomeric entities. # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. 2 "quad" # elements are created using "Surface 1". Then # the list of elements associated with # "Surface 1" is obtained using this function in # "lista" and "sv_return_list". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_elem_ass_geo() # has the following arguments: # # list_create_elem_ass_geo # ( element_shape_code, # entity_list, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_element_shape_code STRING s_entity_list[32]

Main Index

298 PCL Reference Manual Examples
Tools Menu

STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_mesh_s_nodes[VIRTUAL] STRING sv_mesh_s_elems[VIRTUAL] STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", "Curve 1 ", sv_sgm_surface ) dump i_return_value @ @

@ @

@ @ @

#--------------------------------------------------------------------# Create FEM entities i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems ) dump i_return_value #--------------------------------------------------------------------# Create list of all elements associated with "Surface 1" i_element_shape_code = 4 s_entity_list = "Surface 1" s_target = "lista" i_return_value = list_create_elem_ass_geo ( i_element_shape_code, s_entity_list, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista @ @ @ @ @

Main Index

Chapter 2: Basic Functions 299
Tools Menu

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_mesh_s_nodes) sys_free_string( sv_mesh_s_elems) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_elem_ass_group

()

# # Purpose : This file provides an example of a call to the # function list_create_elem_ass_group() # "sv_return_list". # # This function creates a list of all elements # associated with specified group. # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. 2 "quad" # elements are created using "Surface 1". Then # the list of elements associated with # "default_group" is obtained using this function # in "lista" and "sv_return_list". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_elem_ass_group() # has the following arguments: # # list_create_elem_ass_group # ( element_shape_code, # group_list, # number_of_groups, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_element_shape_code STRING sa_group_list[32](1) INTEGER i_number_of_groups STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_mesh_s_nodes[VIRTUAL] STRING sv_mesh_s_elems[VIRTUAL] STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

Main Index

300 PCL Reference Manual Examples
Tools Menu

#--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", "Curve 1 ", sv_sgm_surface ) dump i_return_value @ @

@ @

@ @ @

#--------------------------------------------------------------------# Create FEM entities i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems ) dump i_return_value #--------------------------------------------------------------------# Create list of all elements present in "default_group" i_element_shape_code sa_group_list(1) i_number_of_groups s_target = = = = 4 "default_group" 1 "lista" @ @ @ @ @ @

i_return_value = list_create_elem_ass_group ( i_element_shape_code, sa_group_list, i_number_of_groups, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_mesh_s_nodes) sys_free_string( sv_mesh_s_elems) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_elem_ass_node
# #

()

Purpose

:

This file provides an example of a call to the

Main Index

Chapter 2: Basic Functions 301
Tools Menu

# function list_create_elem_ass_node() # # This function creates a list of all elements # associated with a list of nodes. # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. 2 "quad" # elements are created using "Surface 1". Then # the list of elements associated with "Node 3" # is obtained using this function in "lista" and # and "sv_return_list". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_elem_ass_node() # has the following arguments: # # list_create_elem_ass_node # ( element_shape_code, # node_list, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_element_shape_code STRING s_node_list[64] STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_mesh_s_nodes[VIRTUAL] STRING sv_mesh_s_elems[VIRTUAL] STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = @ @

@ @

@

Main Index

302 PCL Reference Manual Examples
Tools Menu

sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", "Curve 1 ", sv_sgm_surface ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create FEM entities i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems ) dump i_return_value #--------------------------------------------------------------------# Create list of all elements associated with "Node 3". i_element_shape_code = 4 s_node_list = "Node 3" s_target = "lista" i_return_value = list_create_elem_ass_node ( i_element_shape_code, s_node_list, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_mesh_s_nodes) sys_free_string( sv_mesh_s_elems) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_elem_att_fringe
# # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_create_elem_att_fringe() This function creates a list of all finite element model shape with specified fringe value in a single group of geometric entities. In this example a field.db is opened and the fringe plots for displacement and translation are created. Then this function is called to create a list of elements between specified fringe values in "lista" and "sv_return_list". Before running this session file run field.ses to create field.db. Follow the instruction in the field.ses file for analysis. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

Main Index

Chapter 2: Basic Functions 303
Tools Menu

# # The function list_create_elem_att_fringe() # has the following arguments: # # list_create_elem_att_fringe # ( element_shape_code, # fringe_limits, # fringe_comparison_type, # tolerance, # group_name, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_element_shape_code REAL ra_fringe_limits(2) STRING s_fringe_comparison_type[7] REAL r_tolerance STRING s_group_name[32] STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "field.db" uil_file_open.go("field.db") # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value @ @

#--------------------------------------------------------------------# Initialize parameters for fringe plot i_return_value = @ res_init_fringe_plot( ) dump i_return_value # Create plot record for fringe plot i_return_value = res_create_fringe_plot_rec3 ( 1,2,1,1,1,1,0,0,1.,"",1,2,3,23,1,1,0.,30,0,1 ) dump i_return_value @ @

# Create a fringe plot i_return_value = @ res_make_fringe_plot @ ( 1, [1], [1], [""], [0.], ["Default, Static Subcase:"// @ " Displacements, Translational (VEC-MAG) -MSC.Nastran"]) dump i_return_value # Clear memory used in fringe plot and exit fringe plot module i_return_value = @ res_deinit_fringe_plot( ) dump i_return_value #--------------------------------------------------------------------# Create a list of all elements for a specified range of fringe value i_element_shape_code ra_fringe_limits(1) ra_fringe_limits(2) s_fringe_comparison_type r_tolerance s_group_name s_target i_return_value = = = = = = = = 0 4.762E-05 8.844E-05 "range" 4.9999999E-10 "default_group" "lista" @

Main Index

304 PCL Reference Manual Examples
Tools Menu

list_create_elem_att_fringe ( i_element_shape_code, ra_fringe_limits, s_fringe_comparison_type, r_tolerance, s_group_name, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista

@ @ @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_elem_att_mat

()

# # Purpose : This file provides an example of a call to the # function list_create_elem_att_mat() # # This function creates a list of elements of a # particular finite element model shape from a # list of material names. # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. 2 "quad" # elements are created using "Surface 1". # Material named "Aluminium" and element property # set "prop_set" are created and associated with # the finite elements. Then the list of elements # associated with material "Aluminium" is # obtained using this function in "lista" and # "sv_return_list". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_elem_att_mat() # has the following arguments: # # list_create_elem_att_mat # ( element_shape_code, # material_list, # num_materials, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_element_shape_code STRING sa_material_list[32](1) INTEGER i_num_materials STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_mesh_s_nodes[VIRTUAL] STRING sv_mesh_s_elems[VIRTUAL] STRING sv_asm_point[VIRTUAL]

Main Index

Chapter 2: Basic Functions 305
Tools Menu

STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", "Curve 1 ", sv_sgm_surface ) dump i_return_value @ @

@ @

@ @ @

#--------------------------------------------------------------------# Create FEM entities i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems ) dump i_return_value #--------------------------------------------------------------------# Create material - "Aluminium" i_return_value = @ material.create @ ( "Analysis code ID",1,"Analysis type ID",1,"Aluminium", @ 0,"", "Isotropic", 1, "Directionality", 1, "Linearity",@ 1, "Homogeneous", 0, "Linear Elastic", 1,"Model Opt"// @ "ions & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0], @ "Active Flag", 1, "Create", 10, "External Flag", FALSE,@ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0],"Property Values",["10.1E6", @ "0.33", "0.1", ""] ) dump i_return_value # Create element property set - "prop_set" i_return_value = elementprops_create ( "prop_set", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111,4118,4119],[5, 9, 1, 1, 1, 1, 1],["m:Aluminium", "", "0.2", "", "","", ""], "Surface 1" ) dump i_return_value @ @ @ @

#--------------------------------------------------------------------# Create list of all elements with material attribute "Aluminium"

Main Index

306 PCL Reference Manual Examples
Tools Menu

i_element_shape_code sa_material_list(1) i_num_materials s_target

= = = =

4 "Aluminium" 1 "lista" @ @ @ @ @ @

i_return_value = list_create_elem_att_mat ( i_element_shape_code, sa_material_list, i_num_materials, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_mesh_s_nodes) sys_free_string( sv_mesh_s_elems) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_elem_att_prop

()

# # Purpose : This file provides an example of a call to the # function list_create_elem_att_prop() # # This function creates a list of elements of a # particular finite element model shape from a # list of property names. # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. 2 "quad" # elements are created using "Surface 1". # Material named "Aluminium" and element property # set "prop_set" are created and associated with # the finite elements. Then the list of elements # associated with property "prop_set" is # obtained using this function in "lista" and # "sv_return_list". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_elem_att_prop() # has the following arguments: # # list_create_elem_att_prop # ( element_shape_code, # properties_list, # num_properties, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_element_shape_code STRING sa_properties_list[32](1) INTEGER i_num_properties

Main Index

Chapter 2: Basic Functions 307
Tools Menu

STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_mesh_s_nodes[VIRTUAL] STRING sv_mesh_s_elems[VIRTUAL] STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", "Curve 1 ", sv_sgm_surface ) dump i_return_value @ @

@ @

@ @ @

#--------------------------------------------------------------------# Create FEM entities i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems ) dump i_return_value #--------------------------------------------------------------------# Create material in the database i_return_value = @ material.create @ ( "Analysis code ID",1,"Analysis type ID",1,"Aluminium", @ 0,"", "Isotropic", 1, "Directionality", 1, "Linearity",@ 1, "Homogeneous", 0, "Linear Elastic", 1,"Model Opt"// @ "ions & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0], @ "Active Flag", 1, "Create", 10, "External Flag", FALSE,@ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0],"Property Values",["10.1E6", @ "0.33", "0.1", ""] ) dump i_return_value # Create element property set - "prop_set" i_return_value = elementprops_create @ @

Main Index

308 PCL Reference Manual Examples
Tools Menu

"prop_set", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111,4118,4119],[5, 9, 1, 1, 1, 1, 1],["m:Aluminium", "", "0.2", "", "","", ""], "Surface 1" ) dump i_return_value

(

@ @

#--------------------------------------------------------------------# Create list of all elements with property set "prop_set" i_element_shape_code sa_properties_list(1) i_num_properties s_target = = = = 4 "prop_set" 1 "lista" @ @ @ @ @ @

i_return_value = list_create_elem_att_prop ( i_element_shape_code, sa_properties_list, i_num_properties, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_mesh_s_nodes) sys_free_string( sv_mesh_s_elems) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_ent_ass_group

()

# # Purpose : This file provides an example of a call to the # function list_create_ent_ass_group() # # In this example a new database is opened and # group named "NEW_GROUP" is created. Entities # are created in each group. Then this function # is called to obtain the entities present in # the "default_group". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_ent_ass_group() # has the following arguments: # # list_create_ent_ass_group # ( group_count, # group_name, # entity_count, # entity_name, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_group_count STRING sa_group_name[32](1) INTEGER i_entity_count STRING sa_entity_name[32](1)

Main Index

Chapter 2: Basic Functions 309
Tools Menu

STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value # Label Curves and solid curve_label(TRUE) solid_label(TRUE) #--------------------------------------------------------------------# Create Entities in "default_group" i_return_value = @ asm_const_line_2point( "1", "[0 0 0]", "[2 0 0][0 0 2]", 0, @ "", 50., 1, sv_ids_of_created_entities ) dump i_return_value i_return_value = asm_const_hpat_xyz( "1", "<0.5 0.5 0.5>", "[0 0 0]", "Coord 0", sv_ids_of_created_entities ) dump i_return_value @ @

#--------------------------------------------------------------------# Create "NEW_GROUP" and make it as current group. i_return_value = ga_group_create( "NEW_GROUP" ) dump i_return_value i_return_value = ga_group_current_set( "NEW_GROUP" ) dump i_return_value # Create Entities in "default_group" i_return_value = @ asm_const_line_2point( "3", "[-1 0 -1]", "[-1 2 -1]", 0, "", @ 50., 1, sv_ids_of_created_entities ) dump i_return_value i_return_value = @ sgm_const_curve_2d_circle_v1( "4", 1, 0.5, "Coord 0.3", "", @ "[1 1 0]", TRUE, sv_ids_of_created_entities ) dump i_return_value #--------------------------------------------------------------------# Get the entities present in the "default_group". i_group_count sa_group_name (1) i_entity_count sa_entity_name(1) = = = = 1 "default_group" 1 "Curve" @ @ @ @ @ @

i_return_value = list_create_ent_ass_group ( i_group_count, sa_group_name, i_entity_count, sa_entity_name, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string( sv_return_list) sys_free_string( sv_ids_of_created_entities) #---------------------------------------------------------------------

Main Index

310 PCL Reference Manual Examples
Tools Menu

list_create_ent_ass_vp

()

# # Purpose : This file provides an example of a call to the # function list_create_ent_ass_vp() # # In this example a new database is opened and # few entities are created. Then this function # is called to get the entities available in # the default_viewport. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_ent_ass_vp() # has the following arguments: # # list_create_ent_ass_vp # ( viewport_count, # viewport_name, # entity_count, # entity_name, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_viewport_count STRING sa_viewport_name[32](1) INTEGER i_entity_count STRING sa_entity_name[32](1) STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value # Label Curves and solid curve_label(TRUE) solid_label(TRUE) #--------------------------------------------------------------------# Create Entities i_return_value = @ asm_const_line_2point( "1", "[0 0 0]", "[2 0 0][0 0 2]", 0, @ "", 50., 1, sv_ids_of_created_entities ) dump i_return_value i_return_value = asm_const_hpat_xyz( "1", "<0.5 0.5 0.5>", "[0 0 0]", "Coord 0", sv_ids_of_created_entities ) dump i_return_value @ @

#--------------------------------------------------------------------# Get the entities present in "default_viewport" i_viewport_count = 1 sa_viewport_name(1) = "default_viewport" i_entity_count = 1

Main Index

Chapter 2: Basic Functions 311
Tools Menu

sa_entity_name(1)

= "Curve" @ @ @ @ @ @

i_return_value = list_create_ent_ass_vp ( i_viewport_count, sa_viewport_name, i_entity_count, sa_entity_name, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string( sv_return_list) sys_free_string( sv_ids_of_created_entities) #---------------------------------------------------------------------

list_create_ent_att_ep_name

()

# # Purpose : This file provides an example of a call to the # function list_create_ent_att_ep_name() # # In this example a new database is opened and a # surface is created. The surface is meshed # into 5 quad elements. A material(ALUMINIUM) # and an element property(NEW_EP) is created # and associated with Elements 1 to 3. Then # this function is called to get the entities # having NEW_EP as the element. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_ent_att_ep_name() # has the following arguments: # # list_create_ent_att_ep_name # ( ep_count, # ep_name, # entity_count, # entity_name, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_ep_count STRING sa_ep_name[32](1) INTEGER i_entity_count STRING sa_entity_name[32](1) STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing

Main Index

312 PCL Reference Manual Examples
Tools Menu

i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value quad_elem_label( TRUE ) #--------------------------------------------------------------------# Create a surface and mesh it. i_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value #--------------------------------------------------------------------# Create Material and Element property i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] ) dump i_return_value i_return_value = @ elementprops_create( "NEW_EP", 51, 25, 35, 1, 1, 20, [13, 20,@ 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:Aluminium", "", "0.2", "", "", "", ""] , "Element 1:3" ) dump i_return_value #--------------------------------------------------------------------# Get entities associated with element properties. i_ep_count sa_ep_name(1) i_entity_count sa_entity_name(1) = = = = 1 "NEW_EP" 1 "Element" @ @ @ @ @ @

i_return_value = list_create_ent_att_ep_name ( i_ep_count, sa_ep_name, i_entity_count, sa_entity_name, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string( sv_return_list) sys_free_string( sv_created_nodes) sys_free_string( sv_created_elems) sys_free_string( sv_ids_of_created_entities) #---------------------------------------------------------------------

list_create_ent_att_ep_type
# # # #

()

Purpose

:

This file provides an example of a call to the function list_create_ent_att_ep_type()

Main Index

Chapter 2: Basic Functions 313
Tools Menu

# In this example a new database is opened and # a cuboid & a surface are created. They are # meshed and 2 EP are created and associated # with the solid and few of the finite elements. # Then this function is called to get the list # of entities having generic element type # "Solid" & "Shell". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_ent_att_ep_type() # has the following arguments: # # list_create_ent_att_ep_type # ( general_count, # general_name, # entity_count, # entity_name, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_general_count STRING sa_general_name[32](2) INTEGER i_entity_count STRING sa_entity_name[32](2) STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value quad_elem_label( TRUE ) hex_elem_label( TRUE ) #--------------------------------------------------------------------# Create a solid, a surface and mesh them. i_return_value = @ asm_const_hpat_xyz( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities ) dump i_return_value i_return_value = asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 1]", "Coord 0", sv_ids_of_created_entities ) dump i_return_value i_return_value = fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [1.], "Hex8", "1", "1", "Coord 0", "Coord 0", i_num_nodes, i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "25", "6", "Coord 0", "Coord 0", i_num_nodes, @ @

@ @ @

@ @

Main Index

314 PCL Reference Manual Examples
Tools Menu

i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value #--------------------------------------------------------------------# Create Material and Element property. i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] ) dump i_return_value i_return_value = elementprops_create( "NEW_EP_1", 71, 25, 30, 1, 1, 20, [13, 21, 4124, 4126, 4125], [5, 4, 4, 4, 4], ["m:Aluminium", "", "", "", ""], "Solid 1") dump i_return_value i_return_value = elementprops_create( "NEW_EP_2", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], ["m:Aluminium", "", "0.2", "", "", "", ""] , "Elm 9:10") dump i_return_value @ @ @

@ @ @

#--------------------------------------------------------------------# Get List of entities having generic element type "Solid" & "Shell" i_general_count sa_general_name(1) sa_general_name(2) i_entity_count sa_entity_name(1) sa_entity_name(2) = = = = = = 2 "Solid" "Shell" 2 "Element" "Solid" @ @ @ @ @ @

i_return_value = list_create_ent_att_ep_type ( i_general_count, sa_general_name, i_entity_count, sa_entity_name, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string( sv_return_list) sys_free_string( sv_created_nodes) sys_free_string( sv_created_elems) sys_free_string( sv_ids_of_created_entities) #---------------------------------------------------------------------

list_create_ent_att_lbc_name
# # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_create_ent_att_lbc_name() In this example a new database is opened and a surface is created. The surface is meshed into 5 quad elements. An LBC ("NEW_DISP") is created with Point 1 & 4 as application region. Then this function is called to get the entities associated with "NEW_DISP".

Main Index

Chapter 2: Basic Functions 315
Tools Menu

# This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_ent_att_lbc_name() # has the following arguments: # # list_create_ent_att_lbc_name # ( lbc_count, # lbc_name, # entity_count, # entity_name, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_lbc_count STRING sa_lbc_name[32](1) INTEGER i_entity_count STRING sa_entity_name[32](2) STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value node_label (TRUE ) quad_elem_label( TRUE ) #--------------------------------------------------------------------# Create surface and FEM mesh i_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value #--------------------------------------------------------------------# Create LBC "NEW_DISP" i_return_value = @ loadsbcs_create( "NEW_DISP", "Displacement", "Nodal", "", @ "Static", [ "Point 1 4"], "Geometry", "Coord 0", 1., @ ["< 0 0 0 >", "< 0 0 0 >"], ["" , ""] ) dump i_return_value #--------------------------------------------------------------------# Get list of entities associated with LBC "NEW_DISP" i_lbc_count sa_lbc_name(1) i_entity_count sa_entity_name(1) = = = = 1 "NEW_DISP" 2 "Point"

Main Index

316 PCL Reference Manual Examples
Tools Menu

sa_entity_name(2) = "Node" i_return_value = list_create_ent_att_lbc_name ( i_lbc_count, sa_lbc_name, i_entity_count, sa_entity_name, sv_return_list ) dump i_return_value dump sv_return_list @ @ @ @ @ @

sys_free_string( sv_return_list) sys_free_string( sv_created_nodes) sys_free_string( sv_created_elems) sys_free_string( sv_ids_of_created_entities) #---------------------------------------------------------------------

list_create_ent_att_lbc_type

()

# # Purpose : This file provides an example of a call to the # function list_create_ent_att_lbc_type() # # In this example a new database is opened and a # surface is created. The surface is meshed # into 5 quad elements. 2 LBCs "NEW_DISP" and # "NEW_PRESS" are created. Then this function is # called to get the entities associated with # lbc type "Displacement" and "Pressure". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_ent_att_lbc_type() # has the following arguments: # # list_create_ent_att_lbc_type # ( lbc_type_count, # lbc_type_name, # entity_count, # entity_name, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_lbc_type_count STRING sa_lbc_type_name[32](2) INTEGER i_entity_count STRING sa_entity_name[32](2) STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

Main Index

Chapter 2: Basic Functions 317
Tools Menu

node_label (TRUE ) quad_elem_label( TRUE ) #--------------------------------------------------------------------# Create Surface and FEM mesh i_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value #--------------------------------------------------------------------# Create LBCs i_return_value = @ loadsbcs_create( "NEW_DISP", "Displacement", "Nodal", "", @ "Static", [ "Point 1 4"], "Geometry", "Coord 0", 1., @ ["< 0 0 0 >", "< 0 0 0 >"], ["" , ""] ) dump i_return_value i_return_value = @ loadsbcs_create( "NEW_PRESS", "Pressure", "Element Uniform", @ "2D", "Static", ["Element 4 5"], "FEM", "", 1., [" 500", @ "", ""], ["", "", ""] ) dump i_return_value #--------------------------------------------------------------------# Get the list of entities associated with load type Displacement # and Pressure. i_lbc_type_count sa_lbc_type_name(1) sa_lbc_type_name(2) i_entity_count sa_entity_name(1) sa_entity_name(2) = = = = = = 2 "Displacement" "Pressure" 2 "Node" "Element" @ @ @ @ @ @

i_return_value = list_create_ent_att_lbc_type ( i_lbc_type_count, sa_lbc_type_name, i_entity_count, sa_entity_name, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string( sv_return_list) sys_free_string( sv_created_nodes) sys_free_string( sv_created_elems) sys_free_string( sv_ids_of_created_entities) #---------------------------------------------------------------------

list_create_ent_att_mat_name
# # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_create_ent_att_mat_name() In this example a new database is opened and 2 surfaces are created. A material("Aluminium") is created and associated with Surface 1.

Main Index

318 PCL Reference Manual Examples
Tools Menu

# Then this function is called to get the # entities associated with material "Aluminium" # from the database. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_ent_att_mat_name() # has the following arguments: # # list_create_ent_att_mat_name # ( material_count, # material_name, # entity_count, # entity_name, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_material_count STRING sa_material_name[32](1) INTEGER i_entity_count STRING sa_entity_name[32](1) STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value surface_label(TRUE) #--------------------------------------------------------------------# Create surface i_return_value = @ asm_const_patch_xyz( "#", "<5 1 0>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities ) dump i_return_value i_return_value = asm_const_patch_xyz( "#", "<5 0 1>", "[0 0 0]", "Coord 0", sv_ids_of_created_entities ) dump i_return_value @ @

#--------------------------------------------------------------------# Create Material and Element property i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] ) dump i_return_value i_return_value = @ elementprops_create( "NEW_EP", 51, 25, 35, 1, 1, 20, [13, 20,@ 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:Aluminium", "", "0.2", "", "", "", ""] , "Surface 1" )

Main Index

Chapter 2: Basic Functions 319
Tools Menu

dump i_return_value #--------------------------------------------------------------------# Get list of entities associated with material name "Aluminium" i_material_count sa_material_name(1) i_entity_count sa_entity_name(1) = = = = 1 "Aluminium" 1 "Surface" @ @ @ @ @ @

i_return_value = list_create_ent_att_mat_name ( i_material_count, sa_material_name, i_entity_count, sa_entity_name, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string( sv_return_list) sys_free_string( sv_ids_of_created_entities) #---------------------------------------------------------------------

list_create_ent_att_mat_type

()

# # Purpose : This file provides an example of a call to the # function list_create_ent_att_mat_type() # # In this example a new database is opened and 2 # surfaces are created. A material("Aluminium") # is created and associated with Surface 1. # Then this function is called to get the # entities having "isotropic" as the # material-type. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_ent_att_mat_type() # has the following arguments: # # list_create_ent_att_mat_type # ( mat_type_count, # mat_type_name, # entity_count, # entity_name, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_mat_type_count STRING sa_mat_type_name[32](1) INTEGER i_entity_count STRING sa_entity_name[32](1) STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing

Main Index

320 PCL Reference Manual Examples
Tools Menu

i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value surface_label(TRUE) #--------------------------------------------------------------------# Create Surface i_return_value = @ asm_const_patch_xyz( "#", "<5 1 0>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities ) dump i_return_value i_return_value = asm_const_patch_xyz( "#", "<5 0 1>", "[0 0 0]", "Coord 0", sv_ids_of_created_entities ) dump i_return_value @ @

#--------------------------------------------------------------------# Create Material and Element properties. i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] ) dump i_return_value i_return_value = @ elementprops_create( "NEW_EP", 51, 25, 35, 1, 1, 20, [13, 20,@ 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:Aluminium", "", "0.2", "", "", "", ""] , "Surface 1" ) dump i_return_value #--------------------------------------------------------------------# Get the entities with "Isotropic" material type. i_mat_type_count sa_mat_type_name(1) i_entity_count sa_entity_name(1) = = = = 1 "Isotropic" 1 "Surface" @ @ @ @ @ @

i_return_value = list_create_ent_att_mat_type ( i_mat_type_count, sa_mat_type_name, i_entity_count, sa_entity_name, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string(sv_return_list) sys_free_string( sv_ids_of_created_entities) #---------------------------------------------------------------------

list_create_ent_att_mat_value
# # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_create_ent_att_mat_value() In this example a new database is opened and 5 surfaces are created with different Material properties. Then this function is called to get the list of entities whose poisson-ratio

Main Index

Chapter 2: Basic Functions 321
Tools Menu

# lie within a range of 0.05 to 0.25 # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_ent_att_mat_value() # has the following arguments: # # list_create_ent_att_mat_value # ( entity_count, # entity_name, # mat_prop_name, # minimum, # maximum, # eval_at_temperature, # evaluation_strain, # evaluation_rate, # evaluation_time, # evaluation_frequency, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_entity_count STRING sa_entity_name[32](1) STRING s_mat_prop_name[32] REAL r_minimum REAL r_maximum REAL r_eval_at_temperature REAL r_evaluation_strain REAL r_evaluation_rate REAL r_evaluation_time REAL r_evaluation_frequency STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value surface_label(TRUE) #--------------------------------------------------------------------# Create Surfaces with different Material properties i_return_value = @ asm_const_line_2point( "#", "[0 0 0][0 1 -1][0 1 -1]"// @ "[0 2 -2][0 2 -2][5 0 0][5 1 -1][5 1 -1][5 2 -2][5 2 -2]", @ "[0 0 -1][0 0 -1][0 1 -2][0 1 -2][0 2 -3][5 0 -1][5 0 -1]"// @ "[5 1 -2][5 1 -2][5 2 -3]", 0, "", 50., 1, @ sv_ids_of_created_entities ) dump i_return_value i_return_value = sgm_const_surface_2curve( "#", "Curve 1:5 ", "Curve 6:10", sv_ids_of_created_entities ) dump i_return_value i_return_value = material.create( "Analysis code ID", 1, "Analysis type ID", 1, "MAT_1", 0, "", "Isotropic", 1, "Directionality", 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ @

@ @ @ @

Main Index

322 PCL Reference Manual Examples
Tools Menu

"Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs",["Elastic Modulus","Poisson Ratio","Density"],@ [2, 5, 16, 0], "Property Values", ["10E6", "0.11", "0.1", ""]) dump i_return_value i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_2", 0, "", "Isotropic", 1, "Directionality", 1, @ "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs",["Elastic Modulus","Poisson Ratio","Density"],@ [2, 5, 16, 0], "Property Values", ["20E6", "0.22", "0.2", ""]) dump i_return_value i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_3", 0, "", "Isotropic", 1, "Directionality", 1, @ "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs",["Elastic Modulus","Poisson Ratio","Density"],@ [2, 5, 16, 0], "Property Values", ["30E6", "0.33", "0.3", ""]) dump i_return_value i_return_value = elementprops_create( "EP_1", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_1", "", "0.1", "", "", "", ""], "Surface 1" ) dump i_return_value i_return_value = elementprops_create( "EP_2", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_2", "", "0.2", "", "", "", ""], "Surface 2 3" ) dump i_return_value i_return_value = elementprops_create( "EP_3", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_3", "", "0.3", "", "", "", ""], "Surface 4 5" ) dump i_return_value @ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Get the list of entities whose poisson ration lie within the range # 0.05 and 0.25 i_entity_count sa_entity_name(1) s_mat_prop_name r_minimum r_maximum r_eval_at_temperature r_evaluation_strain r_evaluation_rate r_evaluation_time r_evaluation_frequency = = = = = = = = = = 1 "Surface" "Poisson Ratio" 0.05 0.25 0.0 0.0 0.0 0.0 0.0 @ @ @ @ @ @ @ @

i_return_value = list_create_ent_att_mat_value ( i_entity_count, sa_entity_name, s_mat_prop_name, r_minimum, r_maximum, r_eval_at_temperature,

Main Index

Chapter 2: Basic Functions 323
Tools Menu

r_evaluation_strain, r_evaluation_rate, r_evaluation_time, r_evaluation_frequency, sv_return_list ) dump i_return_value dump sv_return_list

@ @ @ @

sys_free_string(sv_return_list) #---------------------------------------------------------------------

list_create_ent_att_vp_vis

()

# # Purpose : This file provides an example of a call to the # function list_create_ent_att_vp_vis() # # In this example a new database is opened and # few entities are created. After a pause one # of the curve is erased and this function is # called to get the list of entities available # in "default_viewport". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_ent_att_vp_vis() # has the following arguments: # # list_create_ent_att_vp_vis # ( viewport_count, # viewport_name, # entity_count, # entity_name, # pick_type, # pick_erased, # return_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_viewport_count STRING sa_viewport_name[32](1) INTEGER i_entity_count STRING sa_entity_name[32](1) INTEGER i_pick_type INTEGER i_pick_erased STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value # Label Curves and solid curve_label(TRUE) solid_label(TRUE) #--------------------------------------------------------------------# Create 2 curves and a solid i_return_value = @

Main Index

324 PCL Reference Manual Examples
Tools Menu

asm_const_line_2point( "1", "[0 0 0]", "[2 0 0][0 0 2]", 0, "", 50., 1, sv_ids_of_created_entities ) dump i_return_value i_return_value = asm_const_hpat_xyz( "1", "<0.5 0.5 0.5>", "[0 0 0]", "Coord 0", sv_ids_of_created_entities ) dump i_return_value

@

@ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() # Erase Curve 1 gm_visibility_widget( "Curve 1 ", FALSE ) #--------------------------------------------------------------------# Get the list of entities in "default_viewport" i_return_value = list_create_ent_ass_vp( 1, ["default_viewport"], 1, ["Curve"], sv_return_list ) dump i_return_value dump sv_return_list @ @

#--------------------------------------------------------------------# Get the list of all entities in "default_viewport" even if it # is erased. i_viewport_count sa_viewport_name(1) i_entity_count sa_entity_name(1) i_pick_type i_pick_erased = = = = = = 1 "default_viewport" 1 "Curve" 1 1 /* Also get erased entities */ @ @ @ @ @ @ @ @

i_return_value = list_create_ent_att_vp_vis ( i_viewport_count, sa_viewport_name, i_entity_count, sa_entity_name, i_pick_type, i_pick_erased, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string( sv_return_list) sys_free_string( sv_ids_of_created_entities) #---------------------------------------------------------------------

list_create_fem_con_fem
# # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_create_fem_con_fem() In this example a new database is opened and a surface with 5 quad elements is created. Then this function is called to get the list of elements associated with Node 1 and element adjacent to Element 3. This file can be run by starting a session of Patran, and running this session file

Main Index

Chapter 2: Basic Functions 325
Tools Menu

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_fem_con_fem() # has the following arguments: # # list_create_fem_con_fem # ( in_list, # get_node_con_to_node_by_elem, # get_node_con_to_node_by_mpc, # get_node_used_by_elem, # get_node_used_by_mpc, # get_elem_using_node, # get_elem_adj_to_elem, # get_elem_adj_to_mpc, # get_mpc_using_node, # get_mpc_adj_to_elem, # get_mpc_adj_to_mpc, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_in_list[128] INTEGER i_get_node_con_to_node_by_elem INTEGER i_get_node_con_to_node_by_mpc INTEGER i_get_node_used_by_elem INTEGER i_get_node_used_by_mpc INTEGER i_get_elem_using_node INTEGER i_get_elem_adj_to_elem INTEGER i_get_elem_adj_to_mpc INTEGER i_get_mpc_using_node INTEGER i_get_mpc_adj_to_elem INTEGER i_get_mpc_adj_to_mpc STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value node_label (TRUE ) quad_elem_label( TRUE ) #--------------------------------------------------------------------# Create Surface with 5 elements i_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value #--------------------------------------------------------------------# Get the element associated with Node 1 and Elements adjacent # to Elm 3.

Main Index

326 PCL Reference Manual Examples
Tools Menu

s_in_list i_get_node_con_to_node_by_elem i_get_node_con_to_node_by_mpc i_get_node_used_by_elem i_get_node_used_by_mpc i_get_elem_using_node i_get_elem_adj_to_elem i_get_elem_adj_to_mpc i_get_mpc_using_node i_get_mpc_adj_to_elem i_get_mpc_adj_to_mpc

= = = = = = = = = = =

"Node 1 Elm 3" 0 0 0 0 1 1 0 0 0 0 @ @ @ @ @ @ @ @ @ @ @ @ @

i_return_value = list_create_fem_con_fem ( s_in_list, i_get_node_con_to_node_by_elem, i_get_node_con_to_node_by_mpc, i_get_node_used_by_elem, i_get_node_used_by_mpc, i_get_elem_using_node, i_get_elem_adj_to_elem, i_get_elem_adj_to_mpc, i_get_mpc_using_node, i_get_mpc_adj_to_elem, i_get_mpc_adj_to_mpc, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string( sv_return_list) sys_free_string( sv_created_nodes) sys_free_string( sv_created_elems) sys_free_string( sv_ids_of_created_entities) #---------------------------------------------------------------------

list_create_node_ass_elem
# # # # # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_create_node_ass_elem() This function creates a list of all nodes associated with a list of elements. In this example a new database is opened. Geometry consisting of a single curve and surface of dimension 2 X 1 is created. 2 "quad" elements are created using "Surface 1". Then the list of nodes associated with "Element 1" is obtained using this function in "lista" and and "sv_return_list". This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function list_create_node_ass_elem() has the following arguments: list_create_node_ass_elem ( element_list, target, return_list )

Main Index

Chapter 2: Basic Functions 327
Tools Menu

# #--------------------------------------------------------------------# Variable Declarations STRING s_element_list[64] STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_mesh_s_nodes[VIRTUAL] STRING sv_mesh_s_elems[VIRTUAL] STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", "Curve 1 ", sv_sgm_surface ) dump i_return_value @ @

@ @

@ @ @

#--------------------------------------------------------------------# Create FEM entities i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems ) dump i_return_value #--------------------------------------------------------------------# Create list of all nodes associated with "Element 1" s_element_list = "Element 1" s_target = "lista" i_return_value = list_create_node_ass_elem ( s_element_list, s_target, sv_return_list ) dump i_return_value dump sv_return_list @ @ @ @

Main Index

328 PCL Reference Manual Examples
Tools Menu

dump lista #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_mesh_s_nodes) sys_free_string( sv_mesh_s_elems) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_node_ass_geo

()

# # Purpose : This file provides an example of a call to the # function list_create_node_ass_geo() # # This function creates a list of all nodes # associated with a list of geometric entities. # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. 2 "quad" # elements are created using "Surface 1". Then # the list of nodes associated with "Curve 1" # is obtained using this function in "lista" and # and "sv_return_list". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_node_ass_geo() # has the following arguments: # # list_create_node_ass_geo # ( geometry_list, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_geometry_list[64] STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_mesh_s_nodes[VIRTUAL] STRING sv_mesh_s_elems[VIRTUAL] STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @

Main Index

Chapter 2: Basic Functions 329
Tools Menu

asm_const_grid_xyz ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", "Curve 1 ", sv_sgm_surface ) dump i_return_value

@

@ @

@ @

@ @ @

#--------------------------------------------------------------------# Create FEM entities i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems ) dump i_return_value #--------------------------------------------------------------------# Create list of all nodes associated with "Curve 1" s_geometry_list = "Curve 1" s_target = "lista" i_return_value = list_create_node_ass_geo ( s_geometry_list, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_mesh_s_nodes) sys_free_string( sv_mesh_s_elems) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_node_ass_group
# # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_create_node_ass_group() This function creates a list of all nodes associated with a list of specified groups. In this example a new database is opened. Geometry consisting of a single curve and surface of dimension 2 X 1 is created. 2 "quad"

Main Index

330 PCL Reference Manual Examples
Tools Menu

# elements are created using "Surface 1". Then # the list of nodes present in "default_group" # is obtained using this function in "lista" and # and "sv_return_list". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_node_ass_group() # has the following arguments: # # list_create_node_ass_group # ( group_list, # number_of_groups, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING sa_group_list[32](1) INTEGER i_number_of_groups STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_mesh_s_nodes[VIRTUAL] STRING sv_mesh_s_elems[VIRTUAL] STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", "Curve 1 ", sv_sgm_surface ) dump i_return_value @ @

@ @

@ @ @

#--------------------------------------------------------------------# Create FEM entities i_return_value = @

Main Index

Chapter 2: Basic Functions 331
Tools Menu

fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems ) dump i_return_value #--------------------------------------------------------------------# Create list of all nodes present in "default_group". sa_group_list(1) = "default_group" i_number_of_groups = 1 s_target = "lista" i_return_value = list_create_node_ass_group ( sa_group_list, i_number_of_groups, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_mesh_s_nodes) sys_free_string( sv_mesh_s_elems) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_node_att_fringe
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_create_node_att_fringe() This function creates a list of all nodes with specified fringe value in a single group of geometric entities. In this example a field.db is opened and the fringe plots for displacement and translation are created. Then this function is called to create a list of elements between specified fringe values in "lista" and "sv_return_list". Before running this session file run field.ses to create field.db. Follow the instruction in the field.ses file for analysis. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function list_create_node_att_fringe() has the following arguments: list_create_node_att_fringe ( fringe_limits, fringe_comparison_type, tolerance, group_name,

Main Index

332 PCL Reference Manual Examples
Tools Menu

# target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations REAL ra_fringe_limits(2) STRING s_fringe_comparison_type[7] REAL r_tolerance STRING s_group_name[32] STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open the database "field.db" uil_file_open.go("field.db") # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value @ @

#--------------------------------------------------------------------# Initialize parameters for fringe plot i_return_value = @ res_init_fringe_plot( ) dump i_return_value # Create plot record for fringe plot i_return_value = res_create_fringe_plot_rec3 ( 1,2,1,1,1,1,0,0,1.,"",1,2,3,23,1,1,0.,30,0,1 ) dump i_return_value @ @

# Create a fringe plot i_return_value = @ res_make_fringe_plot @ ( 1, [1], [1], [""], [0.], ["Default, Static Subcase:"// @ " Displacements, Translational (VEC-MAG) -MSC.Nastran"]) dump i_return_value # Clear memory used in fringe plot and exit fringe plot module i_return_value = @ res_deinit_fringe_plot( ) dump i_return_value #--------------------------------------------------------------------# Create a list of all nodes for a specified range of fringe value ra_fringe_limits(1) ra_fringe_limits(2) s_fringe_comparison_type r_tolerance s_group_name s_target = = = = = = 1.361E-05 7.4839998E-05 "range" 5.0000002E-19 "default_group" "lista" @ @ @ @ @ @ @

i_return_value = list_create_node_att_fringe ( ra_fringe_limits, s_fringe_comparison_type, r_tolerance, s_group_name, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista

#---------------------------------------------------------------------

Main Index

Chapter 2: Basic Functions 333
Tools Menu

# Free allocated memory sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_node_att_value

()

# # Purpose : This file provides an example of a call to the # function list_create_node_att_value() # # This function creates a list of all nodes # within a given coordinate range. # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. 2 "quad" # elements are created using "Surface 1". Then # the list of nodes with X coordinate value = 0 # is obtained using this function in "lista" and # and "sv_return_list". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_node_att_value() # has the following arguments: # # list_create_node_att_value # ( coord_values, # coord_values_active, # coord_comparison_type, # tolerance, # coord_name, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations REAL ra_coord_values(6) LOGICAL la_coord_values_active(3) STRING sa_coord_comparison_type[7](3) REAL ra_tolerance(3) STRING s_coord_name[32] STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_mesh_s_nodes[VIRTUAL] STRING sv_mesh_s_elems[VIRTUAL] STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @

Main Index

334 PCL Reference Manual Examples
Tools Menu

asm_const_grid_xyz ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0", "Curve 1 ", sv_sgm_surface ) dump i_return_value

@

@ @

@ @

@ @ @

#--------------------------------------------------------------------# Create FEM entities i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_mesh_s_nodes, sv_mesh_s_elems ) dump i_return_value #--------------------------------------------------------------------# Create list of all nodes with X = 0 ra_coord_values(1) la_coord_values_active(1) sa_coord_comparison_type(1) ra_tolerance(1) s_coord_name s_target = = = = = = 0.0 TRUE "equal" 0.05 "Coord 0" "lista" @ @ @ @ @ @ @ @

i_return_value = list_create_node_att_value ( ra_coord_values, la_coord_values_active, sa_coord_comparison_type, ra_tolerance, s_coord_name, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_mesh_s_nodes) sys_free_string( sv_mesh_s_elems) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_point_ass_geo
# #

()

Purpose

:

This file provides an example of a call to the

Main Index

Chapter 2: Basic Functions 335
Tools Menu

# function list_create_point_ass_geo() # # This function creates a list of all points from # a list of geometric entities. # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. The list of # points associated with "Curve 1" is obtained # using this function in "lista" and # "sv_return_list". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_point_ass_geo() # has the following arguments: # # list_create_point_ass_geo # ( entity_list, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_entity_list[8] STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", sv_sgm_surface ) dump i_return_value @ @

@ @

@ @ @

#--------------------------------------------------------------------# Create list of all points associated with "Curve 1".

Main Index

336 PCL Reference Manual Examples
Tools Menu

s_entity_list s_target

= "Curve 1" = "lista" @ @ @ @

i_return_value = list_create_point_ass_geo ( s_entity_list, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_point_ass_group

()

# # Purpose : This file provides an example of a call to the # function list_create_point_ass_group() # # This function creates a list of all points # associated with specified group. # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. The list of # points associated with "default_group" is # obtained using this function in "lista" # and "sv_return_list". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_point_ass_group() # has the following arguments: # # list_create_point_ass_group # ( group_list, # number_of_groups, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING sa_group_list[32](1) INTEGER i_number_of_groups STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing

Main Index

Chapter 2: Basic Functions 337
Tools Menu

i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", sv_sgm_surface ) dump i_return_value @ @

@ @

@ @ @

#--------------------------------------------------------------------# Create list of all points present in "default_group " sa_group_list(1) = "default_group" i_number_of_groups = 1 s_target = "lista" i_return_value = list_create_point_ass_group ( sa_group_list, i_number_of_groups, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_surface_ass_geo
# # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_create_surface_ass_geo() This function creates a list of all surfaces from a list of geometric entities. In this example a new database is opened. Geometry consisting of a single curve and surface of dimension 2 X 1 is created. The list of surfaces associated with "Curve 1" is obtained using this function in "lista" and "sv_return_list".

Main Index

338 PCL Reference Manual Examples
Tools Menu

# This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_surface_ass_geo() # has the following arguments: # # list_create_surface_ass_geo # ( entity_list, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_entity_list[64] STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", sv_sgm_surface ) dump i_return_value @ @

@ @

@ @ @

#--------------------------------------------------------------------# Create list of all surfaces from "Curve 1 " s_entity_list s_target = "Curve 1" = "lista" @ @ @ @

i_return_value = list_create_surface_ass_geo ( s_entity_list, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista

Main Index

Chapter 2: Basic Functions 339
Tools Menu

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_surface_ass_group

()

# # Purpose : This file provides an example of a call to the # function list_create_surface_ass_group() # # This function creates a list of all surfaces # associated with specified group. # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. The list of # surfaces associated with "default_group" is # obtained using this function in "lista" # and "sv_return_list". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_surface_ass_group() # has the following arguments: # # list_create_surface_ass_group # ( group_list, # number_of_groups, # target, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING sa_group_list[32](1) INTEGER i_number_of_groups STRING s_target[6] STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = @

Main Index

340 PCL Reference Manual Examples
Tools Menu

asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", sv_sgm_surface ) dump i_return_value

@

@ @

@ @ @

#--------------------------------------------------------------------# Create list of all surfaces present in "default_group " sa_group_list(1) = "default_group" i_number_of_groups = 1 s_target = "lista" i_return_value = list_create_surface_ass_group ( sa_group_list, i_number_of_groups, s_target, sv_return_list ) dump i_return_value dump sv_return_list dump lista @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) sys_free_string( sv_return_list) #---------------------------------------------------------------------

list_create_target_list
# # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of 2 calls to the function list_create_target_list() This function allocates space for a string, sets the value of the allocated string using an input string and assigns the allocated string to one of two global string variables named "lista" or "listb" based on the settings of the two matching internal global variables named "lista_nomerge" and "listb_nomerge". In this example a new database is opened and a cube of dimension 1 X 1 X 1 is created. Then the input string "s_entity_list" is assigned a value. The string is then targeted to global string "lista" using this function. The value of the global string "lista" is checked before and after the calling of this function. Once again the string "s_entity_list" is assigned and targeted to "lista" for appending. The global variable "lista_nomerge" is assigned TRUE for not sorting the new "lista".

Main Index

Chapter 2: Basic Functions 341
Tools Menu

# This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_create_target_list() # has the following arguments: # # list_create_target_list # ( target, # entity_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_target[6] STRING s_entity_list[64] INTEGER i_return_value STRING sv_hpat_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set IS0-1 Viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Cube of dimension 1 X 1 X 1 i_return_value = @ asm_const_hpat_xyz @ ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_ids ) dump i_return_value #--------------------------------------------------------------------# Value of global string "lista" before targeting dump lista # Target input string to "lista" s_target = "lista" s_entity_list = "Point 1 4 3" i_return_value = list_create_target_list ( s_target, s_entity_list ) dump i_return_value dump s_entity_list

@ @ @

# Value of global string "lista" after targeting dump lista #--------------------------------------------------------------------# Dot not sort the boolean list lista_nomerge = TRUE # Target input string to "lista" again. s_target = "lista" s_entity_list = "Point 2 5 7 8 6" i_return_value = list_create_target_list ( s_target, s_entity_list ) dump i_return_value dump s_entity_list # Value of global string "lista" after targeting dump lista #---------------------------------------------------------------------

@ @ @

Main Index

342 PCL Reference Manual Examples
Tools Menu

# Free allocated memory sys_free_string( sv_hpat_ids) #---------------------------------------------------------------------

list_filter_by_elem_dim

()

# # Purpose : This file provides an example of a call to the # function list_filter_by_elem_dim() # # In this example a new database is opened and # 5 quad elements with different dimensions are # created. Then this function is called to get # the list of elements within a certain # dimension range from an input list. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_filter_by_elem_dim() # has the following arguments: # # list_filter_by_elem_dim # ( input_list, # criterion, # segment_count, # minimum, # maximum, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list[32] STRING s_criterion[32] INTEGER i_segment_count REAL r_minimum REAL r_maximum STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_created_entities_list[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value quad_elem_label( TRUE ) #--------------------------------------------------------------------# Create quad elements i_return_value = @ fem_create_elems( "Quad", "Quad4", "1", "Standard", TRUE, @ "[0 0 0][2 0 0][3 0 0][5 0 0][6 0 0]", "[2 0 0][3 0 0]"// @ "[5 0 0][6 0 0][9 0 0]", "[2 1 0][3 1 0][5 1 0][6 1 0]"// @ "[9 1 0]", "[0 1 0][2 1 0][3 1 0][5 1 0][6 1 0]", "", "", "",@ "", sv_created_entities_list ) dump i_return_value #--------------------------------------------------------------------# Get the list of elements whose edge lengths are in specified # range

Main Index

Chapter 2: Basic Functions 343
Tools Menu

s_input_list s_criterion i_segment_count r_minimum r_maximum

= = = = =

"Element 1:5" "EdgeLengthMax" 0 1.5 2.5 @ @ @ @ @ @ @

i_return_value = list_filter_by_elem_dim ( s_input_list, s_criterion, i_segment_count, r_minimum, r_maximum, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string( sv_return_list) sys_free_string( sv_created_entities_list) #---------------------------------------------------------------------

list_filter_by_ent_shape

()

# # Purpose : This file provides an example of a call to the # function list_filter_by_ent_shape() # # In this example a new database is opened and # different types of finite elements are created. # Then this function is called to get the # list of curves, surfaces, beams elements, # quad elements and hex elements from an input # list. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_filter_by_ent_shape() # has the following arguments: # # list_filter_by_ent_shape # ( input_list, # geometric_points, # geometric_curves, # geometric_surfaces, # geometric_solids, # element_points, # element_beams, # element_tria, # element_quad, # element_tet, # element_wedge, # element_hex, # node, # mpc, # any_other, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list[128] INTEGER i_geometric_points INTEGER i_geometric_curves INTEGER i_geometric_surfaces

Main Index

344 PCL Reference Manual Examples
Tools Menu

INTEGER i_geometric_solids INTEGER i_element_points INTEGER i_element_beams INTEGER i_element_tria INTEGER i_element_quad INTEGER i_element_tet INTEGER i_element_wedge INTEGER i_element_hex INTEGER i_node INTEGER i_mpc INTEGER i_any_other STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_created_entities[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value bar_elem_label( TRUE ) tri_elem_label( TRUE ) quad_elem_label( TRUE ) hex_elem_label( TRUE ) #--------------------------------------------------------------------# Create Solid and various types of elements i_return_value = asm_const_hpat_xyz( "1", "<2 1 1>", "[0 0 0]", "Coord 0", sv_created_entities ) dump i_return_value i_return_value = sgm_const_surface_extrude( "1", "<-2 0 0>", 1., 0., "[0 0 0]", "Coord 0", "Solid 1.1.3 ", sv_created_entities ) dump i_return_value i_return_value = sgm_const_surface_extrude( "2", "<0 0 -2>", 1., 0., "[0 0 0]", "Coord 0", "Solid 1.4.1 ", sv_created_entities ) dump i_return_value @ @

@ @

@ @

i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 2 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Tria3", "10", "5", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value i_return_value = fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [1.], "Hex8", "16", "9", "Coord 0", "Coord 0", i_num_nodes, i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value @ @ @

Main Index

Chapter 2: Basic Functions 345
Tools Menu

i_return_value = fem_create_elems( "Bar ", "Bar2", "11", "Standard", FALSE, "Node 14 ", "Node 7 ", "", "", "", "", "", "", sv_created_entities ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Get entities with mentioned relations s_input_list = "Node 1:27 Elm 1:11 Point 1:12 " // "Surface 1 2 Solid 1" i_geometric_points = 0 i_geometric_curves = 1 i_geometric_surfaces = 1 i_geometric_solids = 0 i_element_points = 0 i_element_beams = 1 i_element_tria = 0 i_element_quad = 1 i_element_tet = 0 i_element_wedge = 0 i_element_hex = 1 i_node = 0 i_mpc = 0 i_any_other = 0 i_return_value = list_filter_by_ent_shape ( s_input_list, i_geometric_points, i_geometric_curves, i_geometric_surfaces, i_geometric_solids, i_element_points, i_element_beams, i_element_tria, i_element_quad, i_element_tet, i_element_wedge, i_element_hex, i_node, i_mpc, i_any_other, sv_return_list ) dump i_return_value dump sv_return_list sys_free_string(sv_return_list) sys_free_string(sv_created_entities) sys_free_string(sv_created_nodes) sys_free_string(sv_created_elems) #--------------------------------------------------------------------@

@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @

list_filter_by_ep_type
# # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_filter_by_ep_type() In this example a new database is opened and a solid & a surface are created. The created solid and surface are meshed into hex and quad elements respectively. 2 Element properties are created and associated with some of the finite elements. Then this

Main Index

346 PCL Reference Manual Examples
Tools Menu

# function is called to get entities of "Shell" # type from a set of input entities. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_filter_by_ep_type() # has the following arguments: # # list_filter_by_ep_type # ( input_list, # ep_type_count, # ep_type_name, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list[128] INTEGER i_ep_type_count STRING sa_ep_type_name[32](1) STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value quad_elem_label( TRUE ) hex_elem_label( TRUE ) #--------------------------------------------------------------------# Create solid and surface i_return_value = @ asm_const_hpat_xyz( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities ) dump i_return_value i_return_value = asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 1]", "Coord 0", sv_ids_of_created_entities ) dump i_return_value i_return_value = fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [1.], "Hex8", "1", "1", "Coord 0", "Coord 0", i_num_nodes, i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value @ @

@ @ @

i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "25", "6", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value #--------------------------------------------------------------------# Create Material and Element properties. i_return_value = @

Main Index

Chapter 2: Basic Functions 347
Tools Menu

material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] ) dump i_return_value i_return_value = elementprops_create( "NEW_EP_1", 71, 25, 30, 1, 1, 20, [13, 21, 4124, 4126, 4125], [5, 4, 4, 4, 4], ["m:Aluminium", "", "", "", ""], "Elm 1:3" ) dump i_return_value i_return_value = elementprops_create( "NEW_EP_2", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], ["m:Aluminium", "", "0.2", "", "", "", ""] , "Elm 9:10") dump i_return_value @ @ @

@ @ @

#--------------------------------------------------------------------# Get the list of elements having element-property as "Shell" s_input_list = "Element 1:10" i_ep_type_count = 1 sa_ep_type_name(1) = "Shell" i_return_value = list_filter_by_ep_type ( s_input_list, i_ep_type_count, sa_ep_type_name, sv_return_list ) dump i_return_value dump sv_return_list sys_free_string(sv_return_list) sys_free_string(sv_ids_of_created_entities) sys_free_string(sv_created_nodes) sys_free_string(sv_created_elems) #--------------------------------------------------------------------@ @ @ @ @

list_filter_by_ep_value
# # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_filter_by_ep_value() In this example a new database is opened and 5 surface are created. The surface are meshed into quad elements. 3 different element properties (with different thickness values) are associated with different elements. Then this function is called to get the list of elements whose thickness lie between 0.15 and 0.25 units from a set of input entities. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function list_filter_by_ep_value() has the following arguments:

Main Index

348 PCL Reference Manual Examples
Tools Menu

# # list_filter_by_ep_value # ( input_list, # element_property, # component, # minimum, # maximum, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list[128] STRING s_element_property[32] INTEGER i_component REAL r_minimum REAL r_maximum STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_created_node[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value quad_elem_label(TRUE) #--------------------------------------------------------------------# Create curve, surfaces and finite elements. i_return_value = @ asm_const_line_2point( "#", "[0 0 0][0 1 -1][0 1 -1]"// @ "[0 2 -2][0 2 -2][5 0 0][5 1 -1][5 1 -1][5 2 -2][5 2 -2]", @ "[0 0 -1][0 0 -1][0 1 -2][0 1 -2][0 2 -3][5 0 -1][5 0 -1]"// @ "[5 1 -2][5 1 -2][5 2 -3]", 0, "", 50., 1, @ sv_ids_of_created_entities ) dump i_return_value i_return_value = sgm_const_surface_2curve( "#", "Curve 1:5 ", "Curve 6:10", sv_ids_of_created_entities ) dump i_return_value @ @

i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1:5 ", 1, @ [1.], "Quad4", "1", "1", "Coord 0", "Coord 0", @ i_num_nodes, i_num_elems, sv_created_node, sv_created_elems ) #--------------------------------------------------------------------i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_1", 0, "", "Isotropic", 1, "Directionality", 1, @ "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs",["Elastic Modulus","Poisson Ratio","Density"],@ [2, 5, 16, 0], "Property Values", ["10E6", "0.11", "0.1", ""]) dump i_return_value i_return_value = material.create( "Analysis code ID", 1, "Analysis type ID", 1, "MAT_2", 0, "", "Isotropic", 1, "Directionality", 1, @ @ @

Main Index

Chapter 2: Basic Functions 349
Tools Menu

"Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs",["Elastic Modulus","Poisson Ratio","Density"],@ [2, 5, 16, 0], "Property Values", ["20E6", "0.22", "0.2", ""]) dump i_return_value i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_3", 0, "", "Isotropic", 1, "Directionality", 1, @ "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs",["Elastic Modulus","Poisson Ratio","Density"],@ [2, 5, 16, 0], "Property Values", ["30E6", "0.33", "0.3", ""]) dump i_return_value i_return_value = elementprops_create( "EP_1", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_1", "", "0.1", "", "", "", ""], "Element 1:5" ) dump i_return_value i_return_value = elementprops_create( "EP_2", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_2", "", "0.2", "", "", "", ""], "Element 6:15") dump i_return_value i_return_value = elementprops_create( "EP_3", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_3", "", "0.3", "", "", "", ""], "Element 16:25" ) dump i_return_value @ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Get elements whose thickness lie between 0.15 and 0.25 s_input_list s_element_property i_component r_minimum r_maximum = = = = = "Element 1:25" "Thickness" 0 0.15 0.25 @ @ @ @ @ @ @

i_return_value = list_filter_by_ep_value ( s_input_list, s_element_property, i_component, r_minimum, r_maximum, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string( sv_return_list) sys_free_string( sv_ids_of_created_entities) sys_free_string( sv_created_node) sys_free_string( sv_created_elems) #---------------------------------------------------------------------

list_filter_by_fem_type
# # # #

()

Purpose

:

This file provides an example of a call to the function list_filter_by_fem_type()

Main Index

350 PCL Reference Manual Examples
Tools Menu

# In this example a new database is opened and # different types of finite elements are created. # Then this function is called to get the # list of elements which are of type Hex8 and # Bar2 from an input list. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_filter_by_fem_type() # has the following arguments: # # list_filter_by_fem_type # ( input_list, # fem_type_count, # fem_type_name, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list[128] INTEGER i_fem_type_count STRING sa_fem_type_name[32](2) STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_created_entities[VIRTUAL] STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value bar_elem_label( TRUE ) tri_elem_label( TRUE ) quad_elem_label( TRUE ) hex_elem_label( TRUE ) #--------------------------------------------------------------------# Create different type of elments i_return_value = @ asm_const_hpat_xyz( "1", "<2 1 1>", "[0 0 0]", "Coord 0", @ sv_created_entities ) dump i_return_value i_return_value = sgm_const_surface_extrude( "1", "<-2 0 0>", 1., 0., "[0 0 0]", "Coord 0", "Solid 1.1.3 ", sv_created_entities ) dump i_return_value i_return_value = sgm_const_surface_extrude( "2", "<0 0 -2>", 1., 0., "[0 0 0]", "Coord 0", "Solid 1.4.1 ", sv_created_entities ) dump i_return_value @ @

@ @

i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 2 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value

Main Index

Chapter 2: Basic Functions 351
Tools Menu

i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Tria3", "10", "5", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value i_return_value = fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [1.], "Hex8", "16", "9", "Coord 0", "Coord 0", i_num_nodes, i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value i_return_value = fem_create_elems( "Bar ", "Bar2", "11", "Standard", FALSE, "Node 14 ", "Node 7 ", "", "", "", "", "", "", sv_created_entities ) dump i_return_value @ @ @

@ @ @

#--------------------------------------------------------------------# Get elements which are of type Hex8 and Bar2 s_input_list i_fem_type_count sa_fem_type_name(1) sa_fem_type_name(2) = = = = "Node 1:27 Elm 1:11" 2 "ElmHex8" "ElmBar2" @ @ @ @ @

i_return_value = list_filter_by_fem_type ( s_input_list, i_fem_type_count, sa_fem_type_name, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string( sv_return_list) sys_free_string( sv_created_entities) sys_free_string( sv_created_nodes) sys_free_string( sv_created_elems) #---------------------------------------------------------------------

list_filter_by_lbc_type
# # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_filter_by_lbc_type() In this example a new database is opened and a surface with displacement and pressure loads is created. Then this function is called to get the list of elements which have loads of type "Displacement" and "Pressure" from an input list. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function list_filter_by_lbc_type() has the following arguments: list_filter_by_lbc_type ( input_list, lbc_type_count, lbc_type_name,

Main Index

352 PCL Reference Manual Examples
Tools Menu

# return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list[128] INTEGER i_lbc_type_count STRING sa_lbc_type_name[32](2) STRING sv_return_list[VIRTUAL] INTEGER i_return_value STRING sv_ids_of_created_entities[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value node_label ( TRUE ) quad_elem_label( TRUE ) #--------------------------------------------------------------------# Create Surface and LBCs i_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value i_return_value = loadsbcs_create( "NEW_DISP", "Displacement", "Nodal", "", "Static", [ "Point 1 4"], "Geometry", "Coord 0", 1., ["< 0 0 0 >", "< 0 0 0 >"], ["" , ""] ) dump i_return_value @ @ @

i_return_value = @ loadsbcs_create( "NEW_PRESS", "Pressure", "Element Uniform", @ "2D", "Static", ["Element 4 5"], "FEM", "", 1., [" 500", @ "", ""], ["", "", ""] ) dump i_return_value #--------------------------------------------------------------------# Get elements which have loads of type "Displacement" and # "Pressure". s_input_list i_lbc_type_count sa_lbc_type_name(1) sa_lbc_type_name(2) = = = = "Node 1:12 Elm 1:5" 2 "Displacement" "Pressure" @ @ @ @ @

i_return_value = list_filter_by_lbc_type ( s_input_list, i_lbc_type_count, sa_lbc_type_name, sv_return_list ) dump i_return_value dump sv_return_list

Main Index

Chapter 2: Basic Functions 353
Tools Menu

sys_free_string( sys_free_string( sys_free_string( sys_free_string(

sv_return_list) sv_ids_of_created_entities) sv_created_nodes) sv_created_elems)

#---------------------------------------------------------------------

list_filter_by_lbc_value

()

# # Purpose : This file provides an example of a call to the # function list_filter_by_lbc_value() # # In this example a new database is opened and # a surface with Pressure LBCs of different # values is created. Then this function is # called to get the list of elements which have # pressure values are between 150 and 250 units # from an input list. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_filter_by_lbc_value() # has the following arguments: # # list_filter_by_lbc_value # ( input_list, # load_case_name, # lbc_var_name, # component, # minimum, # maximum, # evaluation_time, # evaluation_frequency, # sub_entity, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list[128] STRING s_load_case_name[32] STRING s_lbc_var_name[32] INTEGER i_component REAL r_minimum REAL r_maximum REAL r_evaluation_time REAL r_evaluation_frequency STRING s_sub_entity[32] STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_ids_of_created_entities[VIRTUAL] STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing

Main Index

354 PCL Reference Manual Examples
Tools Menu

i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value quad_elem_label( TRUE ) #--------------------------------------------------------------------# Create Surface and finite elements i_return_value = @ asm_const_patch_xyz( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value #--------------------------------------------------------------------# Create LBCs i_return_value = @ loadsbcs_create( "NEW_PRESS_ELEM_1", "Pressure", @ "Element Uniform", "2D", "Static", ["Element 1"], "FEM", @ "", 1., ["100", "", ""], ["", "", ""] ) dump i_return_value i_return_value = loadsbcs_create( "NEW_PRESS_ELEM_2_3", "Pressure", "Element Uniform", "2D", "Static", ["Element 2:3"], "FEM", "", 1., ["200", "", ""], ["", "", ""] ) dump i_return_value i_return_value = loadsbcs_create( "NEW_PRESS_ELEM_4_5", "Pressure", "Element Uniform", "2D", "Static", ["Element 4:5"], "FEM", "", 1., ["300", "", ""], ["", "", ""] ) dump i_return_value @ @ @

@ @ @

#--------------------------------------------------------------------# Get elements whose pressure values are between 150 and 250 units. s_input_list s_load_case_name s_lbc_var_name i_component r_minimum r_maximum r_evaluation_time r_evaluation_frequency s_sub_entity = = = = = = = = = "Elm 1:5" "" "Top Surf Pressure" 3 150 250 0 0 "ANY" @ @ @ @ @ @ @ @ @ @ @

i_return_value = list_filter_by_lbc_value ( s_input_list, s_load_case_name, s_lbc_var_name, i_component, r_minimum, r_maximum, r_evaluation_time, r_evaluation_frequency, s_sub_entity, sv_return_list ) dump i_return_value dump sv_return_list sys_free_string( sv_return_list) sys_free_string( sv_ids_of_created_entities)

Main Index

Chapter 2: Basic Functions 355
Tools Menu

sys_free_string( sv_created_nodes) sys_free_string( sv_created_elems) #---------------------------------------------------------------------

list_filter_by_mat_name

()

# # Purpose : This file provides an example of a call to the # function list_filter_by_mat_name() # # In this example a new database is opened and # 2 surfaces are created. A material("Aluminium") # is created and associated with surface 1. # Then this function is called to get the # elements having Aluminium as the material # from an input list. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # # The function list_filter_by_mat_name() # has the following arguments: # # list_filter_by_mat_name # ( input_list, # mat_count, # mat_name, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list[128] INTEGER i_mat_count STRING sa_mat_name[32](1) STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_ids_of_created_entities[VIRTUAL] STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value surface_label(TRUE) quad_elem_label( TRUE ) #--------------------------------------------------------------------# Create Surface and finite elements. i_return_value = @ asm_const_patch_xyz( "#", "<5 1 0>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities ) dump i_return_value i_return_value = asm_const_patch_xyz( "#", "<5 0 1>", "[0 0 0]", "Coord 0", sv_ids_of_created_entities ) @ @

Main Index

356 PCL Reference Manual Examples
Tools Menu

dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0,"Surface 1 2", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value #--------------------------------------------------------------------# Create Material and Element properties. i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] ) dump i_return_value i_return_value = @ elementprops_create( "NEW_EP", 51, 25, 35, 1, 1, 20, [13, 20,@ 36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:Aluminium", "", "0.2", "", "", "", ""] , "Surface 1" ) dump i_return_value #--------------------------------------------------------------------# Get Elements which have "Aluminium" as material. s_input_list = "Element 1:10" i_mat_count = 1 sa_mat_name(1) = "Aluminium" i_return_value = list_filter_by_mat_name ( s_input_list, i_mat_count, sa_mat_name, sv_return_list ) dump i_return_value dump sv_return_list @ @ @ @ @

sys_free_string( sv_return_list) sys_free_string( sv_ids_of_created_entities) sys_free_string( sv_created_nodes) sys_free_string( sv_created_elems) #---------------------------------------------------------------------

list_filter_by_mat_type
# # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function list_filter_by_mat_type() In this example a new database is opened and 2 surfaces are created. A material (Aluminium) is created and associated with some of the elements. Then this function is called to get the elements having "isotropic" as the material-type from an input list. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown

Main Index

Chapter 2: Basic Functions 357
Tools Menu

# menus on the menu bar. # # The function list_filter_by_mat_type() # has the following arguments: # # list_filter_by_mat_type # ( input_list, # mat_type_count, # mat_type_name, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list[128] INTEGER i_mat_type_count STRING sa_mat_type_name[32](1) STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_ids_of_created_entities[VIRTUAL] STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value surface_label(TRUE) quad_elem_label(TRUE) #--------------------------------------------------------------------# Create surface and finite elements i_return_value = @ asm_const_patch_xyz( "#", "<5 1 0>", "[0 0 0]", "Coord 0", @ sv_ids_of_created_entities ) dump i_return_value i_return_value = asm_const_patch_xyz( "#", "<5 0 1>", "[0 0 0]", "Coord 0", sv_ids_of_created_entities ) dump i_return_value @ @

i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0,"Surface 1 2", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value #--------------------------------------------------------------------# Create material and element property. i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "Aluminium", 0, "", "Isotropic", 1, "Directionality", @ 1, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16, 0], "Property Values", ["10E6","0.33",@ "0.1", ""] ) dump i_return_value i_return_value = @ elementprops_create( "NEW_EP", 51, 25, 35, 1, 1, 20, [13, 20,@

Main Index

358 PCL Reference Manual Examples
Tools Menu

36, 4037, 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], @ ["m:Aluminium", "", "0.2", "", "", "", ""] , "Surface 1" ) dump i_return_value #--------------------------------------------------------------------# Get entities with material type "Isotropic" s_input_list = "Surface 1:2 Element 4:10" i_mat_type_count = 1 sa_mat_type_name(1) = "Isotropic" i_return_value = list_filter_by_mat_type ( s_input_list, i_mat_type_count, sa_mat_type_name, sv_return_list ) dump i_return_value dump sv_return_list @ @ @ @ @

sys_free_string( sv_return_list) sys_free_string( sv_ids_of_created_entities) sys_free_string( sv_created_nodes) sys_free_string( sv_created_elems) #---------------------------------------------------------------------

list_filter_by_mat_value

()

# # Purpose : This file provides an example of a call to the # function list_filter_by_mat_value() # # In this example a new database is opened and 5 # surfaces are created with different Material # properties. The surfaces are meshed with quad # elements. Then this function is called to get # the list of elements whose poisson-ratio lie # within a range of 0.05 to 0.25 from an input # list. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_filter_by_mat_value() # has the following arguments: # # list_filter_by_mat_value # ( input_list, # mat_prop_name, # minimum, # maximum, # eval_at_temperature, # evaluation_strain, # evaluation_rate, # evaluation_time, # evaluation_frequency, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list[128] STRING s_mat_prop_name[32] REAL r_minimum REAL r_maximum REAL r_eval_at_temperature

Main Index

Chapter 2: Basic Functions 359
Tools Menu

REAL r_evaluation_strain REAL r_evaluation_rate REAL r_evaluation_time REAL r_evaluation_frequency STRING sv_return_list[VIRTUAL] INTEGER i_return_value INTEGER i_num_nodes INTEGER i_num_elems STRING sv_ids_of_created_entities[VIRTUAL] STRING sv_created_nodes[VIRTUAL] STRING sv_created_elems[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value surface_label(TRUE) quad_elem_label( TRUE ) #--------------------------------------------------------------------# Create 5 surface i_return_value = asm_const_line_2point( "#", "[0 0 0][0 1 -1][0 1 -1]"// "[0 2 -2][0 2 -2][5 0 0][5 1 -1][5 1 -1][5 2 -2][5 2 -2]", "[0 0 -1][0 0 -1][0 1 -2][0 1 -2][0 2 -3][5 0 -1][5 0 -1]"// "[5 1 -2][5 1 -2][5 2 -3]", 0, "", 50., 1, sv_ids_of_created_entities ) dump i_return_value i_return_value = sgm_const_surface_2curve( "#", "Curve 1:5 ", "Curve 6:10", sv_ids_of_created_entities ) dump i_return_value @ @ @ @ @

@ @

i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0,"Surface 1:5", 1, [1.], @ "Quad4", "1", "1", "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_created_nodes, sv_created_elems ) dump i_return_value #--------------------------------------------------------------------# Create Material and Element properties i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_1", 0, "", "Isotropic", 1, "Directionality", 1, @ "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs",["Elastic Modulus","Poisson Ratio","Density"],@ [2, 5, 16, 0], "Property Values", ["10E6", "0.11", "0.1", ""]) dump i_return_value i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_2", 0, "", "Isotropic", 1, "Directionality", 1, @ "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs",["Elastic Modulus","Poisson Ratio","Density"],@ [2, 5, 16, 0], "Property Values", ["20E6", "0.22", "0.2", ""]) dump i_return_value i_return_value = @

Main Index

360 PCL Reference Manual Examples
Tools Menu

material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "MAT_3", 0, "", "Isotropic", 1, "Directionality", 1, @ "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, 0, 0],@ "Active Flag", 1, "Create", 10, "External Flag", FALSE, @ "Property IDs",["Elastic Modulus","Poisson Ratio","Density"],@ [2, 5, 16, 0], "Property Values", ["30E6", "0.33", "0.3", ""]) dump i_return_value i_return_value = elementprops_create( "EP_1", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_1", "", "0.1", "", "", "", ""], "Surface 1" ) dump i_return_value i_return_value = elementprops_create( "EP_2", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_2", "", "0.2", "", "", "", ""], "Surface 2 3" ) dump i_return_value i_return_value = elementprops_create( "EP_3", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, 4111, 4118, 4119], [5,9,1,1, 1, 1, 1],["m:MAT_3", "", "0.3", "", "", "", ""], "Surface 4 5" ) dump i_return_value @ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Get the list of elements whose poisson-ratio lie within a # range of 0.05 to 0.25 s_input_list s_mat_prop_name r_minimum r_maximum r_eval_at_temperature r_evaluation_strain r_evaluation_rate r_evaluation_time r_evaluation_frequency = = = = = = = = = "Surface 2:5 Element 5:25" "Poisson Ratio" 0.05 0.25 0.0 0.0 0.0 0.0 0.0 @ @ @ @ @ @ @ @ @ @ @

i_return_value = list_filter_by_mat_value ( s_input_list, s_mat_prop_name, r_minimum, r_maximum, r_eval_at_temperature, r_evaluation_strain, r_evaluation_rate, r_evaluation_time, r_evaluation_frequency, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string( sv_return_list) sys_free_string( sv_ids_of_created_entities) sys_free_string( sv_created_nodes) sys_free_string( sv_created_elems) #---------------------------------------------------------------------

list_filter_by_presence
# #

()

Purpose

:

This file provides an example of 2 calls to the

Main Index

Chapter 2: Basic Functions 361
Tools Menu

# function list_filter_by_presence() # # In this example a input list and a reference # list is defined. This function is called once # to get the entities that are exactly # referenced in both list and second time to # get the entities from input_list which are # parents of entities mentioned in # reference_list. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_filter_by_presence() # has the following arguments: # # list_filter_by_presence # ( input_list, # acceptance_criteria, # reference_list, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list[128] STRING s_acceptance_criteria[7] STRING s_reference_list[128] STRING sv_return_list[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------s_input_list s_acceptance_criteria s_reference_list = "Solid 1.1 1.1.4 1.6 Elm 1 1.1 2.2.2" = "exact" = "Solid 1.1 1.1.5 1.6.1 Elm 1 1.2 2.2.2 2.2.5" @ @ @ @ @

i_return_value = list_filter_by_presence ( s_input_list, s_acceptance_criteria, s_reference_list, sv_return_list ) dump i_return_value dump sv_return_list s_input_list s_acceptance_criteria s_reference_list

= "Solid 1.1 1.1.4 1.6 Elm 1 1.1 2.2 3.3" = "parent" = "Solid 1.1.5 1.6.1 Elm 1.2 2.2 2.3.5 3.3.2" @ @ @ @ @

i_return_value = list_filter_by_presence ( s_input_list, s_acceptance_criteria, s_reference_list, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string(sv_return_list) #---------------------------------------------------------------------

list_intersect
# # #

()

Purpose

:

This file provides an example of a call to the function list_intersect()

Main Index

362 PCL Reference Manual Examples
Tools Menu

# # In this example 2 input lists are defined and # this function is called to get entities which # are exactly referenced in both list. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_intersect() # has the following arguments: # # list_intersect # ( input_list_1, # input_list_2, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list_1[128] STRING s_input_list_2[128] STRING sv_return_list[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------s_input_list_1 = "Solid 1.1 1.1.4 1.6 Elm 1 1.1 2.2.2 3.4.5.6" s_input_list_2 = "Solid 1.1 1.1.5 1.6.1 Elm 1 1.2 2.2.2 2.2.5 3.4.5.6" i_return_value = list_intersect ( s_input_list_1, s_input_list_2, sv_return_list ) dump i_return_value dump sv_return_list @ @ @ @

sys_free_string(sv_return_list) #---------------------------------------------------------------------

list_rem_duplicate

()

# # Purpose : This file provides an example of a call to the # function list_rem_duplicate() # # In this example a list with duplication of # entities is defined. Then this function is # called to get the list without any # duplication of entities. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_rem_duplicate() # has the following arguments: # # list_rem_duplicate # ( input_list, # return_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_input_list[128]

Main Index

Chapter 2: Basic Functions 363
Tools Menu

STRING sv_return_list[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Remove duplication from input list s_input_list = "Solid 1 1.1 2.2 1.1 Elm 2.1 3.3 Solid 2.2 Elm 3.3" @ @ @

i_return_value = list_rem_duplicate ( s_input_list, sv_return_list ) dump i_return_value dump sv_return_list

sys_free_string(sv_return_list) #---------------------------------------------------------------------

list_save_group

()

# # Purpose : This file provides an example of a call to the # function list_save_group() # # This function adds a list of entities stored # in a global string variable into a group. # # In this example, the spool database is opened # and group "default_group" is posted. The global # string variable "lista" is assigned a value. # Then this function is called to save the # entities mentioned in the string to # "default_group" and posted to default viewport. # The list of members present in "default_group" # is verified before and after the addition of # entities. # # Before running this session file run spool.ses # to create spool.db # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function list_save_group() # has the following arguments: # # list_save_group # ( target_list, # group_name, # update ) # #--------------------------------------------------------------------# Variable Declarations STRING s_target_list[6] STRING s_group_name[32] LOGICAL l_update INTEGER i_return_value STRING sv_members[VIRTUAL] #--------------------------------------------------------------------# Open the database "spool.db" uil_file_open.go("spool.db") # Post the "default_group" uil_viewport_post_groups.posted_groups ( "default_viewport", @ @

Main Index

364 PCL Reference Manual Examples
Tools Menu

1, ["default_group"] ) #--------------------------------------------------------------------# Assign value to "lista" i_return_value = @ list_create_target_list @ ( "lista", "Element 1:192 " ) dump i_return_value #--------------------------------------------------------------------# Get the list of all members of group i_return_value = @ uil_group_members_get @ ( "default_group", @ sv_members ) dump i_return_value dump sv_members #--------------------------------------------------------------------# Add the list of entities in "lista" to "default_group" s_target_list = "lista" s_group_name = "default_group" l_update = FALSE i_return_value = list_save_group ( s_target_list, s_group_name, l_update ) @ @ @ @

#--------------------------------------------------------------------# Get the list of all members of group i_return_value = @ uil_group_members_get @ ( "default_group", @ sv_members ) dump i_return_value dump sv_members #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_members) # The newly added entities to "default_group" appear on the display # immediately after addition. #---------------------------------------------------------------------

uil_list_a.previous
# # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function uil_list_a.previous() This function will swap the contents of the global string variable "lista" with the contents of the global string "lista_reset". In this example a new database is opened. Geometry consisting of a single curve and surface of dimension 2 X 1 is created. Then global variable "lista" is assigned consecutively twice using the function list_create_target_list(). Then this function is called to get the first assignment made to "lista" and verified in the end. This file can be run by starting a session of

Main Index

Chapter 2: Basic Functions 365
Tools Menu

# Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_list_a.previous() has no arguments. # #--------------------------------------------------------------------# Variable Declarations INTEGER i_return_value STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", sv_sgm_surface ) dump i_return_value @ @

@ @

@ @ @

#--------------------------------------------------------------------# First assignment to global variable "lista". i_return_value = @ list_create_target_list @ ( "lista", @ "Curve 1" ) dump i_return_value # Second assignment to global variable "lista". i_return_value = list_create_target_list ( "lista", "Point 1" ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Value of global string "lista" before swapping dump lista # Set the contents of "lista_reset" to "lista" uil_list_a.previous() # Value of global string "lista" after swapping dump lista

Main Index

366 PCL Reference Manual Examples
Tools Menu

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) #---------------------------------------------------------------------

uil_list_b.previous

()

# # Purpose : This file provides an example of a call to the # function uil_list_b.previous() # # This function will swap the contents of the # global string variable "listb" with the # contents of the global string "listb_reset". # # In this example a new database is opened. Geom# etry consisting of a single curve and surface # of dimension 2 X 1 is created. Then global # variable "listb" is assigned consecutively # twice using the function # list_create_target_list(). Then this function # is called to get the first assignment made to # "listb" and verified in the end. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_list_b.previous() has no arguments. # #--------------------------------------------------------------------# Variable Declarations INTEGER i_return_value STRING sv_asm_point[VIRTUAL] STRING sv_asm_line[VIRTUAL] STRING sv_sgm_surface[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_grid_xyz @ ( "1","[0 0 0]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_grid_xyz ( "2","[0 0 1]","Coord 0",sv_asm_point) dump i_return_value i_return_value = asm_const_line_2point ( "1","Point 1 ","Point 2",0,"",50., 1, sv_asm_line ) dump i_return_value @ @

@ @

Main Index

Chapter 2: Basic Functions 367
Tools Menu

i_return_value = sgm_const_surface_extrude ( "1","<2 0 0>",1.,0.,"[0 0 0]","Coord 0","Curve 1 ", sv_sgm_surface ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# First assignment to global variable "listb". i_return_value = @ list_create_target_list @ ( "listb", @ "Curve 1" ) dump i_return_value # Second assignment to global variable "listb". i_return_value = list_create_target_list ( "listb", "Point 1" ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Value of global string "listb" before swapping dump listb # Set the contents of "listb_reset" to "listb" uil_list_b.previous() # Value of global string "listb" after swapping dump listb #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_asm_point) sys_free_string( sv_asm_line) sys_free_string( sv_sgm_surface) #---------------------------------------------------------------------

uil_list_a.clear

()

# # Purpose : This file provides an example of a call to the # function uil_list_a.clear() # # This function sets the global string # "lista_reset" to the contents of the global # string "lista" and then sets "lista" to a # single space. # # In this example a new database is opened and # global string "lista" is assigned a value. Then # this function is called to set "lista_reset" to # "lista" and then set a single space to "lista". # The value of the global string "lista" is # checked before and after the calling of this # function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_list_a.clear() has no arguments. # #--------------------------------------------------------------------# Variable Declaration INTEGER i_return_value

Main Index

368 PCL Reference Manual Examples
Tools Menu

#--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Assign value to global string "lista" i_return_value = list_create_target_list ( "lista", "Curve 1" ) dump i_return_value @ @ @

# Value of global string "lista" and "lista_reset" before clearing dump lista dump lista_reset # Set the contents of "lista" to a single space. uil_list_a.clear() # Value of global string "lista" and "lista_reset" after clearing dump lista dump lista_reset

uil_list_b.clear

()

# # Purpose : This file provides an example of a call to the # function uil_list_b.clear() # # This function sets the global string # "listb_reset" to the contents of the global # string "listb" and then sets "listb" to a # single space. # # In this example a new database is opened and # global string "listb" is assigned a value. Then # this function is called to set "listb_reset" to # "listb" and then set a single space to "listb". # The value of the global string "listb" is # checked before and after the calling of this # function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_list_b.clear() has no arguments. # #--------------------------------------------------------------------# Variable Declaration INTEGER i_return_value #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Assign value to global string "listb" i_return_value = list_create_target_list ( "listb", "Curve 1" ) dump i_return_value @ @ @

# Value of global string "listb" and "listb_reset" before clearing dump listb

Main Index

Chapter 2: Basic Functions 369
Tools Menu

dump listb_reset # Set the contents of "listb" to a single space. uil_list_b.clear() # Value of global string "listb" and "listb_reset" after clearing dump listb dump listb_reset #---------------------------------------------------------------------

uil_list_boolean.create

()

# # Purpose : This file provides an example of a call to the # function uil_list_boolean.create() # # This function creates a list of entities by # combining the contents of the global strings # "lista" and "listb" using the type of operation # specified by the input string "boolean" and # placing the results in the global string # "listc". # # In this example a new database is opened. Geom# etry consisting of a cube of dimension 1x1x1 # is created. The global variables "lista" and # "listb" are assigned using # list_create_target_list(). Then this function # is called to create a boolean set in global # variable "listc" using "and" operation. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_list_boolean.create() # has the following arguments. # # uil_list_boolean.create # ( boolean ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_return_value STRING s_boolean[7] STRING sv_hpat_xyz_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_hpat_xyz @ ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_xyz_ids ) dump i_return_value #--------------------------------------------------------------------# Assignment to global variable "lista".

Main Index

370 PCL Reference Manual Examples
Tools Menu

i_return_value = list_create_target_list ( "lista", "Point 2 4" ) dump i_return_value # Assignment to global variable "listb". i_return_value = list_create_target_list ( "listb", "Point 2 3 6 7" ) dump i_return_value

@ @ @

@ @ @

#--------------------------------------------------------------------# Create a boolen set in "listc" s_boolean = "and" uil_list_boolean.create( s_boolean ) # Value of strings "lista","listb"&"listc" after boolean operation. dump lista dump listb dump listc #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_hpat_xyz_ids) #---------------------------------------------------------------------

uil_list_a.replace

()

# # Purpose : This file provides an example of a call to the # function uil_list_a.replace() # # This function will set the contents of the # global string variable "lista_reset" to equal # the contents of the global string variable # "lista". It will then set the global string # variable "lista" to equal the contents of the # global string variable "listc" # # In this example a new database is opened. Geom# etry consisting of a cube of dimension 1x1x1 # is created. The global variables "lista" and # "listb" are assigned using # list_create_target_list(). Then the function # uil_list_boolean.create() is called to create # a boolean-set in global variable "listc". # Finally this function is called to replace # "lista" by "listc". The value of "lista" is # verified before and after the replacement. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_list_a.replace() has no arguments. # #--------------------------------------------------------------------# Variable Declarations INTEGER i_return_value STRING s_boolean[7] STRING sv_hpat_xyz_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" )

Main Index

Chapter 2: Basic Functions 371
Tools Menu

$? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_hpat_xyz @ ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_xyz_ids ) dump i_return_value #--------------------------------------------------------------------# Assignment to global variable "lista". i_return_value = @ list_create_target_list @ ( "lista", @ "Point 2 4" ) dump i_return_value # Assignment to global variable "listb". i_return_value = list_create_target_list ( "listb", "Point 2 3 6 7" ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Create a boolean set in "listc" s_boolean = "b-a" uil_list_boolean.create( s_boolean ) # Value of global string "listc" after boolean operation dump listc #--------------------------------------------------------------------# Value of global string "lista" and "lista_reset" before replacement dump lista dump lista_reset # Replace contents of "lista" by "listc" uil_list_a.replace() # Value of global string "lista" and "lista_reset" after replacement dump lista dump lista_reset #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_hpat_xyz_ids) #---------------------------------------------------------------------

uil_list_b.replace
# # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function uil_list_a.replace() This function will set the contents of the global string variable "listb_reset" to equal the contents of the global string variable "listb". It will then set the global string variable "listb" to equal the contents of the global string variable "listc"

Main Index

372 PCL Reference Manual Examples
Tools Menu

# In this example a new database is opened. Geom# etry consisting of a cube of dimension 1x1x1 # is created. The global variables "lista" and # "listb" are assigned using # list_create_target_list(). Then the function # uil_list_boolean.create() is called to create # a boolean-set in global variable "listc". # Finally this function is called to replace # "listb" by "listc". The value of "lista" is # verified before and after the replacement. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function uil_list_b.replace() has no arguments. # #--------------------------------------------------------------------# Variable Declarations INTEGER i_return_value STRING s_boolean[7] STRING sv_hpat_xyz_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric entities i_return_value = @ asm_const_hpat_xyz @ ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_xyz_ids ) dump i_return_value #--------------------------------------------------------------------# Assignment to global variable "lista". i_return_value = @ list_create_target_list @ ( "lista", @ "Point 2 4" ) dump i_return_value # Assignment to global variable "listb". i_return_value = list_create_target_list ( "listb", "Point 2 3 6 7" ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Create a boolean set in "listc" s_boolean = "b-a" uil_list_boolean.create( s_boolean ) # Value of global string "listc" after boolean operation dump listc #--------------------------------------------------------------------# Value of global string "listb" and "listb_reset" before replacement dump listb dump listb_reset # Replace contents of "listb" by "listc"

Main Index

Chapter 2: Basic Functions 373
Tools Menu

uil_list_b.replace() # Value of global string "listb" and "listb_reset" after replacement dump listb dump listb_reset #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_hpat_xyz_ids) #---------------------------------------------------------------------

mass_prop_create

()

# # Purpose : This file provides an example of a call to the # function mass_prop_create() # # This function calculates mass properties for a # set of specified entities, plots principal axes # of the inertia tensor at the center of gravity # and creates and posts a coordinate frame that # is aligned with the principal axes of the # inertia tensor. # # In this example a new database is opened and a # surface is created. It is made into finite # elements and assigned with proper material # properties. Then this function is called to # calculate the mass properties of the geometry # created. # Ignore the warnings generated during the # execution of this example. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function mass_prop_create() # has the following arguments: # # mass_prop_create # ( analysis_model_type, # all_or_group, # include, # number_of_groups, # groups, # coordinate_frame, # density, # thickness_or_area, # axisymmetric_frame, # axisymmetric_axis, # other_axis, # plot, # aligned_frame, # mass_properties, # entity_list, # length_entities, # number_of_entities, # reject_list, # length_reject, # number_of_rejects, # segment_id, # aligned_label, # coordinate_label ) # #---------------------------------------------------------------------

Main Index

374 PCL Reference Manual Examples
Tools Menu

# Variable Declarations STRING s_analysis_model_type[15] STRING s_all_or_group[5] STRING s_include[8] INTEGER i_number_of_groups STRING sa_groups[32](1) = [""] STRING s_coordinate_frame[32] STRING s_density[22] STRING s_thickness_or_area[22] STRING s_axisymmetric_frame[32] INTEGER i_axisymmetric_axis INTEGER i_other_axis LOGICAL l_plot LOGICAL l_aligned_frame REAL rv_mass_properties(VIRTUAL) STRING sv_entity_list[VIRTUAL] INTEGER i_length_entities INTEGER i_number_of_entities STRING sv_reject_list[VIRTUAL] INTEGER i_length_reject INTEGER i_number_of_rejects INTEGER i_segment_id INTEGER i_aligned_label INTEGER i_coordinate_label INTEGER i_return_value STRING sv_patch_xy_ids[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_nodes_created[VIRTUAL] STRING sv_elems_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric and Finite Element entities i_return_value = @ asm_const_patch_xyz @ ( "1", "<10 0 1>", "[0 0 0]", "Coord 0",sv_patch_xy_ids) dump i_return_value i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_nodes_created, sv_elems_created ) dump i_return_value #--------------------------------------------------------------------# Create Material and Element properties i_return_value = @ material.create @ ( "Analysis code ID",1,"Analysis type ID", 1, "new_mat", @ 0,"", "Isotropic", 1, "Directionality", 1, "Linearity",@ 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, @ 0, 0], "Active Flag", 1, "Create", 10, "External Flag",@ FALSE,"Property IDs",["Elastic Modulus", @ "Poisson Ratio","Density"],[2, 5, 16,0], "Property"// @ " Values", ["10E6","0.33","0.1", ""] ) dump i_return_value i_return_value = @

Main Index

Chapter 2: Basic Functions 375
Tools Menu

elementprops_create @ ( "new_prop", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, @ 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], ["m:new_mat",@ "", "1", "", "", "", ""], "Surface 1" ) dump i_return_value #--------------------------------------------------------------------# Calculate the mass properties s_analysis_model_type s_all_or_group s_include s_coordinate_frame s_density s_thickness_or_area l_plot l_aligned_frame = = = = = = = = "2D Plane Stress" "All" "Both" "Coord 0" "Use Element Properties" "Use Element Properties" TRUE TRUE @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @

i_return_value = mass_prop_create ( s_analysis_model_type, s_all_or_group, s_include, i_number_of_groups, sa_groups, s_coordinate_frame, s_density, s_thickness_or_area, s_axisymmetric_frame, i_axisymmetric_axis, i_other_axis, l_plot, l_aligned_frame, rv_mass_properties, sv_entity_list, i_length_entities, i_number_of_entities, sv_reject_list, i_length_reject, i_number_of_rejects, i_segment_id, i_aligned_label, i_coordinate_label ) dump i_return_value dump dump dump dump dump dump dump dump dump dump rv_mass_properties sv_entity_list i_length_entities i_number_of_entities sv_reject_list i_length_reject i_number_of_rejects i_segment_id i_aligned_label i_coordinate_label

#--------------------------------------------------------------------# Free allocated memory sys_free_array ( rv_mass_properties) sys_free_string( sv_entity_list) sys_free_string( sv_reject_list) sys_free_string( sv_patch_xy_ids) sys_free_string( sv_nodes_created) sys_free_string( sv_elems_created) #---------------------------------------------------------------------

Main Index

376 PCL Reference Manual Examples
Tools Menu

mass_prop.gen_report

()

# # Purpose : This file provides an example of a call to the # function mass_prop.gen_report() # # This function will write a set of mass # properties and an entity list to a report file. # # In this example a new database is opened and a # surface is created. It is made into finite # elements and assigned with proper material # properties. Then the function # mass_prop_create() is called to calculate the # mass properties of the geometry and paused for # user to input the file name. Finally this # function is called to write mass properties to # the report file. # Ignore the warnings generated during the # execution of this example. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function mass_prop.gen_report() # has the following arguments: # # mass_prop.gen_report # ( file_columns, # mass_properties, # coordinate_label, # entity_list, # number_of_entities, # entity_list_length, # reject_list, # number_of_rejects, # length_reject ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_file_columns INTEGER i_coordinate_label STRING s_entity_list[128] INTEGER i_number_of_entities INTEGER i_entity_list_length STRING s_reject_list[128] INTEGER i_number_of_rejects INTEGER i_length_reject INTEGER i_return_value REAL rv_mass_properties(VIRTUAL) STRING sv_entity_list[VIRTUAL] INTEGER i_length_entities STRING sv_reject_list[VIRTUAL] INTEGER i_segment_id INTEGER i_aligned_label STRING sv_patch_xy_ids[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_nodes_created[VIRTUAL] STRING sv_elems_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go( "", "new.db" ) $? YES 36000002

Main Index

Chapter 2: Basic Functions 377
Tools Menu

# Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create Geometric and Finite Element entities i_return_value = @ asm_const_patch_xyz @ ( "1", "<10 0 1>", "[0 0 0]", "Coord 0",sv_patch_xy_ids) dump i_return_value i_return_value = mesh_seed_create ( "Surface 1.1 1.3 ", 1, 10, 0., 0., 0. ) dump i_return_value @ @

i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], "Quad4", "1", "1",@ "Coord 0", "Coord 0", i_num_nodes, i_num_elems, @ sv_nodes_created, sv_elems_created ) dump i_return_value #--------------------------------------------------------------------# Create Material and Element properties i_return_value = @ material.create @ ( "Analysis code ID",1,"Analysis type ID", 1, "new_mat", @ 0,"", "Isotropic", 1, "Directionality", 1, "Linearity",@ 1, "Homogeneous", 0, "Linear Elastic", 1, @ "Model Options & IDs", ["", "", "", "", ""], [0, 0, 0, @ 0, 0], "Active Flag", 1, "Create", 10, "External Flag",@ FALSE,"Property IDs",["Elastic Modulus", @ "Poisson Ratio","Density"],[2, 5, 16,0], "Property"// @ " Values", ["10E6","0.33","0.1", ""] ) dump i_return_value i_return_value = @ elementprops_create @ ( "new_prop", 51, 25, 35, 1, 1, 20, [13, 20, 36, 4037, @ 4111, 4118, 4119], [5, 9, 1, 1, 1, 1, 1], ["m:new_mat",@ "", "1", "", "", "", ""], "Surface 1" ) dump i_return_value #--------------------------------------------------------------------# Calculate the mass properties i_return_value = @ mass_prop_create @ ( "2D Plane Stress", "All", "Both", 1, [""], "Coord 0", @ "Use Element Properties", "Unity", "",1, 0, TRUE, TRUE,@ rv_mass_properties, sv_entity_list,i_length_entities, @ i_number_of_entities,sv_reject_list,i_length_reject, @ i_number_of_rejects, i_segment_id, i_aligned_label, @ i_coordinate_label ) dump i_return_value #--------------------------------------------------------------------# Follow the given instruction # # 1. Pick "File" from the menu bar # 2. Select "Report" # 3. Input the name of the report file, # 4. Press "Apply" and "Cancel" # # Pick "Resume" for session file play #

Main Index

378 PCL Reference Manual Examples
Tools Menu

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Write mass properties and entity list to a report file i_file_columns s_entity_list i_entity_list_length s_reject_list = = = = 80 sv_entity_list i_length_entities sv_reject_list @ @ @ @ @ @ @ @ @ @

i_return_value = mass_prop.gen_report ( i_file_columns, rv_mass_properties, i_coordinate_label, s_entity_list, i_number_of_entities, i_entity_list_length, s_reject_list, i_number_of_rejects, i_length_reject ) dump i_return_value

#--------------------------------------------------------------------# Free allocated memory sys_free_array ( rv_mass_properties) sys_free_string( sv_entity_list) sys_free_string( sv_reject_list) sys_free_string( sv_patch_xy_ids) sys_free_string( sv_nodes_created) sys_free_string( sv_elems_created) # It can be observed that a new report file with the user given name # created in the current directory. This file contains the mass # properties and entity details. #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions PCL Reference Manual Examples

3

Geometry Functions
Introduction 380 381

Construct Actions

Disassemble Actions Associate Actions Disassociate Actions Sweep Actions Transform Actions Edit Actions Delete Actions

Main Index

380 PCL Reference Manual Examples
Introduction

Introduction
This chapter provides examples for functions that are used to implement the Geometry form accessed through the switch bar. See Geometry Functions (Ch. 3) in the PCL Reference Manual for a description of these functions.

Main Index

Chapter 3: Geometry Functions 381
Construct Actions

Construct Actions
This section contains examples of some of the functions used to implement the “Construct” or “Create” actions.
asm_const_coord_3point

()

# # Purpose : This file provides an example of a call to the # function asm_const_coord_3point() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create two cylindrical coordinate # frames. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_coord_3point() # has the following arguments: # # asm_const_coord_3point # ( output_labels, # coord_frame, # coordtype, # point1, # point2, # point3, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_labels[8] STRING s_coord_frame[8] INTEGER i_coordtype STRING s_point1[16] STRING s_point2[16] STRING s_point3[16] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating two cylindrical coordinate frames with reference to # coordinate frame "Coord 0". s_output_labels = "1" s_coord_frame = "Coord 0" i_coordtype = 2 s_point1 = "[1 1 0] [1 0 1]" s_point2 = "[0 0 1]" s_point3 = "[1 0 0] [1 1 0]" # i_return_value = @ asm_const_coord_3point @ ( s_output_labels, @ s_coord_frame, @ i_coordtype, @ s_point1, @ s_point2, @

Main Index

382 PCL Reference Manual Examples
Construct Actions

s_point3, sv_created_labels ) dump i_return_value dump sv_created_labels

@

sys_free_string(sv_created_labels) #---------------------------------------------------------------------

asm_const_coord_axis

()

# # Purpose : This file provides an example of a call to the # function asm_const_coord_axis() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create two spherical coordinate # frames. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_coord_axis() # has the following arguments: # # asm_const_coord_axis # ( output_labels, # plane, # coord_frame, # coordtype, # point1, # point2, # point3, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_labels[8] STRING s_plane[8] STRING s_coord_frame[8] INTEGER i_coordtype STRING s_point1[32] STRING s_point2[32] STRING s_point3[32] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating two spherical coordinate frames with reference to # coordinate frames "Coord 0". s_output_labels = "1" s_plane = "YZ" s_coord_frame = "Coord 0" i_coordtype = 3 s_point1 = "[0.75 0.75 0] [0.5 0.5 1]" s_point2 = "[0 1 0] [0 0 1]" s_point3 = "[0 0 1] [0 1 0]" # i_return_value = @ asm_const_coord_axis @ ( s_output_labels, @ s_plane, @

Main Index

Chapter 3: Geometry Functions 383
Construct Actions

s_coord_frame, i_coordtype, s_point1, s_point2, s_point3, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @

sys_free_string(sv_created_labels) #---------------------------------------------------------------------

asm_const_coord_euler

()

# # Purpose : This file provides an example of a call to the # function asm_const_coord_euler() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create two rectangular coordinate # frames. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_coord_euler() # has the following arguments: # # asm_const_coord_euler # ( output_labels, # axis1, # axis2, # axis3, # angle1, # angle2, # angle3, # coord_frame, # coordtype, # point1, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_labels[8] INTEGER i_axis1 INTEGER i_axis2 INTEGER i_axis3 REAL r_angle1 REAL r_angle2 REAL r_angle3 STRING s_coord_frame[16] INTEGER i_coordtype STRING s_point1[32] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating two rectangular coordinate frames with reference to # coordinate frame "Coord 0" s_output_labels = "1" i_axis1 = 3

Main Index

384 PCL Reference Manual Examples
Construct Actions

i_axis2 = 1 i_axis3 = 2 r_angle1 = 30. r_angle2 = 43. r_angle3 = 100. s_coord_frame = "Coord 0" i_coordtype = 1 s_point1 = "[1 1 0] [-0.5 0 -0.5]" # i_return_value = asm_const_coord_euler ( s_output_labels, i_axis1, i_axis2, i_axis3, r_angle1, r_angle2, r_angle3, s_coord_frame, i_coordtype, s_point1, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) #---------------------------------------------------------------------

asm_const_coord_normal

()

# # Purpose : This file provides an example of a call to the # function asm_const_coord_normal() # # This session file will create a new database by # name ’new.db’, a surface will be created. The # above mentioned function will be called and a # rectangular coordinate frame will be created. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_coord_normal() # has the following arguments: # # asm_const_coord_normal # ( output_labels, # surface, # coordtype, # point, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_labels[8] STRING s_surface[16] INTEGER i_coordtype STRING s_point[32] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

Chapter 3: Geometry Functions 385
Construct Actions

#--------------------------------------------------------------------# Creating a rectangular patch in X-Y plane. i_return_value = @ asm_const_patch_xyz( "1", "<3 2 0>","[1 1 0]",@ "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating two rectangular coordinate frames with reference to # coordinate frame "Coord 0". s_output_labels = "1" s_surface = "Surface 1 " i_coordtype = 1 s_point = "[0.5 0.5 0] [1.0 1.0 0]" # i_return_value = @ asm_const_coord_normal @ ( s_output_labels, @ s_surface, @ i_coordtype, @ s_point, @ sv_created_labels ) dump i_return_value dump sv_created_labels sys_free_string(sv_created_labels) #---------------------------------------------------------------------

asm_const_curve_2d_arc2point

()

# # Purpose : This file provides an example of a call to the # function asm_const_curve_2d_arc2point() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create four curves. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_curve_2d_arc2point() # has the following arguments: # # asm_const_curve_2d_arc2point # ( output_ids, # ncurves, # arc_angle, # plane_list, # center_point_list, # start_point_list, # end_point_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_ncurves INTEGER i_arc_angle STRING s_plane_list[32] STRING s_center_point_list[16] STRING s_start_point_list[16] STRING s_end_point_list[16] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #---------------------------------------------------------------------

Main Index

386 PCL Reference Manual Examples
Construct Actions

# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating two curves in X-Y plane each divided in two segments. s_output_ids = "1" i_ncurves = 2 i_arc_angle = 1 s_plane_list = "Coord 0.3 Coord 0.1" s_center_point_list = "[1 1 1] [2 2 2]" s_start_point_list = "[0 0 0]" s_end_point_list = "[3 3 3]" # i_return_value = @ asm_const_curve_2d_arc2point @ ( s_output_ids, @ i_ncurves, @ i_arc_angle, @ s_plane_list, @ s_center_point_list, @ s_start_point_list, @ s_end_point_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_curve_2d_arc3point

()

# # Purpose : This file provides an example of a call to the # function asm_const_curve_2d_arc3point() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create four curves. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_curve_2d_arc3point() # has the following arguments: # # asm_const_curve_2d_arc3point # ( output_ids, # ncurves, # create_center, # plane_list, # start_list, # mid_list, # end_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_ncurves LOGICAL l_create_center STRING s_plane_list[16] STRING s_start_list[16] STRING s_mid_list[16] STRING s_end_list[16] STRING sv_created_ids[VIRTUAL]

Main Index

Chapter 3: Geometry Functions 387
Construct Actions

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) #--------------------------------------------------------------------# Creating two curves in X-Y plane each divided in two segments. s_output_ids = "#" i_ncurves = 2 l_create_center = TRUE s_plane_list = "Coord 0.3" s_start_list = "[1 1 0] [2 2 0]" s_mid_list = "[1 4 1]" s_end_list = "[3 3 0]" # i_return_value = @ asm_const_curve_2d_arc3point @ ( s_output_ids, @ i_ncurves, @ l_create_center, @ s_plane_list, @ s_start_list, @ s_mid_list, @ s_end_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_curve_2d_circle

()

# # Purpose : This file provides an example of a call to the # function asm_const_curve_2d_circle() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create two circles. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_curve_2d_circle() # has the following arguments: # # asm_const_curve_2d_circle # ( output_ids, # ncurves, # radius_method, # radius, # plane_list, # radius_point_list, # center_point_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_ncurves

Main Index

388 PCL Reference Manual Examples
Construct Actions

INTEGER i_radius_method REAL r_radius STRING s_plane_list[32] STRING s_radius_point_list[32] STRING s_center_point_list[32] 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 in two perpendicular planes # and each divided in 10 segments. Circles are drawn using point # location method to define radius. s_output_ids = "#" i_ncurves = 10 i_radius_method = 2 s_plane_list = "Coord 0.3 Coord 0.2" s_radius_point_list = "[0 0 0] [1 1 0]" s_center_point_list = "[5 5 0] [0 0 0]" # i_return_value = @ asm_const_curve_2d_circle @ ( s_output_ids, @ i_ncurves, @ i_radius_method, @ r_radius, @ s_plane_list, @ s_radius_point_list, @ s_center_point_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_curve_arc3point
# # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_curve_arc3point() This session file will create a new database by name ’new.db’ and call the above mentioned function and create two curves in 3D space. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_curve_arc3point() has the following arguments: asm_const_curve_arc3point ( output_ids, ncurves, create_center, start_list, mid_list, end_list,

Main Index

Chapter 3: Geometry Functions 389
Construct Actions

# created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_ncurves LOGICAL l_create_center STRING s_start_list[32] STRING s_mid_list[32] STRING s_end_list[32] 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) #--------------------------------------------------------------------# Creating two curves in 3D space each divided into 4 segments. s_output_ids = "#" i_ncurves = 4 l_create_center = TRUE s_start_list = "[0 0 0] [1 1 0]" s_mid_list = "[-1 -2 0] [1 2 0]" s_end_list = "[-1 1 3] [1 -1 -4]" # i_return_value = @ asm_const_curve_arc3point @ ( s_output_ids, @ i_ncurves, @ l_create_center, @ s_start_list, @ s_mid_list, @ s_end_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_curve_bspline
# # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_curve_bspline() This session file will create a new database by name ’new.db’ and call the above mentioned function and create a bspline closed curve. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_curve_bspline() has the following arguments: asm_const_curve_bspline ( output_ids, ncurves, point_list,

Main Index

390 PCL Reference Manual Examples
Construct Actions

# order, # interpolate, # param_method, # closed, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_ncurves STRING s_point_list[64] INTEGER i_order LOGICAL l_interpolate INTEGER i_param_method LOGICAL l_closed 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) #--------------------------------------------------------------------# Creating a four segment fourth order closed piecewise cubic curve. s_output_ids = "#" i_ncurves = 4 s_point_list = "[0 0 0][1 1 1][-1 .5 1][0 1 1]" i_order = 4 l_interpolate = TRUE i_param_method = 1 l_closed = TRUE # i_return_value = @ asm_const_curve_bspline @ ( s_output_ids, @ i_ncurves, @ s_point_list, @ i_order, @ l_interpolate, @ i_param_method, @ l_closed, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_curve_extract
# # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_curve_extract() This session file will create a new database by name ’new.db’ and create a surface. The above mentioned function will be called to create a curve on the surface. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

Main Index

Chapter 3: Geometry Functions 391
Construct Actions

# # The function asm_const_curve_extract() # has the following arguments: # # asm_const_curve_extract # ( output_ids, # surface_list, # direction, # param_pos, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_surface_list[16] INTEGER i_direction REAL r_param_pos STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# 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) #--------------------------------------------------------------------# Creating a surface. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating a curve on surface along constant U direction. s_output_ids = "#" s_surface_list = "Surface 1" i_direction = 1 r_param_pos = 0.4 # i_return_value = @ asm_const_curve_extract @ ( s_output_ids, @ s_surface_list, @ i_direction, @ r_param_pos, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_crtd_ids) #---------------------------------------------------------------------

asm_const_curve_extract_edge
# # # # # # # # #

()
This file provides an example of a call to the function asm_const_curve_extract_edge() This session file will create a new database by name ’new.db’ and create a surface. The above mentioned function will be called to create curves on the surface edges.

Purpose

:

Main Index

392 PCL Reference Manual Examples
Construct Actions

# This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_curve_extract_edge() # has the following arguments: # # asm_const_curve_extract_edge # ( output_ids, # edge_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_edge_list[16] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# 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) #--------------------------------------------------------------------# Creating a surface. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating curves on two edges of the surface. s_output_ids = "#" s_edge_list = "Surface 1.1 1.3" # i_return_value = @ asm_const_curve_extract_edge @ ( s_output_ids, @ s_edge_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_crtd_ids) #--------------------------------------------------------------------

asm_const_curve_intersect
# # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_curve_intersect() This session file will create a new database by name ’new.db’ and create a surface. The above mentioned function will be called to create a curve on the surface. This file can be run by starting a session of Patran, and running this session file

Main Index

Chapter 3: Geometry Functions 393
Construct Actions

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_curve_intersect() # has the following arguments: # # asm_const_curve_intersect # ( output_ids, # method, # surface1_list, # surface2_list, # ncurves, # fit_tol, # int_tol, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_method STRING s_surface1_list[16] STRING s_surface2_list[16] INTEGER i_ncurves REAL r_fit_tol REAL r_int_tol STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# 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) #--------------------------------------------------------------------# Changing view to Isometric View 1. i_return_value = ga_view_aa_set(23., -34., 0) dump i_return_value #--------------------------------------------------------------------# Creating two surfaces. i_return_value = @ asm_const_patch_xyz( "1", "<2 2 0>","[0 0 0]",@ "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value i_return_value = @ asm_const_patch_xyz( "2","<3 2 -5>","[-1 1 3]",@ "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating a curve where the two surfaces intersect. The curve is # divided in 3 segments. s_output_ids = "#" i_method = 1 s_surface1_list = "Surface 1" s_surface2_list = "Surface 2" i_ncurves = 3 r_fit_tol = 1e-08 r_int_tol = 0.1 # i_return_value = @ asm_const_curve_intersect @ ( s_output_ids, @ i_method, @ s_surface1_list, @ s_surface2_list, @ i_ncurves, @

Main Index

394 PCL Reference Manual Examples
Construct Actions

r_fit_tol, r_int_tol, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_crtd_ids) #---------------------------------------------------------------------

asm_const_curve_involute

()

# # Purpose : This file provides an example of a call to the # function asm_const_curve_involute() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create two involutes. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_curve_involute() # has the following arguments: # # asm_const_curve_involute # ( output_ids, # axis, # option, # scalar1, # scalar2, # ncurves, # coord_frame, # point, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_axis[16] INTEGER i_option REAL r_scalar1 REAL r_scalar2 INTEGER i_ncurves STRING s_coord_frame[16] STRING s_point[16] 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 involutes around Z axis. s_output_ids = "#" s_axis = "Coord 0.3" i_option = 1 r_scalar1 = 1.0 r_scalar2 = 5.3

Main Index

Chapter 3: Geometry Functions 395
Construct Actions

i_ncurves = 4 s_coord_frame = "Coord 0" s_point = "[0 3 0] [0 1 0]" # i_return_value = asm_const_curve_involute ( s_output_ids, s_axis, i_option, r_scalar1, r_scalar2, i_ncurves, s_coord_frame, s_point, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_curve_loft

()

# # Purpose : This file provides an example of a call to the # function asm_const_curve_loft() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create a curve based on end slopes # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_curve_loft() # has the following arguments: # # asm_const_curve_loft # ( output_ids, # ncurves, # slope_control, # point_list, # slope_list1, # slope_list2, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_ncurves LOGICAL l_slope_control STRING s_point_list[64] STRING s_slope_list1[16] STRING s_slope_list2[16] 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) #---------------------------------------------------------------------

Main Index

396 PCL Reference Manual Examples
Construct Actions

# Setting view to Isometric View 2. i_return_value = ga_view_aa_set(23., 56., 0) dump i_return_value #--------------------------------------------------------------------# Creating a curve divided in four segments and passing through four # points. Curve is also constrained by end slopes. s_output_ids = "#" i_ncurves = 4 l_slope_control = TRUE s_point_list = "[0 0 0] [2.5 1 0] [2.3 .6 0] [3 1 1]" s_slope_list1 = "<1 4 0.5>" s_slope_list2 = "<1 -1.5 0>" # i_return_value = @ asm_const_curve_loft @ ( s_output_ids, @ i_ncurves, @ l_slope_control, @ s_point_list, @ s_slope_list1, @ s_slope_list2, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_curve_manifold_2point

()

# # Purpose : This file provides an example of a call to the # function asm_const_curve_manifold_2point() # # This session file will create a new database by # name ’new.db’ and create a surface. The above # mentioned function will create two curves on # the surface. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_curve_manifold_2point() # has the following arguments: # # asm_const_curve_manifold_2point # ( output_ids, # surface_list, # point1_list, # point2_list, # ncurves, # fit_tol, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_surface_list[16] STRING s_point1_list[32] STRING s_point2_list[32] INTEGER i_ncurves REAL r_fit_tol STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_sgm_create_surface_crtd_ids[VIRTUAL]

Main Index

Chapter 3: Geometry Functions 397
Construct Actions

#--------------------------------------------------------------------# 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) #--------------------------------------------------------------------# 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 #--------------------------------------------------------------------# Changing view for proper view of the surface. i_return_value = ga_view_aa_set( -105., 0., -30. ) dump i_return_value #--------------------------------------------------------------------# Making the surface interior clear on the screen. i_return_value = ga_display_lines_set( "general", 5 ) dump i_return_value #--------------------------------------------------------------------# Creating 2 curves on the surface. Number of segments per curve will # be decided by the curve fit tolerance. s_output_ids = "#" s_surface_list = "Surface 1" s_point1_list = "[0 0 0][.5 .5 0]" s_point2_list = "[.75 .35 3] [.1 .9 0]" i_ncurves = 0 r_fit_tol = 1e-05 # i_return_value = @ asm_const_curve_manifold_2point @ ( s_output_ids, @ s_surface_list, @ s_point1_list, @ s_point2_list, @ i_ncurves, @ r_fit_tol, @ 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) #---------------------------------------------------------------------

asm_const_curve_manifold_npoint
# # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_curve_manifold_npoint() This session file will create a new database by name ’new.db’ and create a surface. The above mentioned function will create a curve on the surface. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_curve_manifold_npoint()

Main Index

398 PCL Reference Manual Examples
Construct Actions

# has the following arguments: # # asm_const_curve_manifold_npoint # ( output_ids, # surface, # point_list, # ncurves, # fit_tol, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_surface[16] STRING s_point_list[64] INTEGER i_ncurves REAL r_fit_tol STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_sgm_create_surface_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# 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) #--------------------------------------------------------------------# 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 #--------------------------------------------------------------------# Changing view for proper view of the surface. i_return_value = ga_view_aa_set( -105., 0., -30. ) dump i_return_value #--------------------------------------------------------------------# Making the surface interior clear on the screen. i_return_value = ga_display_lines_set( "general", 5 ) dump i_return_value #--------------------------------------------------------------------# Creating 1 curve on the surface. Number of segments for curve will # be decided by the curve fit tolerance. s_output_ids = "#" s_surface = "Surface 1" s_point_list = "[0 0 0] [.75 .35 3] [.5 .5 0] [.1 .9 0]" i_ncurves = 0 r_fit_tol = 1e-05 # i_return_value = @ asm_const_curve_manifold_npoint @ ( s_output_ids, @ s_surface, @ s_point_list, @ i_ncurves, @ r_fit_tol, @ 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) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 399
Construct Actions

asm_const_curve_project

()

# # Purpose : This file provides an example of a call to the # function asm_const_curve_project() # # This session file will create a new database by # name ’new.db’ and create a surface and a curve. # The above mentioned function will project the # curve on the surface and create a curve. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_curve_project() # has the following arguments: # # asm_const_curve_project # ( output_ids, # curve_list, # surface_list, # delete_org, # method, # vector, # coord_frame, # ncurves, # prjtol, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_curve_list[16] STRING s_surface_list[16] LOGICAL l_delete_org INTEGER i_method STRING s_vector[16] STRING s_coord_frame[16] INTEGER i_ncurves 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, @

Main Index

400 PCL Reference Manual Examples
Construct Actions

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( 140., -5., -70. ) dump i_return_value #--------------------------------------------------------------------# Making the surface interior clear on the screen. i_return_value = ga_display_lines_set( "general", 5 ) dump i_return_value #--------------------------------------------------------------------# Creating a projected curve on the surface without deleting the old. # The number of the segments will depend on the projection tolerance. s_output_ids = "#" s_curve_list = "Curve 1" s_surface_list = "Surface 1" l_delete_org = FALSE i_method = 3 s_vector = "<0 1 0>" s_coord_frame = "Coord 0" i_ncurves = 0 r_prjtol = 1e-05 # i_return_value = @ asm_const_curve_project @ ( s_output_ids, @ s_curve_list, @ s_surface_list, @ l_delete_org, @ i_method, @ s_vector, @ s_coord_frame, @ i_ncurves, @ 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) #---------------------------------------------------------------------

asm_const_curve_revolve
# # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_curve_revolve() This session file will create a new database by name ’new.db’ and call the above mentioned function and create three curves. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_curve_revolve() has the following arguments: asm_const_curve_revolve ( output_ids, axis, angle, offset,

Main Index

Chapter 3: Geometry Functions 401
Construct Actions

# coord_frame, # ncurves, # point, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_axis[16] REAL r_angle REAL r_offset STRING s_coord_frame[16] INTEGER i_ncurves STRING s_point[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# 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 three curves by revolving points around Z axis. Each curve # will divided in five segments. s_output_ids = "#" s_axis = "Coord 0.3" r_angle = 120 r_offset = 10.0 s_coord_frame = "Coord 0" i_ncurves = 5 s_point = "[0 1 0] [0 2 2] [0 3 3]" # i_return_value = @ asm_const_curve_revolve @ ( s_output_ids, @ s_axis, @ r_angle, @ r_offset, @ s_coord_frame, @ i_ncurves, @ s_point, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_grid_arccenter
# # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_grid_arccenter() This session file will create a new database by name ’new.db’ and create a curve. The above mentioned function will be called to create a point at the centre of the curve. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

Main Index

402 PCL Reference Manual Examples
Construct Actions

# The function asm_const_grid_arccenter() # has the following arguments: # # asm_const_grid_arccenter # ( output_ids, # curve_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_curve_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_line_3point_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 label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating a curve using three point option. i_return_value = @ asm_const_line_3point( "2", @ "[ -0.220241 0.077918 0.215462 ] ", @ "[ 0.099881 0.344888 -0.137155 ] ", @ "[ 0.836730 -0.053878 -0.429993 ] ",1, 0.5,@ sv_asm_line_3point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Calling function to create point at the centre of the above line. s_output_ids = "" s_curve_list = "Curve 2 " # i_return_value = @ asm_const_grid_arccenter @ ( s_output_ids, @ s_curve_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_line_3point_created_ids) #---------------------------------------------------------------------

asm_const_grid_extract
# # # # # # # # # # # # # # #

()
: This file provides an example of a call to the function asm_const_grid_extract() This session file will create a new database by name ’new.db’ and create curves. Then the above mentioned function will be called and points will be created. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

Purpose

The function asm_const_grid_extract()

Main Index

Chapter 3: Geometry Functions 403
Construct Actions

# has the following arguments: # # asm_const_grid_extract # ( output_ids, # curve_list, # param_pos, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_curve_list[32] REAL r_param_pos STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_line_3point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Enabling the curve and point label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating curves from three points. i_return_value = @ asm_const_line_3point( "1", @ "[ 0.22 0.07 0.21 ] ", @ "[ 0.09 0.34 0.13 ] [ 0 -0.5 0.1 ]", @ "[ 0.83 -0.05 -0.43 ] [ -0.5 0.25 0 ]", 1, @ 0.5, sv_asm_line_3point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Creating grid point on the curves. s_output_ids = "#" s_curve_list = "Curve 1 2" r_param_pos = 0.6 i_return_value = asm_const_grid_extract ( s_output_ids, s_curve_list, r_param_pos, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_line_3point_created_ids) #---------------------------------------------------------------------

asm_const_grid_extract_v1
# # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_grid_extract_v1() This session file will create a new database by name ’new.db’ and create curves. Then the above mentioned function will be called and points will be created. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

Main Index

404 PCL Reference Manual Examples
Construct Actions

# # The function asm_const_grid_extract_v1() # has the following arguments: # # asm_const_grid_extract_v1 # ( output_ids, # curve_list, # parametric_pos, # param_method, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_curve_list[32] REAL r_parametric_pos INTEGER i_param_method STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_line_3point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Enabling the curve and point label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating curves from three points. i_return_value = @ asm_const_line_3point( "1", @ "[ 0.22 0.07 0.21 ] ", @ "[ 0.09 0.34 0.13 ] [ 0 -0.5 0.1 ]", @ "[ 0.83 -0.05 -0.43 ] [ -0.5 0.25 0 ]", 1, @ 0.5, sv_asm_line_3point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Creating grid point on the curves based on arc lengths. s_output_ids = "#" s_curve_list = "Curve 1 2" r_parametric_pos = 0.6 i_param_method = 1 i_return_value = asm_const_grid_extract_v1 ( s_output_ids, s_curve_list, r_parametric_pos, i_param_method, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_line_3point_created_ids) #---------------------------------------------------------------------

asm_const_grid_interp_curve
# # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_grid_interp_curve() This session file will create a new database by name ’new.db’ and create curves. Then the

Main Index

Chapter 3: Geometry Functions 405
Construct Actions

# above mentioned function will be called and # points will be created. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_grid_interp_curve() # has the following arguments: # # asm_const_grid_interp_curve # ( output_ids, # curve_list, # space_ratio, # num_points, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_curve_list[32] REAL r_space_ratio INTEGER i_num_points STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_line_3point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Enabling the curve and point label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating curves from three points. i_return_value = @ asm_const_line_3point( "1", @ "[ 0.22 0.07 0.21 ] ", @ "[ 0.09 0.34 0.13 ] [ 0 -0.5 0.1 ]", @ "[ 0.83 -0.05 -0.43 ] [ -0.5 0.25 0 ]", 1, @ 0.5, sv_asm_line_3point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Creating points from the curves s_output_ids = "#" s_curve_list = "Curve 1 2" r_space_ratio = 1.5 i_num_points = 4 i_return_value = asm_const_grid_interp_curve ( s_output_ids, s_curve_list, r_space_ratio, i_num_points, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_line_3point_created_ids) #---------------------------------------------------------------------

Main Index

406 PCL Reference Manual Examples
Construct Actions

asm_const_grid_interp_curve_v1

()

# # Purpose : This file provides an example of a call to the # function asm_const_grid_interp_curve_v1() # # This session file will create a new database by # name ’new.db’ and create curves. Then the # above mentioned function will be called and # points will be created. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_grid_interp_curve_v1() # has the following arguments: # # asm_const_grid_interp_curve_v1 # ( output_ids, # curve_list, # space_ratio, # num_points, # param_method, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_curve_list[32] REAL r_space_ratio INTEGER i_num_points INTEGER i_param_method STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_line_3point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Enabling the curve and point label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating curves from three points. i_return_value = @ asm_const_line_3point( "1", @ "[ 0.22 0.07 0.21 ] ", @ "[ 0.09 0.34 0.13 ] [ 0 -0.5 0.1 ]", @ "[ 0.83 -0.05 -0.43 ] [ -0.5 0.25 0 ]", 1, @ 0.5, sv_asm_line_3point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Creating points from the curves based on the parametric values. s_output_ids = "#" s_curve_list = "Curve 1 2" r_space_ratio = 1.5 i_num_points = 4 i_param_method = 2 i_return_value = asm_const_grid_interp_curve_v1 ( s_output_ids, s_curve_list, @ @ @ @

Main Index

Chapter 3: Geometry Functions 407
Construct Actions

r_space_ratio, i_num_points, i_param_method, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_line_3point_created_ids) #---------------------------------------------------------------------

asm_const_grid_interp_point

()

# # Purpose : This file provides an example of a call to the # function asm_const_grid_interp_point() # # This session file will create a new database by # name ’new.db’ and the above mentioned function # will be called and points will be created. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_grid_interp_point() # has the following arguments: # # asm_const_grid_interp_point # ( output_ids, # point1_list, # point2_list, # space_ratio, # num_points, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_point1_list[32] STRING s_point2_list[32] REAL r_space_ratio INTEGER i_num_points 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 label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Points will be created between two points and origin. s_output_ids = "#" s_point1_list = "[0 0 0]" s_point2_list = "[1 0 0] [1 1 0]" r_space_ratio = 1.33 i_num_points = 4 # i_return_value = @ asm_const_grid_interp_point @ ( s_output_ids, @ s_point1_list, @

Main Index

408 PCL Reference Manual Examples
Construct Actions

s_point2_list, r_space_ratio, i_num_points, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @

sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_grid_intersect

()

# # Purpose : This file provides an example of a call to the # function asm_const_grid_intersect() # # This session file will create a new database by # name ’new.db’ and create two curves. Then the # above mentioned function will be called and # points will be created. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_grid_intersect() # has the following arguments: # # asm_const_grid_intersect # ( output_ids, # curve1_list, # curve2_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_curve1_list[32] STRING s_curve2_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_line_3point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Enabling the curve and point label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating two curves based on three points. i_return_value = @ asm_const_line_3point( "1","[0 0 0][0 0.5 0]",@ "[1 1 0][0.5 .1 0]","[1 -1 0][2 1 0][1 2 0]@ ", 1, 0.5, sv_asm_line_3point_created_ids) dump i_return_value #--------------------------------------------------------------------# Creating point at the intersection of the two curves. s_output_ids = "#" s_curve1_list = "Curve 1" s_curve2_list = "Curve 2 3" # i_return_value = @ asm_const_grid_intersect @ ( s_output_ids, @

Main Index

Chapter 3: Geometry Functions 409
Construct Actions

s_curve1_list, s_curve2_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_line_3point_created_ids) #---------------------------------------------------------------------

asm_const_grid_offset

()

# # Purpose : This file provides an example of a call to the # function asm_const_grid_offset() # # This session file will create a new database by # name ’new.db’ and create a point and a curve # passing through it. Then the above mentioned # function will be called and points will be # created. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_grid_offset() # has the following arguments: # # asm_const_grid_offset # ( output_ids, # distance, # point_list, # curvepoint_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] REAL r_distance STRING s_point_list[32] STRING s_curvepoint_list[128] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_line_3point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Enabling the curve and point label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating a point by giving coordinates. i_return_value = @ asm_const_grid_xyz("1", @ "[ 0.099881 0.344888 -0.137155 ] ", @ "Coord 0", sv_created_ids) dump i_return_value #--------------------------------------------------------------------# Creating a curve from three points. i_return_value = @ asm_const_line_3point( "1", @ "[ -0.220241 0.077918 0.215462 ] ", @ " point 1 ", @

Main Index

410 PCL Reference Manual Examples
Construct Actions

"[ 0.836730 -0.053878 -0.429993 ] ", 1, @ 0.5, sv_asm_line_3point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Creating a point at a distance from the point created before. s_output_ids = r_distance = s_point_list = s_curvepoint_list = "Geometry (point "#" 0.33 "point 1" "Construct PointCurveUOnCurve (Evaluate "// 2)) (Evaluate Geometry (Curve 1 ))" @ @ @ @ @ @

@

i_return_value = asm_const_grid_offset ( s_output_ids, r_distance, s_point_list, s_curvepoint_list, sv_created_ids ) dump i_return_value dump sv_created_ids

sys_free_string(sv_created_ids) sys_free_string(sv_asm_line_3point_created_ids) #---------------------------------------------------------------------

asm_const_grid_pierce

()

# # Purpose : This file provides an example of a call to the # function asm_const_grid_pierce() # # This session file will create a new database by # name ’new.db’. A surface and a curve # intersecting the surface will be created. The # above mentioned function will be called to # create a point at the intersection of the curve # and surface. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_grid_pierce() # has the following arguments: # # asm_const_grid_pierce # ( output_ids, # curve_list, # surface_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_curve_list[32] STRING s_surface_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_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 #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 411
Construct Actions

# Enabling the curve and point label. curve_label(TRUE) point_label(TRUE) surface_label(TRUE) #--------------------------------------------------------------------# Changing view to Isometric-1. i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value #--------------------------------------------------------------------# Creating a surface. i_return_value = @ asm_const_patch_xyz( "1", "<2 0 1>", @ "[0 0.5 -0.5]", "Coord 0", @ sv_asm_create_patch_xy_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating a line by giving 3 points. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[1 1 0]", "[1 -1 0]", 1, 0.5, @ sv_asm_line_3point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Creating point at the intersection of line and plane. s_output_ids = "#" s_curve_list = "Curve 1" s_surface_list = "Surface 1" # i_return_value = @ asm_const_grid_pierce @ ( s_output_ids, @ s_curve_list, @ s_surface_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_crtd_ids) sys_free_string(sv_asm_line_3point_created_ids) #---------------------------------------------------------------------

asm_const_grid_xyz
# # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_grid_xyz() This session file will create a new database by name ’new.db’ and call the above mentioned function and create points. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_grid_xyz() has the following arguments: asm_const_grid_xyz ( output_ids, coordinates_list, coord_frame, created_ids )

Main Index

412 PCL Reference Manual Examples
Construct Actions

#--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_coordinates_list[32] STRING s_coord_frame[32] 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 label. point_label(TRUE) #--------------------------------------------------------------------# Calling function to create points from coordinates. s_output_ids = "#" s_coordinates_list = "[0 0 0] [1 1 1]" s_coord_frame = "Coord 0" # i_return_value = @ asm_const_grid_xyz @ ( s_output_ids, @ s_coordinates_list, @ s_coord_frame, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_hpat_2surface

()

# # Purpose : This file provides an example of a call to the # function asm_const_hpat_2surface() # # This session file will create a new database by # name ’new.db’ and four surfaces and a solid, as # a manifold, will be created. The four surfaces # in a group of two will be used to create solids # using above mentioned function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_hpat_2surface() # has the following arguments: # # asm_const_hpat_2surface # ( output_ids, # surface1_list, # surface2_list, # manifold_type, # manifold_id, # auto_align, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_surface1_list[32] STRING s_surface2_list[32]

Main Index

Chapter 3: Geometry Functions 413
Construct Actions

INTEGER i_manifold_type STRING s_manifold_id[32] LOGICAL l_auto_align STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_created[VIRTUAL] #--------------------------------------------------------------------# 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 i_return_value = @ ga_group_display_set("default_group","general") dump i_return_value i_return_value = ga_display_lines_set( "general", 2 ) dump i_return_value @

solid_label(TRUE) surface_label(TRUE) #--------------------------------------------------------------------# Creating two surfaces. i_return_value = @ asm_const_patch_xyz( "#", "<1 0 1>", @ "[0 0 0] [3 0.1 0]", "Coord 0", @ sv_asm_create_patch_xy_created ) dump i_return_value i_return_value = @ asm_const_patch_xyz( "#", "<0.5 0 0.5>", @ "[0.25 1 0.25] [3.25 0.9 0.25]", "Coord 0",@ sv_asm_create_patch_xy_created ) dump i_return_value #--------------------------------------------------------------------# Creating manifold solid. i_return_value = @ asm_const_hpat_xyz("1", "<4 0.8 3>", @ "[0 0.1 0]", "Coord 0", sv_created_ids) dump i_return_value #--------------------------------------------------------------------# Create solids from the surfaces created and using the solid as # manifold entity. s_output_ids = "#" s_surface1_list = "surface 1 2" s_surface2_list = "surface 3 4" i_manifold_type = 3 s_manifold_id = "solid 1" l_auto_align = TRUE # i_return_value = @ asm_const_hpat_2surface @ ( s_output_ids, @ s_surface1_list, @ s_surface2_list, @ i_manifold_type, @ s_manifold_id, @ l_auto_align, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created)

Main Index

414 PCL Reference Manual Examples
Construct Actions

#---------------------------------------------------------------------

asm_const_hpat_3surface

()

# # Purpose : This file provides an example of a call to the # function asm_const_hpat_3surface() # # This session file will create a new database by # name ’new.db’ and six surfaces will be created. # The six surfaces in a group of two will be used # to create solids using above mentioned function # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_hpat_3surface() # has the following arguments: # # asm_const_hpat_3surface # ( output_ids, # surface1_list, # surface2_list, # surface3_list, # param_pos, # auto_align, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_surface1_list[32] STRING s_surface2_list[32] STRING s_surface3_list[32] REAL r_param_pos LOGICAL l_auto_align STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_created[VIRTUAL] #--------------------------------------------------------------------# 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 i_return_value = @ ga_group_display_set("default_group","general") dump i_return_value i_return_value = ga_display_lines_set( "general", 2 ) dump i_return_value solid_label(TRUE) surface_label(TRUE) #--------------------------------------------------------------------# Creating six surfaces. i_return_value = @ asm_const_patch_xyz( "#", "<1 0 1>", @ "[0 0 0] [3 0 0]", "Coord 0", @ @

Main Index

Chapter 3: Geometry Functions 415
Construct Actions

sv_asm_create_patch_xy_created ) dump i_return_value i_return_value = asm_const_patch_xyz( "#", "<0.5 0 0.5>", "[-0.25 1 0.25] [2 1 -0.5]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value i_return_value = asm_const_patch_xyz( "#", "<0.5 0 0.5>", "[0.25 2 0.25] [1.5 2 1]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value @ @ @

@ @ @

#--------------------------------------------------------------------# Creating solids using two groups of three surfaces. s_output_ids = "#" s_surface1_list = "surface 1 2" s_surface2_list = "surface 3 4" s_surface3_list = "surface 5 6" r_param_pos = 0.7 l_auto_align = FALSE # i_return_value = @ asm_const_hpat_3surface @ ( s_output_ids, @ s_surface1_list, @ s_surface2_list, @ s_surface3_list, @ r_param_pos, @ l_auto_align, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_hpat_4surface
# # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_hpat_4surface() This session file will create a new database by name ’new.db’ and eight surfaces will be created. The eight surfaces in a group of two will be used to create solids using above mentioned function This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_hpat_4surface() has the following arguments: asm_const_hpat_4surface ( output_ids, surface1_list, surface2_list, surface3_list, surface4_list,

Main Index

416 PCL Reference Manual Examples
Construct Actions

# param_pos1, # param_pos2, # auto_align, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_surface1_list[32] STRING s_surface2_list[32] STRING s_surface3_list[32] STRING s_surface4_list[32] REAL r_param_pos1 REAL r_param_pos2 LOGICAL l_auto_align STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_created[VIRTUAL] #--------------------------------------------------------------------# 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 i_return_value = @ ga_group_display_set("default_group","general") dump i_return_value i_return_value = ga_display_lines_set( "general", 2 ) dump i_return_value @

solid_label(TRUE) surface_label(TRUE) #--------------------------------------------------------------------# Creating surfaces. i_return_value = @ asm_const_patch_xyz( "#", "<1 0 1>", @ "[0 0 0] [1 0 0]", "Coord 0", @ sv_asm_create_patch_xy_created ) dump i_return_value i_return_value = asm_const_patch_xyz( "#", "<0.5 0 0.5>", "[-0.25 1 0.25] [1 1 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value @ @ @

i_return_value = @ asm_const_patch_xyz( "#", "<0.5 0 0.5>", @ "[0.25 2 0.25] [1.33 2 -0.33]", "Coord 0", @ sv_asm_create_patch_xy_created ) dump i_return_value i_return_value = asm_const_patch_xyz( "#", "<1 0 1>", "[0.5 3 0.5] [1.75 3.1 1]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Creating solids by using two groups of four surfaces. s_output_ids = "#" s_surface1_list = "surface 1 2" s_surface2_list = "surface 3 4"

Main Index

Chapter 3: Geometry Functions 417
Construct Actions

s_surface3_list = "surface 5 6" s_surface4_list = "surface 7 8" r_param_pos1 = 0.33 r_param_pos2 = 0.66 l_auto_align = TRUE # i_return_value = asm_const_hpat_4surface ( s_output_ids, s_surface1_list, s_surface2_list, s_surface3_list, s_surface4_list, r_param_pos1, r_param_pos2, l_auto_align, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @ @ @ @

sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_hpat_face

()

# # Purpose : This file provides an example of a call to the # function asm_const_hpat_face() # # This session file will create a new database by # name ’new.db’ and six surfaces will be created. # The six surfaces will be used to create a solid # using above mentioned function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_hpat_face() # has the following arguments: # # asm_const_hpat_face # ( output_ids, # surface1_list, # surface2_list, # surface3_list, # surface4_list, # surface5_list, # surface6_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_surface1_list[32] STRING s_surface2_list[32] STRING s_surface3_list[32] STRING s_surface4_list[32] STRING s_surface5_list[32] STRING s_surface6_list[128] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_asm_line_2point_created_ids[VIRTUAL]

Main Index

418 PCL Reference Manual Examples
Construct Actions

STRING sv_sgm_surface_4edge_created[VIRTUAL] #--------------------------------------------------------------------# 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 #--------------------------------------------------------------------# Creating three surfaces. i_return_value = @ asm_const_patch_xyz("", @ "<2 0 1><0 1 1><1 0 1>", @ "[0 0 0][0 0 0][0 1 0]","coord 0", @ sv_asm_create_patch_xy_created ) dump i_return_value # Creating two curves. i_return_value = asm_const_line_2point( "#", "Point 8 7", "Point 3 2", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value # Creating three surfaces. i_return_value = sgm_const_surface_4edge( "", "Surface 3.1 Surface 3.3 Surface 3.2 ", "Surface 2.4 Surface 2.2 Curve 1 ", "Surface 1.1 Surface 1.3 Surface 1.2 ", "Curve 2 Curve 1 Curve 2 ", sv_sgm_surface_4edge_created ) dump i_return_value @ @ @

@ @ @ @ @ @

solid_label(TRUE) surface_label(TRUE) #--------------------------------------------------------------------# Creating a Solid with the created six surfaces. s_output_ids = "#" s_surface1_list = "surface 1" s_surface2_list = "surface 2" s_surface3_list = "surface 3" s_surface4_list = "surface 4" s_surface5_list = "surface 5" s_surface6_list = "surface 6" # i_return_value = @ asm_const_hpat_face @ ( s_output_ids, @ s_surface1_list, @ s_surface2_list, @ s_surface3_list, @ s_surface4_list, @ s_surface5_list, @ s_surface6_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_asm_line_2point_created_ids) sys_free_string(sv_sgm_surface_4edge_created) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 419
Construct Actions

asm_const_hpat_vertex

()

# # Purpose : This file provides an example of a call to the # function asm_const_hpat_vertex() # # This session file will create a new database by # name ’new.db’. The above mentioned function # will be used to create a solid from eight point # coordinates. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_hpat_vertex() # has the following arguments: # # asm_const_hpat_vertex # ( output_ids, # point1_list, # point2_list, # point3_list, # point4_list, # point5_list, # point6_list, # point7_list, # point8_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_point1_list[32] STRING s_point2_list[32] STRING s_point3_list[32] STRING s_point4_list[32] STRING s_point5_list[32] STRING s_point6_list[32] STRING s_point7_list[32] STRING s_point8_list[32] STRING sv_created_ids[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 i_return_value = @ ga_group_display_set("default_group","general") dump i_return_value i_return_value = ga_display_lines_set( "general", 2 ) dump i_return_value @

solid_label(TRUE) #--------------------------------------------------------------------# Creating a solid by giving the vertex locations. s_output_ids = "#" s_point1_list = "[0 0 0]"

Main Index

420 PCL Reference Manual Examples
Construct Actions

s_point2_list = "[1 0.1 -0.25]" s_point3_list = "[1.1 0.15 1.25]" s_point4_list = "[0.2 0.05 0.95]" s_point5_list = "[0.25 1.5 0.25]" s_point6_list = "[1.25 1.5 0]" s_point7_list = "[1.35 1 1.6]" s_point8_list = "[0.55 1 1.3]" # i_return_value = asm_const_hpat_vertex ( s_output_ids, s_point1_list, s_point2_list, s_point3_list, s_point4_list, s_point5_list, s_point6_list, s_point7_list, s_point8_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_hpat_xyz

()

# # Purpose : This file provides an example of a call to the # function asm_const_hpat_xyz() # # This session file will create a new database by # name ’new.db’. The above mentioned function # will be used to create a solid by giving solid # origin and orientation. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_hpat_xyz() # has the following arguments: # # asm_const_hpat_xyz # ( output_ids, # solid_length, # solid_origin, # coord_frame, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_solid_length[16] STRING s_solid_origin[16] STRING s_coord_frame[16] STRING sv_created_ids[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)

Main Index

Chapter 3: Geometry Functions 421
Construct Actions

dump i_return_value i_return_value = @ ga_group_display_set("default_group","general") dump i_return_value i_return_value = ga_display_lines_set( "general", 2 ) dump i_return_value @

solid_label(TRUE) #--------------------------------------------------------------------# Creating a solid. s_output_ids = "#" s_solid_length = "<1.1 2.2 3.3>" s_solid_origin = "[0.1 0.2 0.3]" s_coord_frame = "Coord 0" # i_return_value = @ asm_const_hpat_xyz @ ( s_output_ids, @ s_solid_length, @ s_solid_origin, @ s_coord_frame, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_line_2point

()

# # Purpose : This file provides an example of a call to the # function asm_const_line_2point() # # This session file will create a new database by # name ’new.db’ and create a surface. This # surface will be used as manifold entity for # creating lines using the above mentioned # function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_2point() # has the following arguments: # # asm_const_line_2point # ( output_ids, # point1_list, # point2_list, # i_manifold_type, # manifold_id, # num_interp, # num_lines, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_point1_list[32] STRING s_point2_list[32]

Main Index

422 PCL Reference Manual Examples
Construct Actions

INTEGER i_manifold_type STRING s_manifold_id[32] INTEGER i_num_interp INTEGER i_num_lines STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set(-67., 0., -34.) dump i_return_value surface_label(TRUE) curve_label(TRUE) #--------------------------------------------------------------------# Creating a surface to be used as manifold entity. i_return_value = @ asm_const_patch_xyz( "1","<1 0.5 0>","[0 0 0]"@ , "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating two lines. s_output_ids = "#" s_point1_list = "[-0.25 -0.25 0.5][0.25 0.25 0.5]" s_point2_list = "[1.25 0.25 0.5][0.75 0.25 0.5]" i_manifold_type = 2 s_manifold_id = "surface 1" i_num_interp = 6 i_num_lines = 6 # i_return_value = @ asm_const_line_2point @ ( s_output_ids, @ s_point1_list, @ s_point2_list, @ i_manifold_type, @ s_manifold_id, @ i_num_interp, @ i_num_lines, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_crtd_ids) #---------------------------------------------------------------------

asm_const_line_3point
# # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_line_3point() This session file will create a new database by name ’new.db’. The above mentioned function will be called to create two lines. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_line_3point()

Main Index

Chapter 3: Geometry Functions 423
Construct Actions

# has the following arguments: # # asm_const_line_3point # ( output_ids, # point1_list, # point2_list, # point3_list, # param_method, # param_pos, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_point1_list[32] STRING s_point2_list[32] STRING s_point3_list[32] INTEGER i_param_method REAL r_param_pos STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------curve_label(TRUE) #--------------------------------------------------------------------# Creating two lines by giving parametric position of midpoint. s_output_ids = "#" s_point1_list = "[-0.25 -0.25 0.5][0.25 0.25 0.5]" s_point2_list = "[1 0.25 0.5][0.75 0.5 0.5]" s_point3_list = "[1.25 0.25 0.5][0.75 0.25 0.5]" i_param_method = 1 r_param_pos = 0.6 # i_return_value = @ asm_const_line_3point @ ( s_output_ids, @ s_point1_list, @ s_point2_list, @ s_point3_list, @ i_param_method, @ r_param_pos, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_line_4point
# # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_line_4point() This session file will create a new database by name ’new.db’ and above mentioned function will be called by giving coordinates as input. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_line_4point()

Main Index

424 PCL Reference Manual Examples
Construct Actions

# has the following arguments: # # asm_const_line_4point # ( output_ids, # point1_list, # point2_list, # point3_list, # point4_list, # param_method, # param_pos1, # param_pos2, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_point1_list[32] STRING s_point2_list[32] STRING s_point3_list[32] STRING s_point4_list[32] INTEGER i_param_method REAL r_param_pos1 REAL r_param_pos2 STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------curve_label(TRUE) #--------------------------------------------------------------------# Creating two lines by giving parametric position of two internal # points. s_output_ids = "#" s_point1_list = "[-0.25 -0.25 0.5][0.25 0.25 0.5]" s_point2_list = "[1 0.25 0.5][0.75 0.5 0.5]" s_point3_list = "[1.25 0.25 0.5][0.75 0.25 0.5]" s_point4_list = "[0.6 0 0.3]" i_param_method = 1 r_param_pos1 = 0.3 r_param_pos2 = 0.8 # i_return_value = @ asm_const_line_4point @ ( s_output_ids, @ s_point1_list, @ s_point2_list, @ s_point3_list, @ s_point4_list, @ i_param_method, @ r_param_pos1, @ r_param_pos2, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 425
Construct Actions

asm_const_line_arc3point

()

# # Purpose : This file provides an example of a call to the # function asm_const_line_arc3point() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function to create two curves. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_arc3point() # has the following arguments: # # asm_const_line_arc3point # ( output_ids, # num_lparc, # point1_list, # point2_list, # point3_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] INTEGER i_num_lparc STRING s_point1_list[32] STRING s_point2_list[32] STRING s_point3_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------curve_label(TRUE) #--------------------------------------------------------------------# Creating two arcs with 5 lines per arc. s_output_ids = "#" i_num_lparc = 5 s_point1_list = "[-0.25 -0.25 0.5][0.25 0.25 0.5]" s_point2_list = "[1 0.25 0.5][0.75 0.5 0.5]" s_point3_list = "[1.25 0.25 0.5][0.75 0.25 0.5]" # i_return_value = @ asm_const_line_arc3point @ ( s_output_ids, @ i_num_lparc, @ s_point1_list, @ s_point2_list, @ s_point3_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

Main Index

426 PCL Reference Manual Examples
Construct Actions

asm_const_line_conic

()

# # Purpose : This file provides an example of a call to the # function asm_const_line_conic() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create an elliptic arc. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_conic() # has the following arguments: # # asm_const_line_conic # ( output_ids, # coord_frame, # rho, # point1_list, # point2_list, # point3_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_coord_frame[32] REAL r_rho STRING s_point1_list[32] STRING s_point2_list[32] STRING s_point3_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------curve_label(TRUE) #--------------------------------------------------------------------# Creating an elliptic arc. s_output_ids = "#" s_coord_frame = "Coord 0" r_rho = 0.4 s_point1_list = "[0 10 0]" s_point2_list = "[-1 .1 0]" s_point3_list = "[2 -.1 0]" # i_return_value = @ asm_const_line_conic @ ( s_output_ids, @ s_coord_frame, @ r_rho, @ s_point1_list, @ s_point2_list, @ s_point3_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 427
Construct Actions

asm_const_line_extract

()

# # Purpose : This file provides an example of a call to the # function asm_const_line_extract() # # This session file will create a new database by # name ’new.db’ and two surfaces will be created. # The above mentioned function will be called to # extract the lines. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_extract() # has the following arguments: # # asm_const_line_extract # ( output_ids, # surface_list, # line_direction, # param_pos, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_surface_list[32] INTEGER i_line_direction REAL r_param_pos STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------surface_label(TRUE) curve_label(TRUE) #--------------------------------------------------------------------# Creating two surfaces. i_return_value = @ asm_const_patch_xyz( "#", "<0.5 0.5 0>", @ "[0.25 1 0.25] [1.25 0.9 0.25]", "Coord 0",@ sv_asm_create_patch_xy_created ) dump i_return_value #--------------------------------------------------------------------# Extracting lines from the two surfaces. s_output_ids = "#" s_surface_list = "surface 1 2" i_line_direction = 1 r_param_pos = 0.45 # i_return_value = @ asm_const_line_extract @ ( s_output_ids, @ s_surface_list, @ i_line_direction, @ r_param_pos, @ sv_created_ids ) dump i_return_value dump sv_created_ids

Main Index

428 PCL Reference Manual Examples
Construct Actions

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 429
Construct Actions

asm_const_line_fillet

()

# # Purpose : This file provides an example of a call to the # function asm_const_line_fillet() # # This session file will create a new database by # name ’new.db’ and create two intersecting # curves. The above mentioned function will be # called to create curves by filleting. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_fillet() # has the following arguments: # # asm_const_line_fillet # ( output_ids, # num_fillet, # radius, # fil_tolerance, # trim_original, # point1_list, # point2_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] INTEGER i_num_fillet REAL r_radius REAL r_fil_tolerance LOGICAL l_trim_original STRING s_point1_list[128] STRING s_point2_list[128] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_line_2point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating two intersecting curves. i_return_value = @ asm_const_line_2point( "1", "[0 0 0]", @ "[1 0 0][0 1 0]", 0, "", 50., 1, @ sv_asm_line_2point_created_ids ) dump i_return_value curve_label(TRUE) #--------------------------------------------------------------------# Creating curves by filleting the two intersecting lines created # before. s_output_ids = "#" i_num_fillet = 5 r_radius = 0.1 r_fil_tolerance = 0.005 l_trim_original = TRUE s_point1_list = "Construct PointCurveUOnCurve"//@ "(Evaluate Geometry (Point 1 )) (Evaluate Geometry (Curve 1 ))" s_point2_list = "Construct PointCurveUOnCurve"//@ "(Evaluate Geometry (Point 1 )) (Evaluate Geometry (Curve 2 ))"

Main Index

430 PCL Reference Manual Examples
Construct Actions

# i_return_value = asm_const_line_fillet ( s_output_ids, i_num_fillet, r_radius, r_fil_tolerance, l_trim_original, s_point1_list, s_point2_list, sv_created_ids ) $? YES 1000047 # Deleting the original entities. dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_line_2point_created_ids) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 431
Construct Actions

asm_const_line_fit

()

# # Purpose : This file provides an example of a call to the # function asm_const_line_fit() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create a line passing through a # set of points. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_fit() # has the following arguments: # # asm_const_line_fit # ( output_ids, # point_list, # num_lines, # geo_tolerance, # num_iterations, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_point_list[128] INTEGER i_num_lines REAL r_geo_tolerance INTEGER i_num_iterations STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating five lines from ten location coordinates. s_output_ids = "#" s_point_list = "[0 0 0][0.5 1 0][1 0 0]"// @ "[1.5 1 0][2 0 0][2.5 1 0][3 0 0][3.5 1 0][4 0 0][4.5 1 0]" i_num_lines = 10 r_geo_tolerance = 0.001 i_num_iterations = 10 # i_return_value = @ asm_const_line_fit @ ( s_output_ids, @ s_point_list, @ i_num_lines, @ r_geo_tolerance, @ i_num_iterations, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

Main Index

432 PCL Reference Manual Examples
Construct Actions

asm_const_line_intersect

()

# # Purpose : This file provides an example of a call to the # function asm_const_line_intersect() # # This session file will create a new database by # name ’new.db’ and create two surfaces. The # above mentioned function will be called to # create a line at their intersection. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_intersect() # has the following arguments: # # asm_const_line_intersect # ( output_ids, # surface1_list, # surface2_list, # curves_per_int, # geo_tolerance, # flat_tolerance, # int_tolerance, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_surface1_list[32] STRING s_surface2_list[32] INTEGER i_curves_per_int REAL r_geo_tolerance REAL r_flat_tolerance REAL r_int_tolerance STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] STRING sv_asm_line_3point_created_ids[VIRTUAL] STRING sv_sgm_sweep_surface_e_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# 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 i_return_value = ga_display_lines_set( "general", 2 ) dump i_return_value @

surface_label(TRUE) curve_label(TRUE) #--------------------------------------------------------------------# Creating a surface in Y-Z plane. i_return_value = @ asm_const_patch_xyz( "1", "<0 1 1>", @ "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating a curve from 3 points and extracting a surface.

Main Index

Chapter 3: Geometry Functions 433
Construct Actions

i_return_value = asm_const_line_3point( "1", "Point 1 ", "[0 0.35 0.7]", "Point 3 ", 1, 0.5, sv_asm_line_3point_created_ids ) dump i_return_value

@ @ @

i_return_value = @ sgm_const_surface_extrude( "2", "<1 0 0>", 1.,@ 0., "[0 0 0]", "Coord 0", "Curve 1 ", @ sv_sgm_sweep_surface_e_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Using surface 1 and 2 to create a line at their intersection. s_output_ids = "#" s_surface1_list = "surface 1" s_surface2_list = "surface 2" i_curves_per_int = 5 r_geo_tolerance = 0.01 r_flat_tolerance = 0.1 r_int_tolerance = 0.05 # i_return_value = @ asm_const_line_intersect @ ( s_output_ids, @ s_surface1_list, @ s_surface2_list, @ i_curves_per_int, @ r_geo_tolerance, @ r_flat_tolerance, @ r_int_tolerance, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_crtd_ids) sys_free_string(sv_asm_line_3point_created_ids) sys_free_string(sv_sgm_sweep_surface_e_crtd_ids) #---------------------------------------------------------------------

asm_const_line_normal
# # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_line_normal() This session file will create a new database by name ’new.db’ and create two lines. The above mentioned function will be called and three lines perpendicular to these lines will be created. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_line_normal() has the following arguments: asm_const_line_normal ( output_ids, point_list, line_list, created_ids )

Main Index

434 PCL Reference Manual Examples
Construct Actions

#--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_point_list[64] STRING s_line_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_line_2point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating two lines. i_return_value = @ asm_const_line_2point("#", "[0 0 0]", @ "[1 0 0][ 0 1 0]", 0, "", 0, 1, @ sv_asm_line_2point_created_ids) dump i_return_value curve_label(TRUE) #--------------------------------------------------------------------# Creating three perpendicular lines to the lines created before. s_output_ids = "#" s_point_list = "[0.25 0.75 0][0.5 0.5 0][0.75 0.25 0]" s_line_list = "curve 1 1 2" # i_return_value = @ asm_const_line_normal @ ( s_output_ids, @ s_point_list, @ s_line_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_line_2point_created_ids) #---------------------------------------------------------------------

asm_const_line_project
# # # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_line_project() This session file will create a new database by name ’new.db’ and create two surfaces and a line. The above mentioned function will be called after a pause, to create lines by projecting the line on the surfaces. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_line_project() has the following arguments: asm_const_line_project ( output_ids, line_list, surface_list, delete_original, project_method, vector,

Main Index

Chapter 3: Geometry Functions 435
Construct Actions

# coord_frame, # num_lines, # geo_tolerance, # flat_tolerance, # int_tolerance, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_line_list[32] STRING s_surface_list[32] LOGICAL l_delete_original INTEGER i_project_method STRING s_vector[32] STRING s_coord_frame[32] INTEGER i_num_lines REAL r_geo_tolerance REAL r_flat_tolerance REAL r_int_tolerance STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_line_3point_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set(-67., 0., -34.) dump i_return_value surface_label(TRUE) curve_label(TRUE) #--------------------------------------------------------------------# Creating two surfaces. i_return_value = @ asm_const_patch_xyz( "#","<0 1 1>" @ ,"[0 0 0]", "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value i_return_value = @ asm_const_patch_xyz( "#","<0.25 0.9 1>" @ ,"[0 0 0]", "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating a curve. i_return_value = @ asm_const_line_3point("#", "[0.25 0.25 0]", @ "[0.25 1 0.5]", "[0.75 0.75 0]", 1, 0.5, @ sv_asm_line_3point_created_ids) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Creating lines by projecting the curve on surfaces by giving # projection vector. s_output_ids = "#" s_line_list = "curve 1" s_surface_list = "surface 1 2" l_delete_original = TRUE i_project_method = 2 s_vector = "<1 0 0>" s_coord_frame = "coord 0" i_num_lines = 3 r_geo_tolerance = 0.01

Main Index

436 PCL Reference Manual Examples
Construct Actions

r_flat_tolerance = 0.1 r_int_tolerance = 0.05 # i_return_value = asm_const_line_project ( s_output_ids, s_line_list, s_surface_list, l_delete_original, i_project_method, s_vector, s_coord_frame, i_num_lines, r_geo_tolerance, r_flat_tolerance, r_int_tolerance, sv_created_ids ) $? YES 1000021 # Deleting the original line. dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_line_3point_created_ids) sys_free_string(sv_asm_create_patch_xy_crtd_ids) #---------------------------------------------------------------------

asm_const_line_project_v1

()

# # Purpose : This file provides an example of a call to the # function asm_const_line_project_v1() # # This session file will create a new database by # name ’new.db’ and create two surfaces and a # line. The above mentioned function will be # called after a pause to create lines by # projecting the line on the surfaces. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_project_v1() # has the following arguments: # # asm_const_line_project_v1 # ( output_ids, # line_list, # surface_list, # delete_original, # project_method, # vector, # coord_frame, # projection_tolerance, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[128] STRING s_line_list[128] STRING s_surface_list[128] LOGICAL l_delete_original INTEGER i_project_method STRING s_vector[128]

Main Index

Chapter 3: Geometry Functions 437
Construct Actions

STRING s_coord_frame[128] REAL r_projection_tolerance STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_line_3point_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set(-67., 0., -34.) dump i_return_value surface_label(TRUE) curve_label(TRUE) #--------------------------------------------------------------------# Creating two surfaces. i_return_value = @ asm_const_patch_xyz( "#","<0 1 1>" @ ,"[0 0 0]", "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value i_return_value = @ asm_const_patch_xyz( "#","<0.25 0.9 1>" @ ,"[0 0 0]", "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating a curve. i_return_value = @ asm_const_line_3point("#", "[0.25 0.25 0]", @ "[0.25 1 0.5]", "[0.75 0.75 0]", 1, 0.5, @ sv_asm_line_3point_created_ids) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Creating lines by projecting the curve on surfaces. s_output_ids = "#" s_line_list = "curve 1" s_surface_list = "surface 1 2" l_delete_original = TRUE i_project_method = 3 s_vector = "<1 0 0>" s_coord_frame = "coord 0" r_projection_tolerance = 0.05 # i_return_value = asm_const_line_project_v1 ( s_output_ids, s_line_list, s_surface_list, l_delete_original, i_project_method, s_vector, s_coord_frame, r_projection_tolerance, sv_created_ids ) $? YES 1000021 # Deleting the original line. dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_line_3point_created_ids)

@ @ @ @ @ @ @ @ @ @

Main Index

438 PCL Reference Manual Examples
Construct Actions

sys_free_string(sv_asm_create_patch_xy_crtd_ids) #---------------------------------------------------------------------

asm_const_line_pwl

()

# # Purpose : This file provides an example of a call to the # function asm_const_line_pwl() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create lines passing through ten # points. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_pwl() # has the following arguments: # # asm_const_line_pwl # ( output_ids, # point_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_point_list[128] STRING sv_created_ids[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 curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating lines by suppling ten point coordinates. s_output_ids = "#" s_point_list = "[0 0 0][0.5 0 1][1 0 0]"//@ "[1.5 0 1][2 0 0][2.5 0 1][3 0 0][3.5 0 1][4 0 0][4.5 0 1]" # i_return_value = @ asm_const_line_pwl @ ( s_output_ids, @ s_point_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_line_spline
#

()

Main Index

Chapter 3: Geometry Functions 439
Construct Actions

# Purpose : This file provides an example of a call to the # function asm_const_line_spline() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create spline passing through ten # points. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_spline() # has the following arguments: # # asm_const_line_spline # ( output_ids, # point_list, # end_flag, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_point_list[128] INTEGER i_end_flag STRING sv_created_ids[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 curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating spline by suppling ten point coordinates. s_output_ids = "#" s_point_list = "[0 0 0][0.5 0 1][1 0 0]"//@ "[1.5 0 1][2 0 0][2.5 0 1][3 0 0][3.5 0 1][4 0 0][4.5 0 1]" i_end_flag = 1 # i_return_value = @ asm_const_line_spline @ ( s_output_ids, @ s_point_list, @ i_end_flag, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_line_tancurve
# # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_line_tancurve() This session file will create a new database by

Main Index

440 PCL Reference Manual Examples
Construct Actions

# name ’new.db’ and create two lines. The above # mentioned function will be called to create a # tangent curve. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_tancurve() # has the following arguments: # # asm_const_line_tancurve # ( output_ids, # line1_list, # line2_list, # trim_original, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_line1_list[128] STRING s_line2_list[128] LOGICAL l_trim_original STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_line_3point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating two lines. i_return_value = @ asm_const_line_3point( "#", "[1 2 0][-1 2 0]", @ "[.75 .25 0][-.75 .25 0]", @ "[.25 1 0][-.25 1 0]", 1, 0.5, @ sv_asm_line_3point_created_ids ) dump i_return_value curve_label(TRUE) #--------------------------------------------------------------------# Creating a line tangent to the lines drawn before. s_output_ids = "#" l_trim_original = TRUE s_line1_list = "Construct PointCurveUOnCurve "//@ "(Evaluate Geometry ([ 0.719200 0.218000 0.000000 ]))"//@ "(Evaluate Geometry (Curve 1 ))" s_line2_list = "Construct PointCurveUOnCurve "//@ "(Evaluate Geometry ([-0.551050 0.284500 0.000000 ]))"//@ "(Evaluate Geometry (Curve 2 ))" # i_return_value = @ asm_const_line_tancurve @ ( s_output_ids, @ s_line1_list, @ s_line2_list, @ l_trim_original, @ sv_created_ids ) $? YESFORALL 1000028 # Deleting the original entities. dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids)

Main Index

Chapter 3: Geometry Functions 441
Construct Actions

sys_free_string(sv_asm_line_3point_created_ids) #---------------------------------------------------------------------

asm_const_line_tanpoint

()

# # Purpose : This file provides an example of a call to the # function asm_const_line_tanpoint() # # This session file will create a new database by # name ’new.db’ and create five curves. The above # mentioned function will be called to create # tangents to the curves. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_tanpoint() # has the following arguments: # # asm_const_line_tanpoint # ( output_ids, # line_list, # point_list, # closest_only, # trim_original, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_line_list[32] STRING s_point_list[64] LOGICAL l_closest_only LOGICAL l_trim_original STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_line_fit_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 90., 0., 0. ) dump i_return_value curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating five curves. i_return_value = @ asm_const_line_fit( "#", @ "[0 0 0][0.5 0 1][1 0 0][1.5 0 1 ][2 0 0]",@ 5, 0.0049999999, 10, sv_asm_create_line_fit_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating tangents to the existing five curves. s_output_ids = "#" s_line_list = "curve 1 2 3 4 5" s_point_list = "[0.35 0 1][1.1 0 -0.15]"// @ "[1.9 0 0][1.5 0 1.050167][1.5 0 1.050167]" l_closest_only = FALSE l_trim_original = FALSE #

Main Index

442 PCL Reference Manual Examples
Construct Actions

i_return_value = @ asm_const_line_tanpoint @ ( s_output_ids, @ s_line_list, @ s_point_list, @ l_closest_only, @ l_trim_original, @ sv_created_ids ) $? YESFORALL 1000065 $? YESFORALL 1000065 # Creating all tangents between point and curve. dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_line_fit_crtd_ids) #---------------------------------------------------------------------

asm_const_line_xyz

()

# # Purpose : This file provides an example of a call to the # function asm_const_line_xyz() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create three curves. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_line_xyz() # has the following arguments: # # asm_const_line_xyz # ( output_ids, # line_length, # line_origin, # coord_frame, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] STRING s_line_length[32] STRING s_line_origin[32] STRING s_coord_frame[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------curve_label(TRUE) #--------------------------------------------------------------------# Creating three curves. s_output_ids = "#" s_line_length = "<1 0 0><1 1 0>" s_line_origin = "[0 0 0][0 0 0][1 0 0]" s_coord_frame = "coord 0" # i_return_value = @ asm_const_line_xyz @ ( s_output_ids, @

Main Index

Chapter 3: Geometry Functions 443
Construct Actions

s_line_length, s_line_origin, s_coord_frame, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @

sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_patch_2curve

()

# # Purpose : This file provides an example of a call to the # function asm_const_patch_2curve() # # This file opens a new database "new.db" and # creates three curves. Later it creates two # surfaces with three curves using the above # function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_patch_2curve() # has the following arguments: # # asm_const_patch_2curve # ( output_ids, # curve1_list, # curve2_list, # manifold_type, # manifold_id, # ruled_form, # auto_align, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "3 4" STRING s_curve1_list[32] STRING s_curve2_list[32] INTEGER i_manifold_type STRING s_manifold_id[32] INTEGER i_ruled_form LOGICAL l_auto_align STRING sv_created_ids[VIRTUAL] STRING sv_sgm_create_curve_2d_created[VIRTUAL] 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 # Create three curves. i_return_value = @ sgm_const_curve_2d_arcangles_v1( "1", 1., @ 30., 150., "Coord 0.3", "[0 0 0]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ asm_const_line_2point( "2", "[-0.866 0.5 1]", @ "[0.866 0.5 1]", 0, "", 50., 1, @

Main Index

444 PCL Reference Manual Examples
Construct Actions

sv_asm_line_2point_created_ids ) dump i_return_value i_return_value = @ sgm_const_curve_2d_arcangles_v1( "3", 1., @ 30., 150., "Coord 0.3", "[0 0 2]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value ga_view_aa_set( 23.,-60., 0. ) ga_group_display_set("default_group","general") ga_display_lines_set( "general", 20 ) s_curve1_list = "curve 1 3" s_curve2_list = "curve 2 2" i_manifold_type = 0 i_ruled_form = 0 l_auto_align = TRUE i_return_value = asm_const_patch_2curve ( s_output_ids, s_curve1_list, s_curve2_list, i_manifold_type, s_manifold_id, i_ruled_form, l_auto_align, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_sgm_create_curve_2d_created) sys_free_string(sv_asm_line_2point_created_ids) #---------------------------------------------------------------------

asm_const_patch_2curve_v1

()

# # Purpose : This file provides an example of a call to the # function asm_const_patch_2curve_v1() # # This file opens a new database "new.db" and # creates three curves. Later it creates two # surfaces with three curves using the above # function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_patch_2curve_v1() # has the following arguments: # # asm_const_patch_2curve_v1 # ( output_ids, # curve1_list, # curve2_list, # manifold_type, # manifold_id, # auto_align, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations

Main Index

Chapter 3: Geometry Functions 445
Construct Actions

STRING s_output_ids[32] = "3 4" STRING s_curve1_list[32] STRING s_curve2_list[32] INTEGER i_manifold_type STRING s_manifold_id[32] LOGICAL l_auto_align STRING sv_created_ids[VIRTUAL] STRING sv_sgm_create_curve_2d_created[VIRTUAL] 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 # Create three curves. i_return_value = @ sgm_const_curve_2d_arcangles_v1( "1", 1., @ 30., 150., "Coord 0.3", "[0 0 0]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ asm_const_line_2point( "2", "[-0.866 0.5 1]", @ "[0.866 0.5 1]", 0, "", 50., 1, @ sv_asm_line_2point_created_ids ) dump i_return_value i_return_value = @ sgm_const_curve_2d_arcangles_v1( "3", 1., @ 30., 150., "Coord 0.3", "[0 0 2]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value ga_view_aa_set( 23.,-60., 0. ) ga_group_display_set("default_group","general") ga_display_lines_set( "general", 20 ) s_curve1_list = "curve 1 3" s_curve2_list = "curve 2 2" i_manifold_type = 0 l_auto_align = TRUE i_return_value = asm_const_patch_2curve_v1 ( s_output_ids, s_curve1_list, s_curve2_list, i_manifold_type, s_manifold_id, l_auto_align, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_sgm_create_curve_2d_created) sys_free_string(sv_asm_line_2point_created_ids) #---------------------------------------------------------------------

asm_const_patch_3curve
# # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_patch_3curve() This file opens a new database "new.db" and

Main Index

446 PCL Reference Manual Examples
Construct Actions

# creates five curves. Later it creates two # surfaces with five curves using the above # function. Each surface consists of three # curves. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_patch_3curve() # has the following arguments: # # asm_const_patch_3curve # ( output_ids, # curve1_list, # curve2_list, # curve3_list, # param_pos, # auto_align, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "8 9" STRING s_curve1_list[32] STRING s_curve2_list[32] STRING s_curve3_list[32] REAL r_param_pos LOGICAL l_auto_align STRING sv_created_ids[VIRTUAL] STRING sv_sgm_create_curve_2d_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create five curves. i_return_value = @ sgm_const_curve_2d_arcangles_v1( "1", 1., @ 30., 150., "Coord 0.3", "[0 0 0]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ sgm_const_curve_2d_arcangles_v1( "2", 1., @ -150.,-30.,"Coord 0.3", "[0 1 1]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ sgm_const_curve_2d_arcangles_v1( "3", 1., @ 30., 150., "Coord 0.3", "[0 0 2]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ sgm_const_curve_2d_arcangles_v1( "4", 1., @ -150.,-30.,"Coord 0.3", "[0 1 3]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ sgm_const_curve_2d_arcangles_v1( "5", 1., @ 30., 150., "Coord 0.3", "[0 0 4]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value

Main Index

Chapter 3: Geometry Functions 447
Construct Actions

ga_view_aa_set( 23.,-60., 0. ) ga_group_display_set("default_group","general") ga_display_lines_set( "general", 20 ) s_curve1_list = "curve 1 3" s_curve2_list = "curve 2 4" s_curve3_list = "curve 3 5" l_auto_align = TRUE r_param_pos = 0.4 # # # Create two surfaces with ids 8 and 9. Surface with id 8 has curves 1 ,2 and 3. Surface with id 9 has curves 3 ,4 and 5. @ @ @ @ @ @ @ @

i_return_value = asm_const_patch_3curve ( s_output_ids, s_curve1_list, s_curve2_list, s_curve3_list, r_param_pos, l_auto_align, sv_created_ids ) dump i_return_value dump sv_created_ids

sys_free_string(sv_created_ids) sys_free_string(sv_sgm_create_curve_2d_created) #---------------------------------------------------------------------

asm_const_patch_4curve

()

# # Purpose : This file provides an example of a call to the # function asm_const_patch_4curve() # # This file opens a new database "new.db" and # creates four curves. Later it creates a # surface with four curves using the above # function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_patch_4curve() # has the following arguments: # # asm_const_patch_4curve # ( output_ids, # curve1_list, # curve2_list, # curve3_list, # curve4_list, # param_pos1, # param_pos2, # auto_align, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "8" STRING s_curve1_list[32] STRING s_curve2_list[32]

Main Index

448 PCL Reference Manual Examples
Construct Actions

STRING s_curve3_list[32] STRING s_curve4_list[32] REAL r_param_pos1 REAL r_param_pos2 LOGICAL l_auto_align STRING sv_created_ids[VIRTUAL] STRING sv_sgm_create_curve_2d_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create four curves. i_return_value = @ sgm_const_curve_2d_arcangles_v1( "1", 1., @ 30., 150., "Coord 0.3", "[0 0 0]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ sgm_const_curve_2d_arcangles_v1( "2", 1., @ -150.,-30.,"Coord 0.3", "[0 1 1]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ sgm_const_curve_2d_arcangles_v1( "3", 1., @ 30., 150., "Coord 0.3", "[0 0 2]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ sgm_const_curve_2d_arcangles_v1( "4", 1., @ -150.,-30.,"Coord 0.3", "[0 1 3]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value ga_view_aa_set( 23.,-60., 0. ) ga_group_display_set("default_group","general") ga_display_lines_set( "general", 20 ) s_curve1_list = "curve s_curve2_list = "curve s_curve3_list = "curve s_curve4_list = "curve l_auto_align = TRUE r_param_pos1 = 0.33 r_param_pos2 = 0.66 1 2 3 4 " " " "

# Create a surface with ids 8 having curves 1,2,3 and 4. i_return_value = @ asm_const_patch_4curve @ ( s_output_ids, @ s_curve1_list, @ s_curve2_list, @ s_curve3_list, @ s_curve4_list, @ r_param_pos1, @ r_param_pos2, @ l_auto_align, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_sgm_create_curve_2d_created) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 449
Construct Actions

asm_const_patch_edge

()

# # Purpose : This file provides an example of a call to the # function asm_const_patch_edge() # # This file opens a new database "new.db" and # creates four curves. Later it creates a # surface with four bounding curves using the # above function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_patch_edge() # has the following arguments: # # asm_const_patch_edge # ( output_ids, # curve1_list, # curve2_list, # curve3_list, # curve4_list, # manifold_type, # manifold_id, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "8" STRING s_curve1_list[32] STRING s_curve2_list[32] STRING s_curve3_list[32] STRING s_curve4_list[32] INTEGER i_manifold_type STRING s_manifold_id[32] STRING sv_created_ids[VIRTUAL] STRING sv_sgm_create_curve_2d_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create four curves. i_return_value = @ sgm_const_curve_2d_arcangles_v1( "1", 1., @ 30., 150., "Coord 0.3", "[0 0 0]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = sgm_const_curve_2d_arcangles_v1( "2", 1., 90.,270.,"Coord 0.1","[0.866 0.5 1]" ,FALSE,sv_sgm_create_curve_2d_created ) dump i_return_value @ @ @

i_return_value = @ sgm_const_curve_2d_arcangles_v1( "3", 1., @ 30., 150., "Coord 0.3", "[0 0 2]", FALSE , @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @

Main Index

450 PCL Reference Manual Examples
Construct Actions

sgm_const_curve_2d_arcangles_v1( "4", 1., 90.,270.,"Coord 0.1", "[-0.866 0.5 1]" , FALSE ,sv_sgm_create_curve_2d_created ) dump i_return_value ga_view_aa_set( 23.,-60., 0. ) ga_group_display_set("default_group","general") ga_display_lines_set( "general", 20 ) s_curve1_list = s_curve2_list = s_curve3_list = s_curve4_list = i_manifold_type "curve "curve "curve "curve = 0 1 2 3 4 " " " "

@ @

# Create a surface with ids 8 having curves 1,2,3 and 4. i_return_value = @ asm_const_patch_edge @ ( s_output_ids, @ s_curve1_list, @ s_curve2_list, @ s_curve3_list, @ s_curve4_list, @ i_manifold_type, @ s_manifold_id, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_sgm_create_curve_2d_created) #---------------------------------------------------------------------

asm_const_patch_extract

()

# # Purpose : This file provides an example of two calls to # the function asm_const_patch_extract() # # This file opens a new database "new.db" and # creates a cubic solid. Later it extracts two # surfaces from this solid in different # parametric planes. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_patch_extract() # has the following arguments: # # asm_const_patch_extract # ( output_ids, # hpat_list, # param_plane, # param_pos, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "8" STRING s_hpat_list[32] INTEGER i_param_plane REAL r_param_pos STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_hpat_xyz_created[VIRTUAL]

Main Index

Chapter 3: Geometry Functions 451
Construct Actions

INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 i_return_value = @ asm_const_hpat_xyz("1","<2 2 2>","[0 0 0]", @ "coord 0", sv_asm_create_hpat_xyz_created ) dump i_return_value ga_view_aa_set( 23.,-34.,0.) surface_label(TRUE) s_hpat_list = "Solid 1" # Create a patch by extracting a surface from the solid in # parametric plane 1 and having parametric position 0.75. i_param_plane = 1 r_param_pos = 0.75 i_return_value = asm_const_patch_extract ( s_output_ids, s_hpat_list, i_param_plane, r_param_pos, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @

# Create a patch by extracting a surface from the solid in # parametric plane 2 and having parametric position 0.33. s_output_ids = "9" i_param_plane = 2 r_param_pos = 0.33 i_return_value = @ asm_const_patch_extract @ ( s_output_ids, @ s_hpat_list, @ i_param_plane, @ r_param_pos, @ 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) #---------------------------------------------------------------------

asm_const_patch_fillet
# # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_patch_fillet() This file opens a new database "new.db" and creates two surfaces at right angle to each other. Later it creates a fillet surface between these two surfaces. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

Main Index

452 PCL Reference Manual Examples
Construct Actions

# # The function asm_const_patch_fillet() # has the following arguments: # # asm_const_patch_fillet # ( output_ids, # radius1, # radius2, # fil_tol, # trim_orig, # surfacepoint1_list, # surfacepoint2_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "8" REAL r_radius1 REAL r_radius2 REAL r_fil_tol LOGICAL l_trim_orig STRING s_surfacepoint1_list[256] STRING s_surfacepoint2_list[256] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create two surfaces at right angle to each other. i_return_value = @ asm_const_patch_xyz("1","<0 1 1>","[0 0 0]", @ "coord 0" ,sv_asm_create_patch_xy_created) dump i_return_value i_return_value = @ asm_const_patch_xyz("2","<1 0 1>","[0 0 0]", @ "coord 0", sv_asm_create_patch_xy_created) dump i_return_value ga_view_aa_set(23.,-34.,0.) r_radius1 = 0.2 r_radius2 = 0.3 r_fil_tol = 0.005 l_trim_orig = TRUE s_surfacepoint1_list = "Construct PointSurfaceUVOnSurface" // @ "(Evaluate Geometry (Point 4 )) (Evaluate Geometry (Surface 1 ))" s_surfacepoint2_list = "Construct PointSurfaceUVOnSurface" // @ "(Evaluate Geometry (Point 5 )) (Evaluate Geometry (Surface 2 ))" # Create fillet surface at the edge of the two surfaces. # Session file paused. Press "Resume" to continue.. sf_pause() i_return_value = asm_const_patch_fillet ( s_output_ids, r_radius1, r_radius2, r_fil_tol, l_trim_orig, s_surfacepoint1_list, s_surfacepoint2_list, sv_created_ids ) @ @ @ @ @ @ @ @ @

Main Index

Chapter 3: Geometry Functions 453
Construct Actions

$? YESFORALL 1000049 dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

asm_const_patch_match

()

# # Purpose : This file provides an example of a call to the # function asm_const_patch_match() # # This file opens a new database "new.db" and # creates a square surface. Further it creates # two curves. Later it creates a surface with # these two curves. Finally it constructs a # match surface with two edges of the previously # created surfaces. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_patch_match() # has the following arguments: # # asm_const_patch_match # ( output_ids, # surface_list1, # surface_list2, # del_org, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "8" STRING s_surface_list1[32] STRING s_surface_list2[32] LOGICAL l_del_org STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_asm_create_line_xyz_created[VIRTUAL] STRING sv_sgm_create_curve_2d_created[VIRTUAL] STRING sv_sgm_surface_2curve_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]" @ ,"Coord 0",sv_asm_create_patch_xy_created ) dump i_return_value # Create two curves. i_return_value = @ sgm_const_curve_2d_arcangles_v1( "1", 0.5, @ -90., 90., "Coord 0.3", "[1 0.5 0]",TRUE, @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ asm_const_line_xyz( "2", "<0 1 0>", "[2 0 0]",@

Main Index

454 PCL Reference Manual Examples
Construct Actions

"Coord 0",sv_asm_create_line_xyz_created ) dump i_return_value # Create a surface between the two created curves. i_return_value = @ sgm_const_surface_2curve( "2", "Curve 1 ", @ "Curve 2 ", sv_sgm_surface_2curve_created ) dump i_return_value s_surface_list1 = "surface 1" s_surface_list2 = "surface 2" l_del_org = TRUE surface_label(TRUE) # Note the creation of match surface. # Session file paused. Press "Resume" to continue.. sf_pause() # Create a match surface with label = 8. i_return_value = asm_const_patch_match ( s_output_ids, s_surface_list1, s_surface_list2, l_del_org, sv_created_ids ) $? YES 38000219 dump i_return_value dump sv_created_ids @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_asm_create_line_xyz_created) sys_free_string(sv_sgm_create_curve_2d_created) sys_free_string(sv_sgm_surface_2curve_created) #---------------------------------------------------------------------

asm_const_patch_vertex
# # # # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_patch_vertex() This file opens a new creates seven points. two surfaces with the surface contains four database "new.db" and Later it constructs created points. Each points.

This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar. The function asm_const_patch_vertex() has the following arguments: asm_const_patch_vertex ( output_ids, point1_list, point2_list, point3_list, point4_list, manifold_type, manifold_id, created_ids )

Main Index

Chapter 3: Geometry Functions 455
Construct Actions

# #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "1 2" STRING s_point1_list[32] STRING s_point2_list[32] STRING s_point3_list[32] STRING s_point4_list[32] INTEGER i_manifold_type STRING s_manifold_id[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_grid_xyz_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create 7 points. i_return_value = @ asm_const_grid_xyz( "","[0 0 0][1 0 0]"// @ "[1 1 0][0 1 0][2 1 0][2 2 0][1 2 0]", @ "coord 0", sv_asm_create_grid_xyz_created ) dump i_return_value s_point1_list = s_point2_list = s_point3_list = s_point4_list = i_manifold_type "point "point "point "point = 0 1 2 3 4 3 5 6 7 " " " "

# Create Surface using the vertex grid points. i_return_value = asm_const_patch_vertex ( s_output_ids, s_point1_list, s_point2_list, s_point3_list, s_point4_list, i_manifold_type, s_manifold_id, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_grid_xyz_created) #---------------------------------------------------------------------

asm_const_patch_xyz
# # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_patch_xyz() This file opens a new database "new.db" and creates a surface with a given origin and given length. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_patch_xyz() has the following arguments:

Main Index

456 PCL Reference Manual Examples
Construct Actions

# asm_const_patch_xyz # ( output_ids, # surface_length, # surface_origin, # coord_frame, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "4" STRING s_surface_length[32] STRING s_surface_origin[32] STRING s_coord_frame[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a surface with origin [0 0 0] and length <1 1 0>. s_surface_length = "<1 1 0>" s_surface_origin = "[0 0 0]" s_coord_frame = "coord 0" i_return_value = asm_const_patch_xyz ( s_output_ids, s_surface_length, s_surface_origin, s_coord_frame, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @

sys_free_string(sv_created_ids) #---------------------------------------------------------------------

asm_const_solid_5face

()

# # Purpose : This file provides an example of a call to the # function asm_const_solid_5face() # # This file opens a new database "new.db" and # creates a triangular prism with five surfaces. # Later it creates a solid with the help of # these five surfaces. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_solid_5face() # has the following arguments: # # asm_const_solid_5face # ( output_ids, # surface1_list, # surface2_list, # surface3_list, # surface4_list, # surface5_list, # created_ids ) # #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 457
Construct Actions

# Variable Declarations STRING s_output_ids[32] = "8" STRING s_surface1_list[32] STRING s_surface2_list[32] STRING s_surface3_list[32] STRING s_surface4_list[32] STRING s_surface5_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_asm_line_2point_created_ids[VIRTUAL] STRING sv_sgm_surface_3edge_created[VIRTUAL] STRING sv_sgm_surface_4edge_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 ga_view_aa_set(23.,-34.,0.) # Create two surfaces. i_return_value = asm_const_patch_xyz("","<1 1 0><0 1 1>", "[0 0 0][0 0 0]", "coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create two curves. i_return_value = asm_const_line_2point( "1", "Point 6 ", "Point 3 ", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value i_return_value = asm_const_line_2point( "2", "Point 5 ", "Point 4 ", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value # Create three surfaces. i_return_value = sgm_const_surface_3edge( "", "Surface 2.3 Surface 2.1 ", "Surface 1.2 surface 1.4 ", "Curve 1 Curve 2", sv_sgm_surface_3edge_created ) dump i_return_value @ @ @

@ @ @ @ @ @

@ @ @ @ @

i_return_value = @ sgm_const_surface_4edge( "5", "Surface 2.2 ", @ "Curve 1 ", "Surface 1.3 ", "Curve 2 ", @ sv_sgm_surface_4edge_created ) dump i_return_value solid_label(TRUE) s_surface1_list s_surface2_list s_surface3_list s_surface4_list s_surface5_list = = = = = "surface "surface "surface "surface "surface 1" 2" 3" 4" 5"

# Create a Solid with the created five surfaces. i_return_value = @ asm_const_solid_5face @ ( s_output_ids, @ s_surface1_list, @ s_surface2_list, @

Main Index

458 PCL Reference Manual Examples
Construct Actions

s_surface3_list, s_surface4_list, s_surface5_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_asm_line_2point_created_ids) sys_free_string(sv_sgm_surface_3edge_created) sys_free_string(sv_sgm_surface_4edge_created) #---------------------------------------------------------------------

asm_const_solid_6face

()

# # Purpose : This file provides an example of a call to the # function asm_const_solid_6face() # # This file opens a new database "new.db" and # creates six surfaces. Later it creates a # solid with the help of these six surfaces. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_solid_6face() # has the following arguments: # # asm_const_solid_6face # ( output_ids, # surface1_list, # surface2_list, # surface3_list, # surface4_list, # surface5_list, # surface6_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "8" STRING s_surface1_list[32] STRING s_surface2_list[32] STRING s_surface3_list[32] STRING s_surface4_list[32] STRING s_surface5_list[32] STRING s_surface6_list[128] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_asm_line_2point_created_ids[VIRTUAL] STRING sv_sgm_surface_4edge_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 ga_view_aa_set(23.,-34.,0.) # Create three surfaces. i_return_value = asm_const_patch_xyz("", @ @

Main Index

Chapter 3: Geometry Functions 459
Construct Actions

"<2 0 1><0 1 1><1 0 1>", "[0 0 0][0 0 0][0 1 0]","coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create two curves. i_return_value = asm_const_line_2point( "1", "Point 8 ", "Point 3 ", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value i_return_value = asm_const_line_2point( "2", "Point 7 ", "Point 2 ", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value # Create three surfaces. i_return_value = sgm_const_surface_4edge( "", "Surface 3.1 Surface 3.3 Surface 3.2 ", "Surface 2.4 Surface 2.2 Curve 1 ", "Surface 1.1 Surface 1.3 Surface 1.2 ", "Curve 2 Curve 1 Curve 2 ",@ sv_sgm_surface_4edge_created ) dump i_return_value solid_label(TRUE) s_surface1_list s_surface2_list s_surface3_list s_surface4_list s_surface5_list s_surface6_list = = = = = = "surface "surface "surface "surface "surface "surface 1" 2" 3" 4" 5" 6"

@ @

@ @ @ @ @ @

@ @ @ @ @

# Create a Solid with the created six surfaces. i_return_value = @ asm_const_solid_6face @ ( s_output_ids, @ s_surface1_list, @ s_surface2_list, @ s_surface3_list, @ s_surface4_list, @ s_surface5_list, @ s_surface6_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_asm_line_2point_created_ids) sys_free_string(sv_sgm_surface_4edge_created) #---------------------------------------------------------------------

asm_const_solid_extrude
# # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_solid_extrude() This file opens a new database "new.db" and creates a cubic solid. Later it extrudes one of the surface of the solid in a defined axis with scaling and rotating it simultaneously and creates three solids.

Main Index

460 PCL Reference Manual Examples
Construct Actions

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_solid_extrude() # has the following arguments: # # asm_const_solid_extrude # ( output_ids, # delta, # scale, # angle, # origin, # coord_frame, # nsolids, # surface_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "6" STRING s_delta[32] REAL r_scale REAL r_angle STRING s_origin[32] STRING s_coord_frame[32] INTEGER i_nsolids STRING s_surface_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_hpat_xyz_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # 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 ga_view_aa_set(23.,-34.,0) solid_label(TRUE) s_delta = "<0 5 0>" r_scale = 2.0 r_angle = 30 s_origin = "[0.5 1.0 0.5]" s_coord_frame = "coord 0" i_nsolids = 3 s_surface_list = "Solid 1.4" # Create three solids. i_return_value = asm_const_solid_extrude ( s_output_ids, s_delta, r_scale, r_angle, s_origin, s_coord_frame, i_nsolids, s_surface_list, sv_created_ids ) dump i_return_value @ @ @ @ @ @ @ @ @ @ @ @

Main Index

Chapter 3: Geometry Functions 461
Construct Actions

dump sv_created_ids # Observe the solids in the top view. # Session file paused. Press "Resume" to continue.. sf_pause() ga_view_aa_set(90.,0.,0.) sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_hpat_xyz_created) #---------------------------------------------------------------------

asm_const_solid_glide

()

# # Purpose : This file provides an example of a call to the # function asm_const_solid_glide() # # This file opens a new database "new.db" and # creates a surface and two curves. Later it # creates a solid by gliding the surface on # these two curves using the above function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_solid_glide() # has the following arguments: # # asm_const_solid_glide # ( output_ids, # scale, # glide_option, # director_surface, # base_surface, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "8 9" REAL r_scale INTEGER i_glide_option STRING s_director_surface[32] STRING s_base_surface[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_asm_create_line_arc_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 ga_view_aa_set(23.,-34.,0) ga_group_display_set("default_group","general") ga_display_lines_set( "general", 2 ) solid_label(TRUE) # Create a surface in the yz plane. i_return_value = asm_const_patch_xyz( "1", "<0 0.5 1>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create two curves in the xz plane. @ @ @

Main Index

462 PCL Reference Manual Examples
Construct Actions

i_return_value = sgm_const_curve_arc3point( "1", FALSE, "[0 0 0]", "[1 0 0.5]", "[2 0 0.8]", sv_asm_create_line_arc_created ) dump i_return_value i_return_value = sgm_const_curve_arc3point( "2", FALSE, "[2 0 0.8]", "[2.5 0 1]", "[3 0 1.5]", sv_asm_create_line_arc_created ) dump i_return_value # Create a solid. s_director_surface = "Curve 1 2" s_base_surface = "Surface 1" r_scale = 0.3 i_glide_option = 1 i_return_value = asm_const_solid_glide ( s_output_ids, r_scale, i_glide_option, s_director_surface, s_base_surface, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @

@ @ @

@ @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_asm_create_line_arc_created) #---------------------------------------------------------------------

asm_const_solid_normal

()

# # Purpose : This file provides an example of a call to the # function asm_const_solid_normal() # # This file opens a new database "new.db" and # creates a surface. Later it creates a solid # with an offset from the created surface. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_solid_normal() # has the following arguments: # # asm_const_solid_normal # ( output_ids, # thickness1, # thickness2, # thickness3, # thickness4, # nsolids, # flip, # surface_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "8"

Main Index

Chapter 3: Geometry Functions 463
Construct Actions

STRING s_thickness1[32] STRING s_thickness2[32] STRING s_thickness3[32] STRING s_thickness4[32] INTEGER i_nsolids LOGICAL l_flip STRING s_surface_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 ga_view_aa_set(23.,-34.,0) ga_group_display_set("default_group","general") ga_display_lines_set( "general", 2 ) solid_label(TRUE) # Create a surface in the yz plane. i_return_value = asm_const_patch_xyz( "1", "<0.5 0 1>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create a Solid. s_thickness1 = "0.5" s_thickness2 = "0.4" s_thickness3 = "0.7" s_thickness4 = "0.3" i_nsolids = 1 l_flip = TRUE s_surface_list = "surface 1" i_return_value = asm_const_solid_normal ( s_output_ids, s_thickness1, s_thickness2, s_thickness3, s_thickness4, i_nsolids, l_flip, s_surface_list, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

asm_const_solid_revolve
# # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_solid_revolve() This file opens a new database "new.db" and creates two surfaces. Later it creates a solid, revolving these two surfaces, using the above function. This file can be run by starting a session of Patran, and running this session file

Main Index

464 PCL Reference Manual Examples
Construct Actions

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_solid_revolve() # has the following arguments: # # asm_const_solid_revolve # ( output_ids, # axis, # angle, # offset, # coord_frame, # nsurfaces, # surface_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "8" STRING s_axis[32] REAL r_angle REAL r_offset STRING s_coord_frame[32] INTEGER i_nsurfaces STRING s_surface_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 ga_view_aa_set(23.,-34.,0) ga_group_display_set("default_group","general") ga_display_lines_set( "general", 2 ) solid_label(TRUE) # Create two surfaces. i_return_value = asm_const_patch_xyz( "1", "<0 0.2 0.2>", "[0 1 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value i_return_value = asm_const_patch_xyz( "2", "<0 0.3 0.3>", "[0 2 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create a solid. s_axis = "coord 0.3" r_angle = 180.0 r_offset = 30.0 s_coord_frame = "coord 0" i_nsurfaces = 1 s_surface_list = "surface 1 2" i_return_value = asm_const_solid_revolve ( s_output_ids, s_axis, r_angle, r_offset, s_coord_frame, i_nsurfaces, s_surface_list, @ @ @ @ @ @ @ @ @ @ @ @

@ @ @

Main Index

Chapter 3: Geometry Functions 465
Construct Actions

sv_created_ids ) dump sv_created_ids dump i_return_value sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

asm_const_solid_2surface

()

# # Purpose : This file provides an example of a call to the # function asm_const_solid_2surface() # # This file opens a new database "new.db" and # creates two surfaces. Later it creates a # solid with these two surfaces using the # above function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_solid_2surface() # has the following arguments: # # asm_const_solid_2surface # ( output_ids, # auto_orient, # surface1_list, # surface2_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] LOGICAL l_auto_orient STRING s_surface1_list[32] STRING s_surface2_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 ga_view_aa_set(23.,-34.,0) ga_group_display_set("default_group","general") ga_display_lines_set( "general", 2 ) solid_label(TRUE) s_output_ids = "8" # Create two surfaces. i_return_value = asm_const_patch_xyz( "1", "<1 0 1>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value i_return_value = asm_const_patch_xyz( "2", "<0.5 0 "[0.25 1 0.25]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value 0.5>",

@ @ @

@ @ @

Main Index

466 PCL Reference Manual Examples
Construct Actions

# Create a solid. l_auto_orient = TRUE s_surface1_list = "surface 1" s_surface2_list = "surface 2" i_return_value = asm_const_solid_2surface ( s_output_ids, l_auto_orient, s_surface1_list, s_surface2_list, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

asm_const_solid_3surface

()

# # Purpose : This file provides an example of a call to the # function asm_const_solid_3surface() # # This file opens a new database "new.db" and # creates three surfaces. Later it creates a # solid with these three surfaces using the # above function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_solid_3surface() # has the following arguments: # # asm_const_solid_3surface # ( output_ids, # orient, # param_method, # surface1_list, # surface2_list, # surface3_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] LOGICAL l_orient INTEGER i_param_method STRING s_surface1_list[32] STRING s_surface2_list[32] STRING s_surface3_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 ga_view_aa_set(23.,-34.,0) ga_group_display_set("default_group","general") ga_display_lines_set( "general", 2 )

Main Index

Chapter 3: Geometry Functions 467
Construct Actions

solid_label(TRUE) s_output_ids = "8" # Create three surfaces. i_return_value = asm_const_patch_xyz( "1", "<1 0 1>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value i_return_value = asm_const_patch_xyz( "2", "<0.5 0 "[-0.25 1 0.25]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value i_return_value = asm_const_patch_xyz( "3", "<0.5 0 "[0.25 2 0.25]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create a solid. l_orient = TRUE i_param_method = 2 s_surface1_list = "surface 1" s_surface2_list = "surface 2" s_surface3_list = "surface 3" i_return_value = asm_const_solid_3surface ( s_output_ids, l_orient, i_param_method, s_surface1_list, s_surface2_list, s_surface3_list, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @ @ @ 0.5>",

@ @ @

@ @ @

0.5>",

@ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

asm_const_solid_4surface
# # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_solid_4surface() This file opens a new database "new.db" and creates four surfaces. Later it creates a solid with these four surfaces using the above function. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_solid_4surface() has the following arguments: asm_const_solid_4surface ( output_ids, orient,

Main Index

468 PCL Reference Manual Examples
Construct Actions

# param_method, # surface1_list, # surface2_list, # surface3_list, # surface4_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] LOGICAL l_orient INTEGER i_param_method STRING s_surface1_list[32] STRING s_surface2_list[32] STRING s_surface3_list[32] STRING s_surface4_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 ga_view_aa_set(23.,-34.,0) ga_group_display_set("default_group","general") ga_display_lines_set( "general", 2 ) solid_label(TRUE) s_output_ids = "8" # Create four surfaces. i_return_value = asm_const_patch_xyz( "1", "<1 0 1>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value i_return_value = asm_const_patch_xyz( "2", "<0.5 0 "[-0.25 1 0.25]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value i_return_value = asm_const_patch_xyz( "3", "<0.5 0 "[0.25 2 0.25]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value 0.5>",

@ @ @

@ @ @

0.5>",

@ @ @

i_return_value = asm_const_patch_xyz( "4", "<1 0 1>", "[0.5 3 0.5]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create a solid. l_orient = TRUE i_param_method = 2 s_surface1_list = "surface s_surface2_list = "surface s_surface3_list = "surface s_surface4_list = "surface i_return_value = asm_const_solid_4surface ( s_output_ids, l_orient, i_param_method,

@ @ @

1" 2" 3" 4" @ @ @ @ @

Main Index

Chapter 3: Geometry Functions 469
Construct Actions

s_surface1_list, s_surface2_list, s_surface3_list, s_surface4_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

asm_const_solid_nsurface

()

# # Purpose : This file provides an example of a call to the # function asm_const_solid_nsurface() # # This file opens a new database "new.db" and # creates four surfaces. Later it creates a # solid with these four surfaces using the # above function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_solid_nsurface() # has the following arguments: # # asm_const_solid_nsurface # ( output_ids, # orient, # param_method, # surface_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] LOGICAL l_orient INTEGER i_param_method STRING s_surface_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[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 i_return_value = ga_group_display_set("default_group","general") dump i_return_value i_return_value = ga_display_lines_set( "general", 2 ) dump i_return_value solid_label(TRUE) # Create four surfaces. i_return_value = @ asm_const_patch_xyz( "1", @ "<1 0 1><0.5 0 0.5><0.5 0 0.5><1 0 1>", @ "[0 0 0][-.25 1 .25][.25 2 .25][.5 3 .5]", @ "Coord 0", sv_asm_create_patch_xy_created )

Main Index

470 PCL Reference Manual Examples
Construct Actions

dump i_return_value # Create a solid. s_output_ids = "8" l_orient = TRUE i_param_method = 2 s_surface_list = "surface 1 2 3 4" i_return_value = asm_const_solid_nsurface ( s_output_ids, l_orient, i_param_method, s_surface_list, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

asm_const_surface_2curve

()

# # Purpose : This file provides an example of a call to the # function asm_const_surface_2curve() # # This function creates parametric bicubic surfa# ces from 2 set of curves. # # In this example a new database is opened and 2 # curves are drawn in XZ plane. Then this # function is called to create a surface between # the 2 curves. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_surface_2curve() # has the following arguments: # # asm_const_surface_2curve # ( output_ids, # curve1_list, # curve2_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_curve1_list[32] STRING s_curve2_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_line_2point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) @ @

Main Index

Chapter 3: Geometry Functions 471
Construct Actions

dump i_return_value # Display Surface Label i_return_value = surface_label(TRUE) dump i_return_value #--------------------------------------------------------------------# Create lines i_return_value = @ asm_const_line_2point @ ( "1", "[0 0 0]","[0 0 1]", 0,"",50., 1, @ sv_line_2point_created_ids ) dump i_return_value i_return_value = asm_const_line_2point ( "2", "[5 0 0]","[3 0 3]", 0,"",50., 1, sv_line_2point_created_ids ) dump i_return_value @ @ @

#--------------------------------------------------------------------# Create surface s_output_ids = "" s_curve1_list = "Curve 1" s_curve2_list = "Curve 2" i_return_value = asm_const_surface_2curve ( s_output_ids, s_curve1_list, s_curve2_list, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_line_2point_created_ids) #---------------------------------------------------------------------

asm_const_surface_3curve
# # # # # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_surface_3curve() This function creates parametric bicubic surfaces from 3 set of curves. In this example a new database is opened and 3 curves are drawn. Then this function is called to create a surface using the 3 curves. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_surface_3curve() has the following arguments: asm_const_surface_3curve ( output_ids, param_method, curve1_list, curve2_list,

Main Index

472 PCL Reference Manual Examples
Construct Actions

# curve3_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] INTEGER i_param_method STRING s_curve1_list[32] STRING s_curve2_list[32] STRING s_curve3_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_line_2point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value # Display Surface Label i_return_value = surface_label(TRUE) dump i_return_value #--------------------------------------------------------------------# Create lines i_return_value = @ asm_const_line_2point @ ( "1", "[0 0 0]","[1 0 0]", 0,"",50., 1, @ sv_line_2point_created_ids ) dump i_return_value i_return_value = asm_const_line_2point ( "2", "[0 5 5]","[3 5 5]", 0,"",50., 1, sv_line_2point_created_ids ) dump i_return_value @ @ @ @ @

i_return_value = @ asm_const_line_2point @ ( "3", "[0 3 10]","[1 3 10]",0,"",50., 1, @ sv_line_2point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create surface s_output_ids = "" i_param_method = 2 s_curve1_list = "Curve 1" s_curve2_list = "Curve 2" s_curve3_list = "Curve 3" i_return_value = asm_const_surface_3curve ( s_output_ids, i_param_method, s_curve1_list, s_curve2_list, s_curve3_list, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @ @

#---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 473
Construct Actions

# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_line_2point_created_ids) #---------------------------------------------------------------------

asm_const_surface_4curve

()

# # Purpose : This file provides an example of a call to the # function asm_const_surface_4curve() # # This function creates parametric bicubic surfa# ces from 4 set of curves. # # In this example a new database is opened and 4 # curves are drawn. Then this function is called # to create a surface using the 4 curves. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_surface_4curve() # has the following arguments: # # asm_const_surface_4curve # ( output_ids, # param_method, # curve1_list, # curve2_list, # curve3_list, # curve4_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] INTEGER i_param_method STRING s_curve1_list[32] STRING s_curve2_list[32] STRING s_curve3_list[32] STRING s_curve4_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_line_2point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value # Display Surface Label i_return_value = surface_label(TRUE) dump i_return_value #--------------------------------------------------------------------# Create lines i_return_value = @ asm_const_line_2point @ @ @

Main Index

474 PCL Reference Manual Examples
Construct Actions

"1", "[0 0 0]","[1 0 0]", 0,"",50., 1, sv_line_2point_created_ids ) dump i_return_value i_return_value = asm_const_line_2point ( "2", "[0 5 5]","[3 5 5]", 0,"",50., 1, sv_line_2point_created_ids ) dump i_return_value

(

@

@ @ @

i_return_value = @ asm_const_line_2point @ ( "3", "[0 3 10]","[1 3 10]",0,"",50., 1, @ sv_line_2point_created_ids ) dump i_return_value i_return_value = @ asm_const_line_2point @ ( "4", "[0 10 15]","[3 10 15]",0,"",50.,1,@ sv_line_2point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create surface s_output_ids = "" i_param_method = 2 s_curve1_list = "Curve 1" s_curve2_list = "Curve 2" s_curve3_list = "Curve 3" s_curve4_list = "Curve 4" i_return_value = asm_const_surface_4curve ( s_output_ids, i_param_method, s_curve1_list, s_curve2_list, s_curve3_list, s_curve4_list, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_line_2point_created_ids) #---------------------------------------------------------------------

asm_const_surface_ncurve
# # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_surface_ncurve() This function creates parametric bicubic surfaces from a specified set of curves. In this example a new database is opened and 4 curves are drawn. Then this function is called to create a surface using the 4 curves. Approximation of the generated surface is reported by Patran immediately after creation. This file can be run by starting a session of Patran, and running this session file

Main Index

Chapter 3: Geometry Functions 475
Construct Actions

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_surface_ncurve() # has the following arguments: # # asm_const_surface_ncurve # ( output_ids, # param_method, # curve_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] INTEGER i_param_method STRING s_curve_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_line_2point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value # Display Surface Label i_return_value = surface_label(TRUE) dump i_return_value #--------------------------------------------------------------------# Create lines i_return_value = @ asm_const_line_2point @ ( "#", "[0 0 0][0 5 5][0 3 10][0 10 15]", @ "[1 0 0][3 5 5][1 3 10][3 10 15]", 0,"",@ 50., 1, sv_line_2point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create surface s_output_ids = "" i_param_method = 2 s_curve_list = "Curve 1:4 " i_return_value = asm_const_surface_ncurve ( s_output_ids, i_param_method, s_curve_list, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_line_2point_created_ids) #---------------------------------------------------------------------

Main Index

476 PCL Reference Manual Examples
Construct Actions

asm_const_surface_3edge

()

# # Purpose : This file provides an example of a call to the # function asm_const_surface_3edge() # # This function creates parametric bicubic surfa# ces from 3 set of curves defining the boundary # of the surfaces. # # In this example a new database is opened and 3 # curves are drawn. Then this function is called # to create a surface with 3 curves as boundaries # for the surface. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_surface_3edge() # has the following arguments: # # asm_const_surface_3edge # ( output_ids, # curve1_list, # curve2_list, # curve3_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_curve1_list[32] STRING s_curve2_list[32] STRING s_curve3_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_line_2point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value # Display Surface Label i_return_value = surface_label(TRUE) dump i_return_value #--------------------------------------------------------------------# Create lines i_return_value = @ asm_const_line_2point @ ( "#", "[0 0 0][0 0 0][1 0 0]", @ "[1 0 0][0 0 1][0 0 1]", 0,"",50., 1, @ sv_line_2point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create surface s_output_ids = "" @ @

Main Index

Chapter 3: Geometry Functions 477
Construct Actions

s_curve1_list s_curve2_list s_curve3_list

= "Curve 1" = "Curve 2" = "Curve 3" @ @ @ @ @ @

i_return_value = asm_const_surface_3edge ( s_output_ids, s_curve1_list, s_curve2_list, s_curve3_list, sv_created_ids ) dump i_return_value dump sv_created_ids

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_line_2point_created_ids) #---------------------------------------------------------------------

asm_const_surface_4edge

()

# # Purpose : This file provides an example of a call to the # function asm_const_surface_4edge() # # This function creates parametric bicubic surfa# ces from 4 set of curves defining the boundary # of the surfaces. # # In this example a new database is opened and 4 # curves are drawn. Then this function is called # to create a surface with 4 curves as boundaries # for the surface. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_surface_4edge() # has the following arguments: # # asm_const_surface_4edge # ( output_ids, # curve1_list, # curve2_list, # curve3_list, # curve4_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_curve1_list[32] STRING s_curve2_list[32] STRING s_curve3_list[32] STRING s_curve4_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_line_2point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002

Main Index

478 PCL Reference Manual Examples
Construct Actions

# Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value # Display Surface Label i_return_value = surface_label(TRUE) dump i_return_value

@ @

#--------------------------------------------------------------------# Create lines i_return_value = @ asm_const_line_2point @ ( "#", "[0 0 0][1 0 0][1 0 1][0 0 1]", @ "[1 0 0][1 0 1][0 0 1][0 0 0]", @ 0,"",50., 1, sv_line_2point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create surface s_output_ids = "" s_curve1_list = "Curve 1" s_curve2_list = "Curve 2" s_curve3_list = "Curve 3" s_curve4_list = "Curve 4" i_return_value = asm_const_surface_4edge ( s_output_ids, s_curve1_list, s_curve2_list, s_curve3_list, s_curve4_list, sv_created_ids ) dump i_return_value dump sv_created_ids @ @ @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_line_2point_created_ids) #---------------------------------------------------------------------

asm_const_surface_extract
# # # # # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_surface_extract() This function creates parametric bicubic surfaces by extracting a surface from a solid at a specified parametric position and in a specified parametric direction. In this example a new database is opened and a cube of 1 unit is created. Then this function is called to create a surface along u-plane at the midpoint of the edge by extraction from cube. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function asm_const_surface_extract()

Main Index

Chapter 3: Geometry Functions 479
Construct Actions

# has the following arguments: # # asm_const_surface_extract # ( output_ids, # solid_list, # param_plane, # param_pos, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_solid_list[32] INTEGER i_param_plane REAL r_param_pos STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_create_hpat_xyz_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value # Display Surface Label i_return_value = surface_label(TRUE) dump i_return_value #--------------------------------------------------------------------# Create Cube of 1 X 1 X 1 i_return_value = @ asm_const_hpat_xyz @ ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", @ sv_create_hpat_xyz_created_ids ) #--------------------------------------------------------------------# Create Surface s_output_ids s_solid_list i_param_plane r_param_pos = = = = "" "Solid 1" 1 0.5 @ @ @ @ @ @ @ @

i_return_value = asm_const_surface_extract ( s_output_ids, s_solid_list, i_param_plane, r_param_pos, sv_created_ids ) dump i_return_value dump sv_created_ids

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_create_hpat_xyz_created_ids) #---------------------------------------------------------------------

Main Index

480 PCL Reference Manual Examples
Construct Actions

asm_const_surface_extract_face

()

# # Purpose : This file provides an example of a call to the # function asm_const_surface_extract_face() # # This function creates parametric bicubic surf# ace by extracting a surface from a face of a # solid # # In this example a new database is opened and a # cube of 1 unit is created. Then this function # is called to create a surface by extracting the # top-surface ("Solid 1.4") using this function. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_surface_extract_face() # has the following arguments: # # asm_const_surface_extract_face # ( output_ids, # face_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_face_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_create_hpat_xyz_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value # Display Surface Label i_return_value = surface_label(TRUE) dump i_return_value #--------------------------------------------------------------------# Create Cube of 1 X 1 X 1 i_return_value = @ asm_const_hpat_xyz @ ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", @ sv_create_hpat_xyz_created_ids ) #--------------------------------------------------------------------# Create Surface s_output_ids s_face_list = "" = "Solid 1.4" @ @ @ @ @

i_return_value = asm_const_surface_extract_face ( s_output_ids,

Main Index

Chapter 3: Geometry Functions 481
Construct Actions

s_face_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_create_hpat_xyz_created_ids) #---------------------------------------------------------------------

asm_const_surface_extrude

()

# # Purpose : This file provides an example of a call to the # function asm_const_surface_extrude() # # This function creates parametric bicubic # surfaces by moving curves through space along # a defined axis with the option of # simultaneously scaling and rotating the # extruded surfaces. # # In this example a new database is opened and a # line is drawn from [0 0 0] to [0 0 1]. Then a # surface is created using this function, by # extrusion of "Curve 1" along vector <10 0 0>. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_surface_extrude() # has the following arguments: # # asm_const_surface_extrude # ( output_ids, # delta, # scale, # angle, # origin, # coord_frame, # num_surfaces, # curve_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_delta[32] REAL r_scale REAL r_angle STRING s_origin[32] STRING s_coord_frame[32] INTEGER i_num_surfaces STRING s_curve_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_point_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = @

Main Index

482 PCL Reference Manual Examples
Construct Actions

ga_view_aa_set ( 23., -34., 0. ) dump i_return_value # Display Surface Label surface_label(TRUE)

@

#--------------------------------------------------------------------# Create Curve from [0 0 0] to [0 0 1] i_return_value = @ asm_const_line_2point @ ( "1","[0 0 0]","[0 0 1]",0,"",50.,1, @ sv_point_ids ) dump i_return_value #--------------------------------------------------------------------# Create Surface by extrusion of "Curve 1" s_output_ids s_delta r_scale r_angle s_origin s_coord_frame i_num_surfaces s_curve_list = = = = = = = = "" "<10 0 0>" 1 0.0 "[0 0 0]" "Coord 0" 1 "Curve 1 " @ @ @ @ @ @ @ @ @ @

i_return_value = asm_const_surface_extrude ( s_output_ids, s_delta, r_scale, r_angle, s_origin, s_coord_frame, i_num_surfaces, s_curve_list, sv_created_ids ) dump i_return_value

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_point_ids) #---------------------------------------------------------------------

asm_const_surface_glide
# # # # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_surface_glide() This function creates parametric bicubic surfaces by moving base curves along a path defined by a set of director curves translated to the origin of the base curves. In this example a new database is opened and a base curve is drawn form [0 0 0] to [1 0 0]. 2 director curves are then drawn. And this function is called to create surfaces by gliding the "Curve 1" along the director curves "Curve 2" and "Curve 3". This file can be run by starting a session of Patran, and running this session file

Main Index

Chapter 3: Geometry Functions 483
Construct Actions

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_surface_glide() # has the following arguments: # # asm_const_surface_glide # ( output_ids, # scale, # glide_option, # director_curve, # basic_curve, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] REAL r_scale INTEGER i_glide_option STRING s_director_curve[32] STRING s_basic_curve[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_create_line_xyz_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value # Display Surface Label surface_label(TRUE) #--------------------------------------------------------------------# Create base curve i_return_value = @ asm_const_line_xyz @ ( "", "<1 0 0>", "[0 0 0]", "Coord 0", @ sv_create_line_xyz_created_ids ) dump i_return_value # Create director curve i_return_value = asm_const_line_2point ( "2", "[0 0 0]", "[0 5 5]", 0, "", 50., 1, sv_create_line_xyz_created_ids ) dump i_return_value @ @ @ @ @

i_return_value = @ asm_const_line_2point @ ( "3", "[0 5 5]", "[0 0 10]", 0, "", 50., @ 1, sv_create_line_xyz_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create Surfaces s_output_ids = "" r_scale = 1.0 i_glide_option = 0 s_director_curve = "Curve 2 3 " s_basic_curve = "Curve 1 " i_return_value = @

Main Index

484 PCL Reference Manual Examples
Construct Actions

asm_const_surface_glide ( s_output_ids, r_scale, i_glide_option, s_director_curve, s_basic_curve, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_create_line_xyz_created_ids) #---------------------------------------------------------------------

asm_const_surface_normal

()

# # Purpose : This file provides an example of a call to the # function asm_const_surface_normal() # # This function creates parametric bicubic surf# aces defined by a set of base curves and an # offset from those curves in the direction of # the curvature . The offset may be constant or # a linear taper. # # In this example a new database is opened and a # line is drawn form [0 0 0] to [10 0 0]. Then # surfaces of varying thickness are created using # this function using the initially created curve # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_surface_normal() # has the following arguments: # # asm_const_surface_normal # ( output_ids, # thickness1, # thickness2, # origin, # num_surfaces, # normal_rev_direction, # curve_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_thickness1[32] STRING s_thickness2[32] STRING s_origin[32] INTEGER i_num_surfaces LOGICAL l_normal_rev_direction STRING s_curve_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_point_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" )

Main Index

Chapter 3: Geometry Functions 485
Construct Actions

$? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value # Display Surface Label surface_label(TRUE) #--------------------------------------------------------------------# Create Curve from [0 0 0] to [10 0 0] i_return_value = @ asm_const_line_2point @ ( "1","[0 0 0]","[10 0 0]",0,"",50.,1, @ sv_point_ids ) dump i_return_value #--------------------------------------------------------------------# Create surfaces s_output_ids s_thickness1 s_thickness2 s_origin i_num_surfaces l_normal_rev_direction s_curve_list = = = = = = = "1" "1.0" "5.0" "" 3 TRUE "Curve 1 " @ @ @ @ @ @ @ @ @ @ @

i_return_value = asm_const_surface_normal ( s_output_ids, s_thickness1, s_thickness2, s_origin, i_num_surfaces, l_normal_rev_direction, s_curve_list, sv_created_ids ) dump i_return_value dump sv_created_ids

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_point_ids) #---------------------------------------------------------------------

asm_const_surface_revolve
# # # # # # # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function asm_const_surface_revolve() This function creates parametric bicubic surfaces by revolving a curve about an axis of rotation. In this example a new database is opened and a line is drawn form [0 0 0] to [1 0 0]. Then a set of 4 surfaces are created by revolving this curve along Z-axis for 45 degrees. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown

Main Index

486 PCL Reference Manual Examples
Construct Actions

# menus on the menu bar. # # The function asm_const_surface_revolve() # has the following arguments: # # asm_const_surface_revolve # ( output_ids, # axis, # angle, # offset, # coord_frame, # num_surfaces, # curve_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_axis[32] REAL r_angle REAL r_offset STRING s_coord_frame[32] INTEGER i_num_surfaces STRING s_curve_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_point_ids[VIRTUAL] STRING sv_line_2point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value # Display Surface Label surface_label(TRUE) #--------------------------------------------------------------------# Create Curve i_return_value = @ asm_const_line_2point @ ( "1","[0 0 0]","[1 0 0]",0,"",50., 1, @ sv_line_2point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create Surface s_output_ids s_axis r_angle r_offset s_coord_frame i_num_surfaces s_curve_list = = = = = = = "1" "Coord 0.3" 45.0 0. "Coord 0" 4 "Curve 1 " @ @ @ @ @ @ @ @ @

i_return_value = asm_const_surface_revolve ( s_output_ids, s_axis, r_angle, r_offset, s_coord_frame,

Main Index

Chapter 3: Geometry Functions 487
Construct Actions

i_num_surfaces, s_curve_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_point_ids) sys_free_string( sv_line_2point_created_ids) #---------------------------------------------------------------------

asm_const_surface_vertex

()

# # Purpose : This file provides an example of a call to the # function asm_const_surface_vertex() # # This function creates parametric bicubic surfa# ces which is the quadrilateral formed by four # vertex points. # # In this example a new database is opened and 4 # points are created on the XZ plane. Then this # function is called to create a surface using # the 4 vertex. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function asm_const_surface_vertex() # has the following arguments: # # asm_const_surface_vertex # ( output_ids, # point1_list, # point2_list, # point3_list, # point4_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_point1_list[32] STRING s_point2_list[32] STRING s_point3_list[32] STRING s_point4_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_create_grid_xyz_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value # Display Surface Label surface_label(TRUE) @ @

Main Index

488 PCL Reference Manual Examples
Construct Actions

#--------------------------------------------------------------------# Create Points i_return_value = @ asm_const_grid_xyz @ ( "1", "[0 0 0]", "Coord 0", @ sv_create_grid_xyz_created_ids ) dump i_return_value i_return_value = asm_const_grid_xyz ( "2", "[5 0 0]", "Coord 0", sv_create_grid_xyz_created_ids ) dump i_return_value i_return_value = asm_const_grid_xyz ( "3", "[5 0 7]", "Coord 0", sv_create_grid_xyz_created_ids ) dump i_return_value i_return_value = asm_const_grid_xyz ( "4", "[0 0 5]", "Coord 0", sv_create_grid_xyz_created_ids ) dump i_return_value @ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Create Surface s_output_ids s_point1_list s_point2_list s_point3_list s_point4_list = = = = = "" "Point "Point "Point "Point 1" 2" 3" 4" @ @ @ @ @ @ @

i_return_value = asm_const_surface_vertex ( s_output_ids, s_point1_list, s_point2_list, s_point3_list, s_point4_list, sv_created_ids ) dump i_return_value dump sv_created_ids

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_create_grid_xyz_created_ids) #---------------------------------------------------------------------

sgm_const_curve_2d_arc3point_v1
# # # # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function sgm_const_curve_2d_arc3point_v1() This session file will create a new database by name ’new.db’ and call the above mentioned function and create two curves. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown

Main Index

Chapter 3: Geometry Functions 489
Construct Actions

# menus on the menu bar. # # The function sgm_const_curve_2d_arc3point_v1() # has the following arguments: # # sgm_const_curve_2d_arc3point_v1 # ( output_ids, # create_center, # plane_list, # start_list, # mid_list, # end_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] LOGICAL l_create_center STRING s_plane_list[16] STRING s_start_list[16] STRING s_mid_list[16] STRING s_end_list[16] 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) #--------------------------------------------------------------------# Creating two curves with the center points in X-Y plane. s_output_ids = "#" l_create_center = TRUE s_plane_list = "Coord 0.3" s_start_list = "[1 1 0] [2 2 0]" s_mid_list = "[1 4 1]" s_end_list = "[3 3 0]" # i_return_value = @ sgm_const_curve_2d_arc3point_v1 @ ( s_output_ids, @ l_create_center, @ s_plane_list, @ s_start_list, @ s_mid_list, @ s_end_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

sgm_const_curve_2d_arc3point_v2
# # # # # # # # #

()

Purpose

:

This file provides an example of a call to the function sgm_const_curve_2d_arc3point_v2() This session file will create a new database by name ’new.db’ and call the above mentioned function and create two curves. This file can be run by starting a session of

Main Index

490 PCL Reference Manual Examples
Construct Actions

# Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_const_curve_2d_arc3point_v2() # has the following arguments: # # sgm_const_curve_2d_arc3point_v2 # ( output_ids, # create_center, # plane_list, # start_list, # mid_list, # end_list, # project_flag, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] 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 #--------------------------------------------------------------------# Enabling the curve and point labeling. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating two curves with the center points in parallel to X-Y plane # and passing through start points. s_output_ids = "#" l_create_center = TRUE s_plane_list = "Coord 0.3" s_start_list = "[0 0 1] [0 0 2]" s_mid_list = "[1 4 1]" s_end_list = "[3 3 0]" # i_return_value = @ sgm_const_curve_2d_arc3point_v2 @ ( s_output_ids, @ 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) #---------------------------------------------------------------------

sgm_const_curve_arc3point
# # #

()

Purpose

:

This file provides an example of a call to the function sgm_const_curve_arc3point()

Main Index

Chapter 3: Geometry Functions 491
Construct Actions

# # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create two curves in 3D space. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_const_curve_arc3point() # has the following arguments: # # sgm_const_curve_arc3point # ( output_ids, # create_center, # start_list, # mid_list, # end_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] LOGICAL l_create_center STRING s_start_list[32] STRING s_mid_list[32] STRING s_end_list[32] 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) #--------------------------------------------------------------------# Creating two curves in 3D space. s_output_ids = "#" l_create_center = TRUE s_start_list = "[0 0 0] [1 1 0]" s_mid_list = "[-1 -2 0] [1 2 0]" s_end_list = "[-1 1 3] [1 -1 -4]" # i_return_value = @ sgm_const_curve_arc3point @ ( s_output_ids, @ l_create_center, @ s_start_list, @ s_mid_list, @ s_end_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

sgm_const_curve_bspline
# # # # #

()

Purpose

:

This file provides an example of a call to the function sgm_const_curve_bspline() This session file will create a new database by

Main Index

492 PCL Reference Manual Examples
Construct Actions

# name ’new.db’ and call the above mentioned # function and create a bspline closed curve. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_const_curve_bspline() # has the following arguments: # # sgm_const_curve_bspline # ( output_ids, # point_list, # order, # interpolate, # param_method, # closed, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_point_list[32] INTEGER i_order LOGICAL l_interpolate INTEGER i_param_method LOGICAL l_closed 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) #--------------------------------------------------------------------# Creating a fourth order open piecewise cubic curve. s_output_ids = "#" s_point_list = "[0 0 0][1 1 1][-1 .5 1][0 1 1]" i_order = 4 i_param_method = 2 # i_return_value = @ sgm_const_curve_bspline @ ( s_output_ids, @ s_point_list, @ i_order, @ l_interpolate, @ i_param_method, @ l_closed, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

sgm_const_curve_extract
# # # # #

()

Purpose

:

This file provides an example of a call to the function sgm_const_curve_extract() This session file will create a new database by

Main Index

Chapter 3: Geometry Functions 493
Construct Actions

# name ’new.db’ and create a surface. The above # mentioned function will be called to create a # curve on the surface. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_const_curve_extract() # has the following arguments: # # sgm_const_curve_extract # ( output_ids, # surface_list, # direction, # param_pos, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_surface_list[16] INTEGER i_direction REAL r_param_pos STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# 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) #--------------------------------------------------------------------# Creating a surface. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating a curve on surface along constant C1 direction. s_output_ids = "#" s_surface_list = "Surface 1" i_direction = 1 r_param_pos = 0.4 # i_return_value = @ sgm_const_curve_extract @ ( s_output_ids, @ s_surface_list, @ i_direction, @ r_param_pos, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_crtd_ids) #---------------------------------------------------------------------

sgm_const_curve_extract_edge
# #

()

Purpose

:

This file provides an example of a call to the

Main Index

494 PCL Reference Manual Examples
Construct Actions

# function sgm_const_curve_extract_edge() # # This session file will create a new database by # name ’new.db’ and create a surface. The above # mentioned function will be called to create # curves on the surface edges. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_const_curve_extract_edge() # has the following arguments: # # sgm_const_curve_extract_edge # ( output_ids, # edge_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_edge_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] #--------------------------------------------------------------------# 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) #--------------------------------------------------------------------# Creating a surface. i_return_value = @ asm_const_patch_xyz( "1", "<1 1 0>","[0 0 0]",@ "Coord 0", sv_asm_create_patch_xy_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating curves on two edges of the surface. s_output_ids = "#" s_edge_list = "Surface 1.1 1.3" # i_return_value = @ sgm_const_curve_extract_edge @ ( s_output_ids, @ s_edge_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_crtd_ids) #---------------------------------------------------------------------

sgm_const_curve_loft
# # # # # # #

()

Purpose

:

This file provides an example of a call to the function sgm_const_curve_loft() This session file will create a new database by name ’new.db’ and call the above mentioned function and create a curve based on end slopes

Main Index

Chapter 3: Geometry Functions 495
Construct Actions

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_const_curve_loft() # has the following arguments: # # sgm_const_curve_loft # ( output_ids, # slope_control, # point_list, # slope_list1, # slope_list2, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] LOGICAL l_slope_control STRING s_point_list[64] STRING s_slope_list1[16] STRING s_slope_list2[16] 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) #--------------------------------------------------------------------# Setting view to Isometric View 2. i_return_value = ga_view_aa_set(23., 56., 0) dump i_return_value #--------------------------------------------------------------------# Creating a curve passing through four points. Curve is also # constrained by end slopes. s_output_ids = "#" l_slope_control = TRUE s_point_list = "[0 0 0] [2.5 1 0] [2.3 .6 0] [3 1 1]" s_slope_list1 = "<1 4 0.5>" s_slope_list2 = "<1 -1.5 0>" # i_return_value = @ sgm_const_curve_loft @ ( s_output_ids, @ l_slope_control, @ s_point_list, @ s_slope_list1, @ s_slope_list2, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

sgm_const_curve_revolve
# # # #

()

Purpose

:

This file provides an example of a call to the function sgm_const_curve_revolve()

Main Index

496 PCL Reference Manual Examples
Construct Actions

# This session file will create a new database