Patran 2008 R1 Pcl Reference Manual Volume 2: Code Examples

  • Uploaded by: Kevin
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Patran 2008 R1 Pcl Reference Manual Volume 2: Code Examples as PDF for free.

More details

  • Words: 298,990
  • Pages: 1,434
Patran 2008 r1 PCL Reference Manual Volume 2: Code Examples

Main Index

Corporate

Europe

Asia Pacific

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

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

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

m`i=oÉÑÉêÉåÅÉ=j~ bñ~ãéäÉëI===

1

Introduction Introduction

2

Supporting Files

2

Basic Functions Introduction File Menu

8 9

Group Menu

47

Viewport Menu

81

Viewing Menu

127

Display Menu

175

Tools Menu

3

3

293

Geometry Functions Introduction

380

Construct Actions

381

Disassemble Actions

4

Finite Element Functions Introduction

710

Create Action

711

Transform Action Sweep Action

Main Index

589

745 754

iv PCL Reference Manual Examples ==

Renumber Action

779

Disassociate Action

782

Equivalence Action

785

Optimize Action Verify Action

802

Show Action

882

Modify Action

885

Delete Action

905

Utilities

5

800

914

Property Assignment Functions Introduction

926

Loads and Boundary Conditions Element Properties Beam Library Materials

6

937

946

953

Load Cases Fields

927

964

969

Results Postprocessing Functions Introduction

988

Results Utility Functions

989

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

1025 1047 1062

Plot Tool Creation and Modification Functions Plot Tool Manipulation Functions

Main Index

1087

1066

CONTENTS v

Animation Functions

1099

Plot Tool Query Functions

7

XY Plot Functions Introduction Create Action Post Action Modify Action

1134 1135 1162 1172

Rename Action Delete Action

8

1117

1346 1347

Preference Functions Introduction

1352

Analysis Preferences Global Preferences Graphics Preferences Report Preferences Geometry Preferences

1353 1355 1373 1417 1421

Finite Element Preferences

Main Index

1424

vi PCL Reference Manual Examples ==

Main Index

Chapter 1: Introduction PCL Reference Manual Examples

1

Main Index

Introduction 

Introduction



Supporting Files

1 3

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:

Main Index

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.

Geometry Functions

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.

Finite Element Functions

This chapter provides examples for the functions that are used in the implementation of the “Finite Elements” switch bar form.

Property Assignment Functions

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.

Results Postprocessing Functions

This chapter provides examples for the functions that are used by the “Results” switch bar form.

XY Plot Functions

This chapter provides examples for the functions that are used in the implementation of the “XY Plot” switch bar form.

Preference Functions

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.

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

Main Index

Basic Functions 

Introduction



File Menu



Group Menu



Viewport Menu

81



Viewing Menu

127



Display Menu

175



Tools Menu

8 9 47

293

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

Main Index

= = = =

"plate_neutral.out" "File created by exporting Patran database" FALSE 1

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 # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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 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.

Patran,

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

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 # # # # # # # # # # # # # # # # # # # # # #

Main Index

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’. 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.

Patran,

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

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 # # # # # # # # # # # # # # # #

Main Index

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. 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.

Patran,

The function p3_express_import_exit()

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 # # # # # # # # #

Main Index

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.

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

"\n" )

fio_close( fid ) END FUNCTION

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

"\n" )

fio_close( fid ) END FUNCTION

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 # #

Main Index

Purpose

:

This file provides an example of a call to the

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 # # # # #

Main Index

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

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 # # # # # # # # # # # # # # #

Main Index

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.

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 # # # # # # # # # # # # # # # # # # #

Main Index

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

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 # # # # # # # # # # # # # # #

Main Index

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()

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 # # # # # # # # #

Main Index

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.

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 # # #

Main Index

Purpose

:

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

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 # # # # # # # # #

Main Index

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

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 # # # # # # #

Main Index

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.

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()

Main Index

# 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"] )

@ @

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 # # # # #

Main Index

Purpose

:

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

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 # # # # # # # # #

Main Index

Purpose

:

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

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 #

Main Index

Get the list of groups

@

@ @ @

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 # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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,

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 # # # # # # # # # # # # #

Main Index

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.

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 # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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,

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 #

Main Index

Free allocated memory

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 # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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()

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 # # # # # #

Main Index

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.

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) # #

Main Index

It can be found that list showing "Point 1:8 Solid 1" after the creation of the solid

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() #

Main Index

Delete the newly created viewport.

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

Main Index

@ @ @

# 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 )

@ @ @

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 # # # # # # # # # # # # # # #

Main Index

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()

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 # # # # # # #

Main Index

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

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 # # # # #

Main Index

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

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 #

Main Index

@ @ @

Get the posted lights.

@ @ @

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 # # # # # # # # # # # # # # # # # # #

Main Index

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()

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 # # # # # # # #

Main Index

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

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 # # # # # # # #

Main Index

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

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 # # # # # #

Main Index

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

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 # # # # # # # # # # # #

Main Index

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

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 # # # #

Main Index

Purpose

:

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

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 #

Main Index

Get the spectrum status.

@ @ @

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 # # # # #

Main Index

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

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 # # # # # # # #

Main Index

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

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 # # # # # # # # # # # # # # # # # # # # # #

Main Index

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 )

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 # # # # # # # # # # # # # # # # # # # # # #

Main Index

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

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 # # # # # # # # # # # # # # # # #

Main Index

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.

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 # # # # # # # # # #

Main Index

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

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 # # # #

Main Index

Purpose

:

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

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 # # # # # # # # # # # # # # # #

Main Index

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

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 # # # #

Main Index

Purpose

:

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

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 # # # # # # # # # # # # # # # # # # # # # #

Main Index

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,

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 # # # # # # # # # # # # #

Main Index

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

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 # # # # #

Main Index

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

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 # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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 )

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 # # # # #

Main Index

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

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 # # # # # # # # # # # # # # # # # # #

Main Index

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:

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 # # # # # # # # # #

Main Index

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.

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 # # # # # # # # # #

Main Index

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.

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 #

Main Index

Get the diffuse reflectance value.

@ @ @

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 # #

Main Index

Purpose

:

This file provides an example of two calls

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 # # # # # # # #

Main Index

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.

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 # # #

Main Index

Purpose

:

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

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 # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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 )

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 # #

Main Index

Purpose

:

This file provides an example of a call

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 ) #

Main Index

s_display_name = "general"

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 # # # # # # #

Main Index

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

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 # # # # # # # # # # # # # # # #

Main Index

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()

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 # # # # # # #

Main Index

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

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 # # # # # # # # #

Main Index

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.

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 # # # # # # # # #

Main Index

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.

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 # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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

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 # # # #

Main Index

Purpose

:

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

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 # # # # # # # # # # # # #

Main Index

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.

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 # # # # # # # #

Main Index

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

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 # # # # # # # #

Main Index

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.

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 # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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 )

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 # # # # # # # #

Main Index

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.

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 #

Main Index

@ @ @

Get the color for display of undeformed entities.

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 # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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 )

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 # # # # # # # # # # # # # # # # #

Main Index

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

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 #

Main Index

@ @ @

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

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 # # # # # # # # # # # # # # # # # # #

Main Index

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.

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 # # # # # # # # #

Main Index

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.

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 # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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:

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 # # # # # # # # # # # # #

Main Index

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.

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 # # #

Main Index

Purpose

:

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

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 # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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()

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 # # # #

Main Index

Purpose

:

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

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 # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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

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

Main Index

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

@ @

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 # #

Main Index

Purpose

:

This file provides an example of a call to the

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

Main Index

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 =

@

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 # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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.

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 =

Main Index

= = = = = = =

0 4.762E-05 8.844E-05 "range" 4.9999999E-10 "default_group" "lista" @

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 #

Main Index

Set ISO-1 viewing

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 # # # #

Main Index

Purpose

:

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

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

Main Index

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,

@ @

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 # # # # # # # # # # #

Main Index

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".

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)

Main Index

= = = =

1 "NEW_DISP" 2 "Point"

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 # # # # # # #

Main Index

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.

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 #

Main Index

Set ISO-1 viewing

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 # # # # # # # #

Main Index

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

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

Main Index

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,

@ @ @ @

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 # # # # # # # # # # # #

Main Index

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

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 # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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 )

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 # # # # # # # # # #

Main Index

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"

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 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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,

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 # #

Main Index

Purpose

:

This file provides an example of a call to the

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 #

Main Index

Set ISO-1 viewing

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 # # # # # # # # # # # # # #

Main Index

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".

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 # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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".

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 # # # # # # # # # #

Main Index

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

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 # # # # # # # # # # # # # # # # # # # #

Main Index

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:

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 # # # #

Main Index

Purpose

:

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

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 # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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,

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 #

Main Index

Set ISO-1 viewing

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 # # # # # # # # # # # # # #

Main Index

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

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 # #

Main Index

Purpose

:

This file provides an example of 2 calls to the

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 # # #

Main Index

Purpose

:

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

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 # # # # # # # # # # # # # # # # # #

Main Index

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

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

Main Index

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

@ @

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 # # # # # # # # # # #

Main Index

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"

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 #

Main Index

Replace contents of "listb" by "listc"

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

Main Index

Geometry Functions 

Introduction



Construct Actions



Disassemble Actions



Associate Actions



Disassociate Actions



Sweep Actions



Transform Actions



Edit Actions



Delete Actions

380 381

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 # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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,

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 # # # # # # # # # # # # # # # # # # # #

Main Index

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,

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 # # # # # # # # # # # # #

Main Index

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.

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 # # # # # # # # #

Main Index

Purpose

:

() 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.

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 # # # # # # # # # # #

Main Index

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

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 # # # # # # # # # # # # # # #

Main Index

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()

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 # # # # # # # # # # # # # # # # # # # # #

Main Index

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,

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 # # # # # # # # # # # # # #

Main Index

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.

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 # # # # # # # # # # # # # # #

Main Index

Purpose

:

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.

The function asm_const_grid_extract()

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 # # # # # # # # # # # # #

Main Index

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.

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 # # # # # #

Main Index

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

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 # # # # # # # # # # # # # # # # # # # # # #

Main Index

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 )

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 # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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,

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 # # # # # # # # # # # # # #

Main Index

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()

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 # # # # # # # # # # # # # #

Main Index

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()

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 # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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 )

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 # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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,

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 # # # # #

Main Index

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

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 # # # # #

Main Index

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

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 # # # # # # # # # # # # #

Main Index

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.

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 # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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 )

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 # # # # # # # # # # # # # # # #

Main Index

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:

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 # # # # # # # # #

Main Index

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.

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 #

Main Index

Create two curves in the xz plane.

@ @ @

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 # # # # # # # # # # #

Main Index

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

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

Main Index

0.5>",

@ @ @

@ @ @

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

@ @ @

0.5>",

@ @ @

0.5>",

@ @ @

# 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

@ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

()

asm_const_solid_4surface # # # # # # # # # # # # # # # # # # # #

Main Index

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,

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,

Main Index

@ @ @

@ @ @

1" 2" 3" 4" @ @ @ @ @

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 # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

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,

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 # # # # # # # # # # # # # # #

Main Index

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

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 # # # # # # # # # # # # # # # # # # # # #

Main Index

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()

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 # # # # # # # # # # # # # # # # # #

Main Index

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

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 # # # # # # # # # # # # # # # #

Main Index

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

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 # # # # # # # # # # #

Main Index

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

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 # # # # # # # # #

Main Index

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

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 # # #

Main Index

Purpose

:

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

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 # # # # #

Main Index

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

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 # # # # #

Main Index

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

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 # #

Main Index

Purpose

:

()

This file provides an example of a call to the

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 # # # # # # #

Main Index

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

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 # # # #

Main Index

Purpose

:

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

496 PCL Reference Manual Examples Construct Actions

# 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 sgm_const_curve_revolve() # has the following arguments: # # sgm_const_curve_revolve # ( output_ids, # axis, # angle, # offset, # coord_frame, # 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] 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. s_output_ids = "#" s_axis = "Coord 0.3" r_angle = 120 r_offset = 10.0 s_coord_frame = "Coord 0" s_point = "[0 1 0] [0 2 2] [0 3 3]" # i_return_value = @ sgm_const_curve_revolve @ ( s_output_ids, @ s_axis, @ r_angle, @ r_offset, @ s_coord_frame, @ s_point, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

sgm_const_surface_3edge #

Main Index

()

Chapter 3: Geometry Functions 497 Construct Actions

# Purpose : This file provides an example of a call to the # function sgm_const_surface_3edge() # # This function creates bi-parametric surfaces # 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 sgm_const_surface_3edge() # has the following arguments: # # sgm_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 = "" s_curve1_list = "Curve 1" s_curve2_list = "Curve 2" s_curve3_list = "Curve 3" i_return_value =

Main Index

@

498 PCL Reference Manual Examples Construct Actions

sgm_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) #---------------------------------------------------------------------

sgm_const_surface_3edge_man

()

# # Purpose : This file provides an example of a call to the # function sgm_const_surface_3edge_man() # # This function creates manifold surfaces from # 3 set of curves defining the boundary of the # parametric or generalized coons surfaces. # # In this example a new database is opened and a # inclined surface is drawn using 2 curves. Then # 3 curves, for acting as edges are drawn. Then # this function is called to create a manifold # surface over "Surface 1". # # This file can be run 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_surface_3edge_man() # has the following arguments: # # sgm_const_surface_3edge_man # ( output_ids, # curve1_list, # curve2_list, # curve3_list, # surface_list, # cubic, # 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_surface_list[32] LOGICAL l_cubic STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_line_2point_created_ids[VIRTUAL] STRING sv_surface_2curve_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 # Set ISO-1 viewing i_return_value =

Main Index

@

Chapter 3: Geometry Functions 499 Construct Actions

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 Manifold surface i_return_value = @ asm_const_line_2point @ ( "#","[0 0 0][0 -2 2]","[2 0 0][2 -2 2]",@ 0,"",50., 1, sv_line_2point_created_ids ) dump i_return_value i_return_value = sgm_const_surface_2curve ( "", "Curve 1 ", "Curve 2 ", sv_surface_2curve_created_ids ) 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 = "" s_curve1_list = "Curve 3" s_curve2_list = "Curve 4" s_curve3_list = "Curve 5" s_surface_list = "Surface 1" l_cubic = TRUE i_return_value = sgm_const_surface_3edge_man ( s_output_ids, s_curve1_list, s_curve2_list, s_curve3_list, s_surface_list, l_cubic, 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) sys_free_string( sv_surface_2curve_created_ids) #---------------------------------------------------------------------

()

sgm_const_surface_4edge # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_const_surface_4edge() This function creates bi-parametric surfaces from 4 set of curves defining the boundary

500 PCL Reference Manual Examples Construct Actions

# 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 sgm_const_surface_4edge() # has the following arguments: # # sgm_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 # 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 = sgm_const_surface_4edge ( s_output_ids,

Main Index

@ @ @

Chapter 3: Geometry Functions 501 Construct Actions

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) #---------------------------------------------------------------------

sgm_const_surface_4edge_man

()

# # Purpose : This file provides an example of a call to the # function sgm_const_surface_4edge_man() # # This function creates manifold surfaces from # 4 set of curves defining the boundary of the # parametric or generalized coons surfaces. # # In this example a new database is opened and a # surface is drawn using 2 curves. Then 4 curves # are drawn for acting as edges. Then this # function is called to create a manifold surface # over "Surface 1". # # This file can be run 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_surface_4edge_man() # has the following arguments: # # sgm_const_surface_4edge_man # ( output_ids, # curve1_list, # curve2_list, # curve3_list, # curve4_list, # surface_list, # cubic, # 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 s_surface_list[32] LOGICAL l_cubic STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_line_2point_created_ids[VIRTUAL] STRING sv_surface_2curve_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002 #

Main Index

Set ISO-1 viewing

502 PCL Reference Manual Examples Construct Actions

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 surface i_return_value = @ asm_const_line_2point @ ( "#","[0 0 0][0 -2 2]","[2 0 0][2 -2 2]",@ 0,"",50., 1, sv_line_2point_created_ids ) dump i_return_value i_return_value = sgm_const_surface_2curve ( "", "Curve 1 ", "Curve 2 ", sv_surface_2curve_created_ids ) 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 Manifold surface s_output_ids = "" s_curve1_list = "Curve 3" s_curve2_list = "Curve 4" s_curve3_list = "Curve 5" s_curve4_list = "Curve 6" s_surface_list = "Surface 1" l_cubic = TRUE i_return_value = sgm_const_surface_4edge_man ( s_output_ids, s_curve1_list, s_curve2_list, s_curve3_list, s_curve4_list, s_surface_list, l_cubic, 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) sys_free_string( sv_surface_2curve_created_ids) #---------------------------------------------------------------------

sgm_const_surface_extract_face # # #

Main Index

Purpose

:

()

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

Chapter 3: Geometry Functions 503 Construct Actions

# # This function creates parametric surface # 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 sgm_const_surface_extract_face() # has the following arguments: # # sgm_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 surface_label(TRUE) #--------------------------------------------------------------------# 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 = sgm_const_surface_extract_face ( s_output_ids, s_face_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @

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

Main Index

504 PCL Reference Manual Examples Construct Actions

sys_free_string( sv_create_hpat_xyz_created_ids) #---------------------------------------------------------------------

sgm_const_surface_extrude

()

# # Purpose : This file provides an example of a call to the # function sgm_const_surface_extrude() # # This function creates bi-parametric 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 sgm_const_surface_extrude() # has the following arguments: # # sgm_const_surface_extrude # ( output_ids, # delta, # scale, # angle, # origin, # coord_frame, # 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] 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 = 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 @

Main Index

Chapter 3: Geometry Functions 505 Construct Actions

(

"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 s_curve_list

= = = = = = =

"" "<10 0 0>" 1 0.0 "[0 0 0]" "Coord 0" "Curve 1 "

i_return_value = sgm_const_surface_extrude ( s_output_ids, s_delta, r_scale, r_angle, s_origin, s_coord_frame, 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) #---------------------------------------------------------------------

sgm_const_surface_revolve

()

# # Purpose : This file provides an example of a call to the # function sgm_const_surface_revolve() # # This function creates 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 # surface is 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 # menus on the menu bar. # # The function sgm_const_surface_revolve() # has the following arguments: # # sgm_const_surface_revolve # ( output_ids, # axis, # angle, # offset, # coord_frame, # curve_list, # created_ids ) # #---------------------------------------------------------------------

Main Index

506 PCL Reference Manual Examples Construct Actions

# Variable Declarations STRING s_output_ids[2] STRING s_axis[32] REAL r_angle REAL r_offset STRING s_coord_frame[32] 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 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 s_curve_list

= = = = = =

"1" "Coord 0.3" 45.0 10. "Coord 0" "Curve 1 "

i_return_value = sgm_const_surface_revolve ( s_output_ids, s_axis, r_angle, r_offset, s_coord_frame, 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) #---------------------------------------------------------------------

()

sgm_const_vector_2point # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_const_vector_2point() This function creates vector between two sets

Chapter 3: Geometry Functions 507 Construct Actions

# of points. # # In this example a new database is opened and # vectors are created between 2 sets 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 sgm_const_vector_2point() # has the following arguments: # # sgm_const_vector_2point # ( output_ids, # base_point_list, # tip_point_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_base_point_list[32] STRING s_tip_point_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# 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 Vectors s_output_ids = "" s_base_point_list = "[0 0 0] [1 1 1]" s_tip_point_list = "[10 0 0] [2.2 3.3 4.4]" i_return_value = sgm_const_vector_2point ( s_output_ids, s_base_point_list, s_tip_point_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @

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

()

sgm_const_vector_intersect # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_const_vector_intersect() This function creates vectors at the intersection of two sets of planes.

508 PCL Reference Manual Examples Construct Actions

# In this example a new database is opened and # 2 planes are created along XY and XZ plane # using 3 point option. Then this function is # called to create a vector at the intersection # of the two planes. The created vector appear # on 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 sgm_const_vector_intersect() # has the following arguments: # # sgm_const_vector_intersect # ( output_ids, # first_plane_list, # second_plane_list, # vector_rev_direction, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_first_plane_list[32] STRING s_second_plane_list[32] LOGICAL l_vector_rev_direction STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_plane_3p_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 Plane along XY plane i_return_value = @ sgm_const_plane_3point @ ( "", "[ 0 0 0]", "[ 10 0 0]", @ "[ 10 10 0]", sv_plane_3p_ids ) dump i_return_value # Create Plane along XZ plane i_return_value = sgm_const_plane_3point ( "", "[ 0 0 0]", "[ 10 0 0]", "[ 10 0 10]", sv_plane_3p_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create Vector s_output_ids s_first_plane_list s_second_plane_list l_vector_rev_direction

= = = =

"" "Plane 1 " "Plane 2 " FALSE

i_return_value = sgm_const_vector_intersect ( s_output_ids,

Main Index

@ @ @

Chapter 3: Geometry Functions 509 Construct Actions

s_first_plane_list, s_second_plane_list, l_vector_rev_direction, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_plane_3p_ids) #---------------------------------------------------------------------

sgm_const_vector_magnitude

()

# # Purpose : This file provides an example of 2 calls to the # function sgm_const_vector_magnitude() # # This function creates a vector from base point # in the specified magnitude and direction. # # In this example a new database is opened and # 2 vectors of magnitude 10 and 5 units are # created along X and Z axis respectively, with # [0 0 0] as base 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 sgm_const_vector_magnitude() # has the following arguments: # # sgm_const_vector_magnitude # ( output_ids, # magnitude_list, # direction_list, # base_point_list, # coord_frame, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_magnitude_list[32] STRING s_direction_list[32] STRING s_base_point_list[32] STRING s_coord_frame[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# 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 Vector of Magnitude 10 units along X axis

Main Index

510 PCL Reference Manual Examples Construct Actions

s_output_ids s_magnitude_list s_direction_list s_base_point_list s_coord_frame

= = = = =

"" "10.0" "<1 0 0>" "[0 0 0]" "Coord 0"

i_return_value = sgm_const_vector_magnitude ( s_output_ids, s_magnitude_list, s_direction_list, s_base_point_list, s_coord_frame, sv_created_ids ) dump i_return_value

@ @ @ @ @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Create Vector of Magnitude 5 units along Z axis s_output_ids s_magnitude_list s_direction_list s_base_point_list s_coord_frame

= = = = =

"" "5.0" "<0 0 1>" "[0 0 0]" "Coord 0"

i_return_value = @ sgm_const_vector_magnitude @ ( s_output_ids, @ s_magnitude_list, @ s_direction_list, @ s_base_point_list, @ s_coord_frame, @ sv_created_ids ) dump i_return_value #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) #---------------------------------------------------------------------

()

sgm_const_vector_normal # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_const_vector_normal() This function creates vectors that are normal to specified planes, surfaces or element faces. In this example a new database is opened and surface of dimension 4 X 4 is created along XY plane. Then this function is called to create a vector perpendicular to the surface at the its center. The created vector appear on the default viewport. This file can be run by starting a session of Patran, opening a new or existing database, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function sgm_const_vector_normal() has the following arguments: sgm_const_vector_normal

Chapter 3: Geometry Functions 511 Construct Actions

# ( output_ids, # normal_option, # entity_list, # magnitude_list, # base_point_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] INTEGER i_normal_option STRING s_entity_list[32] STRING s_magnitude_list[32] STRING s_base_point_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_xy_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 Surface along XY plane i_return_value = @ asm_const_patch_xyz @ ( "1", "<4 0 4>", "[0 0 0]", "Coord 0", @ sv_xy_ids ) #--------------------------------------------------------------------# Create Vector s_output_ids i_normal_option s_entity_list s_magnitude_list s_base_point_list

= = = = =

"" 2 "Surface 1 " "1.0" "[2.0 0.0 2.0 ] "

i_return_value = sgm_const_vector_normal ( s_output_ids, i_normal_option, s_entity_list, s_magnitude_list, s_base_point_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_xy_ids) #---------------------------------------------------------------------

()

sgm_const_vector_product # # #

Main Index

Purpose

:

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

512 PCL Reference Manual Examples Construct Actions

# # This function creates product vectors from two # sets of vectors. The generated vectors are # based on the origin points of the first set of # vectors. # # In this example a new database is opened and 2 # vectors are created along X and Z axis. Then # this function is called to create a vector as # product of vectors "Vector 1" and "Vector 2". # # This file can be run 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_vector_product() # has the following arguments: # # sgm_const_vector_product # ( output_ids, # vector_list1, # vector_list2, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_vector_list1[32] STRING s_vector_list2[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# 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 Vector along X and Z axis i_return_value = sgm_const_vector_2point ( "#","[0 0 0]","[10 0 0] [0 0 10]", sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @

#--------------------------------------------------------------------# Create Vector - Product of Vectors 1 & 2 s_output_ids = "" s_vector_list1 = "Vector 1" s_vector_list2 = "Vector 2" i_return_value = sgm_const_vector_product ( s_output_ids, s_vector_list1, s_vector_list2, sv_created_ids ) dump i_return_value dump sv_created_ids

Main Index

@ @ @ @ @

Chapter 3: Geometry Functions 513 Construct Actions

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

sgm_const_surface_vertex

()

# # Purpose : This file provides an example of a call to the # function sgm_const_surface_vertex() # # This function creates bi-parametric 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 created 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 sgm_const_surface_vertex() # has the following arguments: # # sgm_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) #--------------------------------------------------------------------# Create Points i_return_value = @ asm_const_grid_xyz @ ( "1", "[0 0 0]", "Coord 0", @ sv_create_grid_xyz_created_ids )

Main Index

514 PCL Reference Manual Examples Construct Actions

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 = sgm_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_create_curve_boundary # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_create_curve_boundary() In this illustration, a new database is opened 2 points are created. A line is created using those 2 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 sgm_create_curve_boundary() has the following arguments: sgm_create_curve_boundary ( output_ids,

Chapter 3: Geometry Functions 515 Construct Actions

# construct_method, # exist, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[128] STRING s_construct_method[128] INTEGER i_exist STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Create 2 Points i_return_value = @ asm_const_grid_xyz( "", "[0 0 0 ]"// @ "[10 0 0]", "Coord 0", @ sv_asm_create_grid_xyz_creat_id ) dump i_return_value #--------------------------------------------------------------------# Create a line between Point 1 and 2. # s_output_ids = "#" s_construct_method = "Co 2PointCurve ( Ev Geo (G1))( Ev Geo (G2))" i_return_value = sgm_create_curve_boundary ( s_output_ids, s_construct_method, i_exist, sv_created_ids ) dump i_return_value dump i_exist

@ @ @ @ @

# The ID of the created curve is dump sv_created_ids sys_free_string( sv_asm_create_grid_xyz_creat_id ) sys_free_string( sv_created_ids ) #---------------------------------------------------------------------

()

sgm_create_curve_bspline # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of three calls to the function sgm_create_curve_bspline(). This illustration opens a new database and creates 3 points in it. It calls the function to create 3 different B-splines. This file can be run 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_create_curve_bspline() has the following arguments: sgm_create_curve_bspline ( output_ids, point_list, order,

516 PCL Reference Manual Examples Construct Actions

# interpolate, # param_method, # closed, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[128] STRING s_point_list[128] INTEGER i_order LOGICAL l_interpolate INTEGER i_param_method LOGICAL l_closed STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Create 3 points i_return_value = @ asm_const_grid_xyz @ ( "", "[0 0 0][10 0 0][10 10 0]", @ "Coord 0", @ sv_asm_create_grid_xyz_creat_id ) dump i_return_value #--------------------------------------------------------------------# Call the function to create a open B-spline curve with order 3, # without interpolation. s_output_ids = "1" s_point_list = "Point 1:3" i_order = 3 l_interpolate = FALSE i_param_method = 1 l_closed = FALSE i_return_value = sgm_create_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

@ @ @ @ @ @ @ @

# Session file paused to observe the curve created. Press "Resume" # to continue. sf_pause() #--------------------------------------------------------------------# Call the function to create a open B-spline curve with order 3, # with interpolation. s_output_ids = "2" l_interpolate = TRUE l_closed = FALSE i_return_value = sgm_create_curve_bspline ( s_output_ids, s_point_list, i_order, l_interpolate,

Main Index

@ @ @ @ @ @

Chapter 3: Geometry Functions 517 Construct Actions

i_param_method, l_closed, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @

# Session file paused to observe the curve created. Press "Resume" # to continue. sf_pause() #--------------------------------------------------------------------# Call the function to create a closed B-spline curve with order 3, # with interpolation. s_output_ids = "3" l_interpolate = TRUE l_closed = TRUE i_return_value = sgm_create_curve_bspline ( s_output_ids, s_point_list, i_order, l_interpolate, i_param_method, l_closed, sv_created_ids ) dump i_return_value

@ @ @ @ @ @ @ @

# Created ID list dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_grid_xyz_creat_id) #---------------------------------------------------------------------

sgm_create_curve_chain

()

# # Purpose : This file provides an example of a call to the # function sgm_create_curve_chain() # # This illustration opens a new database and # creates 3 points in it. Using these points, # it creates 2 lines. Finally a composite curve # is created using these 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 sgm_create_curve_chain() has the following arguments: # # sgm_create_curve_chain # ( output_ids, # curve_list, # delete_orig, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[128] STRING s_curve_list[128] LOGICAL l_delete_orig STRING sv_created_ids[VIRTUAL] INTEGER i_return_value

Main Index

518 PCL Reference Manual Examples Construct Actions

STRING sv_asm_line_2point_created_id[VIRTUAL] STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of Curves and Points curve_label( TRUE ) point_label( TRUE ) # Create 3 Points i_return_value = asm_const_grid_xyz ( "", "[0 0 0][10 0 0][10 10 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id ) dump i_return_value # Create 2 Lines i_return_value = asm_const_line_2point( "", "Point 1 2", "Point 2 3", 0, "", 50., 1, sv_asm_line_2point_created_id ) dump i_return_value

@ @ @ @

@ @ @ @

# Session file paused. Observe the two lines created. Press "Resume" # to continue. sf_pause() #--------------------------------------------------------------------# Call the function to construct a composite curve from a list of # 2 curves. s_output_ids = "#" s_curve_list = "Curve 1:2" l_delete_orig = TRUE i_return_value = sgm_create_curve_chain ( s_output_ids, s_curve_list, l_delete_orig, sv_created_ids ) $? YES 38000217 dump i_return_value

@ @ @ @ @

# Created IDs dump sv_created_ids sys_free_string( sv_created_ids ) sys_free_string( sv_asm_line_2point_created_id ) sys_free_string( sv_asm_create_grid_xyz_creat_id ) # Note that the third line is created in place of Curve 1 and 2. #---------------------------------------------------------------------

()

sgm_create_curve_chain_v1 # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_create_curve_chain_v1() This illustration opens a new database and creates 3 points in it. Using these points, it creates 2 lines. Finally a composite curve is created using these two lines and the

Chapter 3: Geometry Functions 519 Construct Actions

# original lines are deleted. # # This file can be run 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_create_curve_chain_v1() # has the following arguments: # # sgm_create_curve_chain_v1 # ( output_ids, # curve_list, # delete_original, # segment_id, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[128] STRING s_curve_list[128] LOGICAL l_delete_original INTEGER i_segment_id STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_asm_line_2point_created_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of Points and Curves point_label(TRUE) curve_label(TRUE) # Create 3 Points i_return_value = asm_const_grid_xyz ( "", "[0 0 0][10 0 0][10 10 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id ) dump i_return_value # Create 2 Curves i_return_value = asm_const_line_2point( "", "Point 1 2", "Point 2 3", 0, "", 50., 1, sv_asm_line_2point_created_id ) dump i_return_value

@ @ @ @

@ @ @ @

# Session file paused. Observe the two lines created. Press "Resume" # to continue. sf_pause() #--------------------------------------------------------------------# Call the function to costruct a composite curve from a list of # 2 curves. Delete the original curve and retain only the curve # newly created. s_output_ids = "#" s_curve_list = "Curve 1:2" l_delete_original = TRUE i_segment_id = 0 i_return_value = sgm_create_curve_chain_v1 ( s_output_ids,

Main Index

@ @ @

520 PCL Reference Manual Examples Construct Actions

s_curve_list, l_delete_original, i_segment_id, sv_created_ids ) $? YES 38000217 dump i_return_value

@ @ @

# Created IDs dump sv_created_ids sys_free_string( sv_created_ids ) sys_free_string( sv_asm_line_2point_created_id ) sys_free_string( sv_asm_create_grid_xyz_creat_id ) # Note that the third line is created in place of Curve 1 and 2. #---------------------------------------------------------------------

sgm_create_curve_loft

()

# # Purpose : This file provides an example of two calls to # the function sgm_create_curve_loft() # # In this illustration, a new database is opened # 6 points are created. A loft curve passing # through these 6 points is created. Finally # another loft curve is created passing through # all the 6 points and using the 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 sgm_create_curve_loft() # has the following arguments: # # sgm_create_curve_loft # ( output_ids, # slope_control, # point_list, # slope_list1, # slope_list2, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[128] LOGICAL l_slope_control STRING s_point_list[128] STRING s_slope_list1[128] STRING s_slope_list2[128] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of Curves. curve_label(TRUE) # Create 6 points i_return_value = asm_const_grid_xyz( "", "[0 10 0 ]"//

Main Index

@ @

Chapter 3: Geometry Functions 521 Construct Actions

"[2.5 12.5 0] [5 10 0] [15 5 0]"// @ " [17.5 2.5 0] [20 5 0]", "Coord 0", @ sv_asm_create_grid_xyz_creat_id ) dump i_return_value #--------------------------------------------------------------------# Call the function to create the loft curve without using the slopes # s_output_ids = "#" l_slope_control = FALSE s_point_list = "Point 1:6" i_return_value = sgm_create_curve_loft ( s_output_ids, l_slope_control, s_point_list, s_slope_list1, s_slope_list2, sv_created_ids ) dump i_return_value

@ @ @ @ @ @ @

# Session file paused. Observe the loft-spline created. Press # "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Call the function to create the loft curve using the slopes. # l_slope_control = TRUE s_slope_list1 ="Construct 2PointVector"// @ "(Evaluate Geometry(Point 1 ))(Evaluate Geometry(Point 5 ))" s_slope_list2 = "Construct 2PointVector"// @ "(Evaluate Geometry(Point 6 ))(Evaluate Geometry(Point 5 ))" i_return_value = sgm_create_curve_loft ( s_output_ids, l_slope_control, s_point_list, s_slope_list1, s_slope_list2, sv_created_ids ) dump i_return_value

@ @ @ @ @ @ @

# Created IDs dump sv_created_ids sys_free_string( sv_created_ids ) sys_free_string( sv_asm_create_grid_xyz_creat_id ) #---------------------------------------------------------------------

sgm_create_surface_composite # # # # # # # # # # # # # # #

Main Index

Purpose

:

()

This file provides an example of a call to the function sgm_create_surface_composite() In this illustration, a new database is opened 3 surfaces are created. Then the function is called to create the composite surface using the 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 sgm_create_surface_composite()

522 PCL Reference Manual Examples Construct Actions

# has the following arguments: # # sgm_create_surface_composite # ( output_labels, # surface_list, # flag, # cleantol, # gaptol, # curve_start_label, # loop_id, # add_list, # remove_list, # inner_loop_list, # vertex_list, # delete_cons, # implicit_topology, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_labels[128] STRING s_surface_list[128] INTEGER i_flag REAL r_cleantol REAL r_gaptol INTEGER i_curve_start_label INTEGER i_loop_id STRING s_add_list[128] STRING s_remove_list[128] STRING s_inner_loop_list[128] STRING s_vertex_list[128] LOGICAL l_delete_cons LOGICAL l_implicit_topology STRING sv_created_labels[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_asm_line_3point_creat_id[VIRTUAL] STRING sv_sgm_surface_2curve_creat_id[VIRTUAL] STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] STRING sv_sgm_transform_surf_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the surfaces surface_label(TRUE) # Create a patch (Surface). i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value # Create 3 points i_return_value = asm_const_grid_xyz ( "", "[2 15 0][5 13 0][8 15 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id ) dump i_return_value

@ @ @

@ @ @ @

# Create one line passing through the 3 points created. i_return_value = @ asm_const_line_3point( "1", "Point 5 ", @ "Point 6 ", "Point 7 ", 1, 0.5, @ sv_asm_line_3point_creat_id )

Main Index

Chapter 3: Geometry Functions 523 Construct Actions

dump i_return_value # Create the surface using the two curves. i_return_value = sgm_const_surface_2curve( "2", "Surface 1.2", "Curve 1 ", sv_sgm_surface_2curve_creat_id ) dump i_return_value

@ @ @

# Mirror the surface i_return_value = @ sgm_transform_mirror( "3", "surface", @ "Coord 0.2", 5.0, TRUE, FALSE, @ "Surface 2 ", sv_sgm_transform_surf_creat_id ) dump i_return_value # Observe the 3 surfaces created. # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Create the composite surface using Surface 3 1 2. Surface 4 will # be created in place of Surfaces 3 1 2 and the old surfaces are # deleted. # s_output_labels= "4" s_surface_list = "Surface 3 1 2" i_flag = 0 r_cleantol = 0.1 r_gaptol = 0.005 i_curve_start_label = 5 i_loop_id = 1 s_add_list = "" s_remove_list = "" s_inner_loop_list = "" s_vertex_list = "" l_delete_cons = TRUE l_implicit_topology = TRUE i_return_value = sgm_create_surface_composite ( s_output_labels, s_surface_list, i_flag, r_cleantol, r_gaptol, i_curve_start_label, i_loop_id, s_add_list, s_remove_list, s_inner_loop_list, s_vertex_list, l_delete_cons, l_implicit_topology, sv_created_labels ) $? YES 38000219 dump i_return_value

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

# Created Labels dump sv_created_labels #

Observe the Surface 4 created

sys_free_string( sys_free_string( sys_free_string( sys_free_string( sys_free_string( sys_free_string(

Main Index

sv_created_labels ) sv_asm_line_3point_creat_id ) sv_asm_create_grid_xyz_creat_id ) sv_sgm_surface_2curve_creat_id ) sv_asm_create_patch_xy_creat_id ) sv_sgm_transform_surf_creat_id )

524 PCL Reference Manual Examples Construct Actions

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

sgm_create_surface_decompose

()

# # Purpose : This file provides an example of a call to the # function sgm_create_surface_decompose() # # In this illustration, a new database is opened # a surface is created. Then the function is # called to create a new surface using 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 sgm_create_surface_decompose() # has the following arguments: # # sgm_create_surface_decompose # ( output_ids, # object_surface, # manifold_entity, # point1_list, # point2_list, # point3_list, # point4_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[128] LOGICAL l_object_surface STRING s_manifold_entity[128] STRING s_point1_list[128] STRING s_point2_list[128] STRING s_point3_list[128] STRING s_point4_list[128] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_asm_line_3point_creat_id[VIRTUAL] STRING sv_sgm_surface_2curve_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the surfaces surface_label(TRUE) # Create 6 points i_return_value = asm_const_grid_xyz( "", "[0 0 0][0 5 0]"// "[0 10 0][10 0 0][10 5 0][10 10 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id dump i_return_value # Create a Line i_return_value = asm_const_line_3point( "1", "Point 1 ", "Point 2 ", "Point 3 ", 1, 0.5, sv_asm_line_3point_creat_id ) dump i_return_value

Main Index

@ @ @ )

@ @ @

Chapter 3: Geometry Functions 525 Construct Actions

# Create a Line i_return_value = asm_const_line_3point( "2", "Point 4 ", "Point 5 ", "Point 6 ", 1, 0.5, sv_asm_line_3point_creat_id ) dump i_return_value

@ @ @

# Create a surface i_return_value = @ sgm_const_surface_2curve( "1", "Curve 1 ", @ "Curve 2 ", sv_sgm_surface_2curve_creat_id ) dump i_return_value # Observe the surface created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to construct a surface from four vertices # defined from the existing surface. # s_output_ids = "2" l_object_surface = FALSE s_manifold_entity = "Surface 1" s_point1_list = "Point 2" s_point2_list = "Point 5" s_point3_list = "Point 4" s_point4_list = "Point 1" i_return_value = sgm_create_surface_decompose ( s_output_ids, l_object_surface, s_manifold_entity, s_point1_list, s_point2_list, s_point3_list, s_point4_list, sv_created_ids ) dump i_return_value

@ @ @ @ @ @ @ @ @

# Created IDs dump sv_created_ids #

Observe the Surface 2 created

sys_free_string( sv_created_ids ) sys_free_string( sv_asm_create_grid_xyz_creat_id ) sys_free_string( sv_asm_line_3point_creat_id ) sys_free_string( sv_sgm_surface_2curve_creat_id ) #---------------------------------------------------------------------

()

sgm_create_surface_ruled # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_create_surface_ruled() In this illustration, a new database is opened 2 lines are created. Then the function is called to create a ruled surface between these two curves. This file can be run by starting a session of Patran and running this session file through the "File","Session","Play" pulldown

526 PCL Reference Manual Examples Construct Actions

# menus on the menu bar. # # The function sgm_create_surface_ruled() # has the following arguments: # # sgm_create_surface_ruled # ( output_ids, # curve1_list, # curve2_list, # ruled_form, # auto_align, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[128] STRING s_curve1_list[128] STRING s_curve2_list[128] INTEGER i_ruled_form LOGICAL l_auto_align STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_asm_line_2point_creat_id[VIRTUAL] STRING sv_asm_line_3point_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the surfaces surface_label(TRUE) # Create the points i_return_value = asm_const_grid_xyz( "", "[0 10 0][20 10 0]"// "[0 0 0][10 -2 0][20 -10 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id dump i_return_value # Create the curve i_return_value = asm_const_line_2point( "1", "Point 1 ", "Point 2 ", 0, "", 50., 1, sv_asm_line_2point_creat_id ) dump i_return_value

@ @ @ )

@ @ @

# Create the Curve i_return_value = @ asm_const_line_3point( "2", "Point 3 ", @ "Point 4 ", "Point 5 ", 1, 0.5, @ sv_asm_line_3point_creat_id ) dump i_return_value #--------------------------------------------------------------------# Create ruled surface between Curve 1 and Curve 2 # s_output_ids = "1" s_curve1_list = "Curve 1" s_curve2_list = "Curve 2" i_ruled_form = 1 l_auto_align = TRUE # i_return_value = @ sgm_create_surface_ruled @ ( s_output_ids, @ s_curve1_list, @ s_curve2_list, @ i_ruled_form, @

Main Index

Chapter 3: Geometry Functions 527 Construct Actions

l_auto_align, sv_created_ids ) dump i_return_value

@

# Created IDs dump sv_created_ids sys_free_string( sv_created_ids ) sys_free_string( sv_asm_create_grid_xyz_creat_id ) sys_free_string( sv_asm_line_2point_creat_id ) sys_free_string( sv_asm_line_3point_creat_id ) #---------------------------------------------------------------------

sgm_create_surface_trimmed

()

# # Purpose : This file provides an example of a call to the # function sgm_create_surface_trimmed() # # In this illustration, a new database is opened. # A surface and 5 curves are created. Four curves # are converted into a composite curve. Then the # function is called to create a trimmed surface # between the composite curve and the fifth # circular 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_create_surface_trimmed() # has the following arguments: # # sgm_create_surface_trimmed # ( output_ids, # curveo_list, # curvei_list, # surface, # delete_ocurve, # delete_icurve, # delete_surf, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[128] STRING s_curveo_list[128] STRING s_curvei_list[128] STRING s_surface[128] LOGICAL l_delete_ocurve LOGICAL l_delete_icurve LOGICAL l_delete_surf STRING sv_created_ids[VIRTUAL] INTEGER i_return_value INTEGER i_sgm_create_curve_aut_segt_id STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_asm_line_2point_creat_id[VIRTUAL] STRING sv_sgm_create_curve_2d_creat_id[VIRTUAL] STRING sv_sgm_creat_cur_creat_curve_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 #

Main Index

Show the labels of the surfaces and curves.

528 PCL Reference Manual Examples Construct Actions

surface_label(TRUE) curve_label(TRUE) # Create a patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value # Create 4 points. i_return_value = asm_const_grid_xyz( "", "[5 0 0] [0 5 0] "// "[5 10 0][10 5 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id dump i_return_value # Create 4 curves. i_return_value = asm_const_line_2point( "", "Point 5:8 ", "Point 6 7 8 5", 0, "", 50., 1, sv_asm_line_2point_creat_id ) dump i_return_value # Create a circular curve. i_return_value = sgm_const_curve_2d_circle_v1( "", 1, 1., "Coord 0.3", "", "[5 5 0]", TRUE , sv_sgm_create_curve_2d_creat_id ) dump i_return_value # Convert the Curve 1:4 into a chain curve. i_return_value = sgm_create_curve_chain_v1( "10", " Curve 1:4", TRUE, i_sgm_create_curve_aut_segt_id, sv_sgm_creat_cur_creat_curve_id ) $? YES 38000217 dump i_return_value

@ @ @

@ @ @ )

@ @ @

@ @ @

@ @ @ @

# Observe the curves and the surface. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to create a trimmed surface inside the Surface 1 # with Curve 10 as outer boundary trim curve and Curve 5 as inner # boundary trim curve. # s_output_ids = "2" s_curveo_list = "Curve 10" s_curvei_list = "Curve 5" s_surface = "Surface 1" l_delete_ocurve = TRUE l_delete_icurve = TRUE l_delete_surf = TRUE i_return_value = sgm_create_surface_trimmed ( s_output_ids, s_curveo_list, s_curvei_list, s_surface, l_delete_ocurve, l_delete_icurve, l_delete_surf, sv_created_ids ) $? YES 38000217 $? YES 38000217

Main Index

@ @ @ @ @ @ @ @ @

Chapter 3: Geometry Functions 529 Construct Actions

$? YES 38000219 dump i_return_value # Created surface is dump sv_created_ids sys_free_string( sv_created_ids ) sys_free_string( sv_asm_create_patch_xy_creat_id ) sys_free_string( sv_asm_create_grid_xyz_creat_id ) sys_free_string( sv_asm_line_2point_creat_id ) sys_free_string( sv_sgm_create_curve_2d_creat_id ) sys_free_string( sv_sgm_creat_cur_creat_curve_id ) #---------------------------------------------------------------------

sgm_create_surface_trimmed_v1

()

# # Purpose : This file provides an example of a call to the # function sgm_create_surface_trimmed_v1() # # In this illustration, a new database is opened. # A surface and 5 curves are created. Four curves # are converted into a composite curve. Then the # function is called to create a trimmed surface # between the composite curve and the fifth # circular 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_create_surface_trimmed_v1() # has the following arguments: # # sgm_create_surface_trimmed_v1 # ( output_ids, # curveo_list, # curvei_list, # surface, # delete_ocurve, # delete_icurve, # delete_surf, # implied_top, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[128] STRING s_curveo_list[128] STRING s_curvei_list[128] STRING s_surface[128] LOGICAL l_delete_ocurve LOGICAL l_delete_icurve LOGICAL l_delete_surf LOGICAL l_implied_top STRING sv_created_ids[VIRTUAL] INTEGER i_return_value INTEGER i_sgm_create_curve_aut_segt_id STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_asm_line_2point_creat_id[VIRTUAL] STRING sv_sgm_create_curve_2d_creat_id[VIRTUAL] STRING sv_sgm_creat_cur_creat_curve_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" )

Main Index

530 PCL Reference Manual Examples Construct Actions

$? YES 36000002 # Show the labels of the surfaces and curves. surface_label(TRUE) curve_label(TRUE) # Create a patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value # Create 4 points. i_return_value = asm_const_grid_xyz( "", "[5 0 0] [0 5 0] "// "[5 10 0][10 5 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id dump i_return_value # Create 4 curves. i_return_value = asm_const_line_2point( "", "Point 5:8 ", "Point 6 7 8 5", 0, "", 50., 1, sv_asm_line_2point_creat_id ) dump i_return_value # Create a circular curve. i_return_value = sgm_const_curve_2d_circle_v1( "", 1, 1., "Coord 0.3", "", "[5 5 0]", TRUE , sv_sgm_create_curve_2d_creat_id ) dump i_return_value # Convert the Curve 1:4 into a chain curve. i_return_value = sgm_create_curve_chain_v1( "10", " Curve 1:4", TRUE, i_sgm_create_curve_aut_segt_id, sv_sgm_creat_cur_creat_curve_id ) $? YES 38000217 dump i_return_value

@ @ @

@ @ @ )

@ @ @

@ @ @

@ @ @ @

# Observe the curves and the surface. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to create a trimmed surface inside Surface 1 # with Curve 10 as outer boundary trim curve and Curve 5 as inner # boundary trim curve. # s_output_ids = "2" s_curveo_list = "Curve 10" s_curvei_list = "Curve 5" s_surface = "Surface 1" l_delete_ocurve = TRUE l_delete_icurve = TRUE l_delete_surf = TRUE l_implied_top = TRUE i_return_value = sgm_create_surface_trimmed_v1 ( s_output_ids, s_curveo_list, s_curvei_list, s_surface, l_delete_ocurve, l_delete_icurve,

Main Index

@ @ @ @ @ @ @ @

Chapter 3: Geometry Functions 531 Construct Actions

l_delete_surf, l_implied_top, sv_created_ids ) $? YES 38000217 $? YES 38000217 $? YES 38000219 dump i_return_value

@ @

# Created surface is dump sv_created_ids sys_free_string( sv_created_ids ) sys_free_string( sv_asm_create_patch_xy_creat_id ) sys_free_string( sv_asm_create_grid_xyz_creat_id ) sys_free_string( sv_asm_line_2point_creat_id ) sys_free_string( sv_sgm_create_curve_2d_creat_id ) sys_free_string( sv_sgm_creat_cur_creat_curve_id ) #---------------------------------------------------------------------

sgm_verify_surface_boundary

()

# # Purpose : This file provides an example of a call to the # function sgm_verify_surface_boundary() # # In this illustration, a new database is opened. # Two surfaces are created. Then function is # called to verify for the existence of free # edges between adjacent 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 sgm_verify_surface_boundary() # has the following arguments: # # sgm_verify_surface_boundary # ( surface_list, # verify_tol, # verify_type ) # #--------------------------------------------------------------------# Variable Declarations STRING s_surface_list[128] REAL r_verify_tol INTEGER i_verify_type INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the surfaces and curves. surface_label(TRUE) # Create a patch. i_return_value = asm_const_patch_xyz( "", "<20 10 0>"// "<20 10 0>", "[0 0 0][0 10 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value #

Main Index

Observe the 2 patches created.

@ @ @ @

532 PCL Reference Manual Examples Construct Actions

# Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to verify the existence of free edges between # adjacent surfaces 1 and 2 with the verify tolerance = 0.005 and # verify type = 1. # s_surface_list = "Surface 1 2" r_verify_tol = 0.005 i_verify_type = 1 i_return_value = sgm_verify_surface_boundary ( s_surface_list, r_verify_tol, i_verify_type ) dump i_return_value

@ @ @ @

# Create graphical display. i_return_value = sgm_incongruent_geom_display() dump i_return_value

@

sys_free_string( sv_asm_create_patch_xy_creat_id ) #---------------------------------------------------------------------

sgm_const_curve_2d_arc2point

()

# # Purpose : This file provides an example of a call to the # function sgm_const_curve_2d_arc2point() # # 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 # menus on the menu bar. # # The function sgm_const_curve_2d_arc2point() # has the following arguments: # # sgm_const_curve_2d_arc2point # ( output_ids, # arc_angle, # plane_list, # center_point_list, # start_point_list, # end_point_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_arc_angle STRING s_plane_list[16] 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 #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

Chapter 3: Geometry Functions 533 Construct Actions

#--------------------------------------------------------------------# Creating two curves in X-Y plane. s_output_ids = "#" i_arc_angle = 1 s_plane_list = "Coord 0.3" s_center_point_list = "[1 1 0] [2 2 0]" s_start_point_list = "[0 0 0]" s_end_point_list = "[3 3 0]" # i_return_value = @ sgm_const_curve_2d_arc2point @ ( s_output_ids, @ 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) #---------------------------------------------------------------------

sgm_const_curve_2d_arc2point_v1

()

# # Purpose : This file provides an example of a call to the # function sgm_const_curve_2d_arc2point_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 # menus on the menu bar. # # The function sgm_const_curve_2d_arc2point_v1() # has the following arguments: # # sgm_const_curve_2d_arc2point_v1 # ( output_ids, # arc_method, # radius, # create_center, # flip_center_point, # arc_angle, # plane_list, # center_point_list, # start_point_list, # end_point_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_arc_method REAL r_radius LOGICAL l_create_center LOGICAL l_flip_center_point INTEGER i_arc_angle STRING s_plane_list[16] STRING s_center_point_list[16] STRING s_start_point_list[16] STRING s_end_point_list[16]

Main Index

534 PCL Reference Manual Examples Construct Actions

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 X-Y plane by defining center. s_output_ids = "#" i_arc_method = 1 i_arc_angle = 2 s_plane_list = "Coord 0.3" s_center_point_list = "[1 1 0] [2 2 0]" s_start_point_list = "[0 0 0]" s_end_point_list = "[3 3 0]" # i_return_value = @ sgm_const_curve_2d_arc2point_v1 @ ( s_output_ids, @ i_arc_method, @ r_radius, @ l_create_center, @ l_flip_center_point, @ i_arc_angle, @ s_plane_list, @ s_center_point_list, @ s_start_point_list, @ s_end_point_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

sgm_const_curve_2d_arc2point_v2 # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

()

This file provides an example of a call to the function sgm_const_curve_2d_arc2point_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 Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function sgm_const_curve_2d_arc2point_v2() has the following arguments: sgm_const_curve_2d_arc2point_v2 ( output_ids, arc_method, radius, create_center, flip_center_point, arc_angle, plane_list, center_point_list,

Chapter 3: Geometry Functions 535 Construct Actions

# start_point_list, # end_point_list, # project_flag, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_arc_method REAL r_radius LOGICAL l_create_center LOGICAL l_flip_center_point INTEGER i_arc_angle STRING s_plane_list[16] STRING s_center_point_list[16] STRING s_start_point_list[16] STRING s_end_point_list[16] LOGICAL l_project_flag STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Enabling the curve and point labeling. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating two curves in plane parallel to X-Y plane passing through # start point, by defining radius. s_output_ids = "#" i_arc_method = 2 r_radius = 3.11 l_create_center = TRUE l_flip_center_point = TRUE i_arc_angle = 1 s_plane_list = "Coord 0.3" s_start_point_list = "[0 0 1]" s_end_point_list = "[3 3 0]" # i_return_value = @ sgm_const_curve_2d_arc2point_v2 @ ( s_output_ids, @ i_arc_method, @ r_radius, @ l_create_center, @ l_flip_center_point, @ i_arc_angle, @ s_plane_list, @ s_center_point_list, @ s_start_point_list, @ s_end_point_list, @ l_project_flag, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

()

sgm_const_curve_2d_arcangles # #

Main Index

Purpose

:

This file provides an example of a call to the

536 PCL Reference Manual Examples Construct Actions

# function sgm_const_curve_2d_arcangles() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create two arcs. # # This file can be run 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_2d_arcangles() # has the following arguments: # # sgm_const_curve_2d_arcangles # ( output_ids, # radius, # start_angle, # end_angle, # plane_list, # center_point_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] REAL r_radius REAL r_start_angle REAL r_end_angle STRING s_plane_list[32] STRING s_center_point_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 curve and point label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating two curves in Z plane. s_output_ids = "#" r_radius = 1.55 r_start_angle = 45.0 r_end_angle = 145.0 s_plane_list = "Coord 0.3 Coord 0.3" s_center_point_list = "[3 3 1] [6 6 2]" # i_return_value = @ sgm_const_curve_2d_arcangles @ ( s_output_ids, @ r_radius, @ r_start_angle, @ r_end_angle, @ s_plane_list, @ s_center_point_list, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 537 Construct Actions

sgm_const_curve_2d_arcangles_v1

()

# # Purpose : This file provides an example of a call to the # function sgm_const_curve_2d_arcangles_v1() # # This session file will create a new database by # name ’new.db’ and call the above mentioned # function and create two arcs. # # This file can be run 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_2d_arcangles_v1() # has the following arguments: # # sgm_const_curve_2d_arcangles_v1 # ( output_ids, # radius, # start_angle, # end_angle, # plane_list, # center_point_list, # project_flag, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] REAL r_radius REAL r_start_angle REAL r_end_angle STRING s_plane_list[32] STRING s_center_point_list[16] LOGICAL l_project_flag STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Enabling curve and point label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating two arcs and translating construction plane # to curve location. s_output_ids = "#" r_radius = 1.55 r_start_angle = 45.0 r_end_angle = 145.0 s_plane_list = "Coord 0.3 Coord 0.3" l_project_flag = FALSE s_center_point_list = "[3 3 3] [6 6 6]" # i_return_value = @ sgm_const_curve_2d_arcangles_v1 @ ( s_output_ids, @ r_radius, @ r_start_angle, @ r_end_angle, @ s_plane_list, @ s_center_point_list, @

Main Index

538 PCL Reference Manual Examples Construct Actions

l_project_flag, sv_created_ids ) dump i_return_value dump sv_created_ids

@

sys_free_string(sv_created_ids) #---------------------------------------------------------------------

sgm_const_curve_2d_arc3point

()

# # Purpose : This file provides an example of a call to the # function sgm_const_curve_2d_arc3point() # # 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 # menus on the menu bar. # # The function sgm_const_curve_2d_arc3point() # has the following arguments: # # sgm_const_curve_2d_arc3point # ( output_ids, # plane_list, # start_point_list, # middle_point_list, # end_point_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_plane_list[16] STRING s_start_point_list[16] STRING s_middle_point_list[16] STRING s_end_point_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 in X-Y plane. s_output_ids = "#" s_plane_list = "Coord 0.3" s_start_point_list = "[1 1 0] [2 2 0]" s_middle_point_list = "[1 4 1]" s_end_point_list = "[3 3 0]" # i_return_value = @ sgm_const_curve_2d_arc3point @ ( s_output_ids, @ s_plane_list, @ s_start_point_list, @ s_middle_point_list, @ s_end_point_list, @

Main Index

Chapter 3: Geometry Functions 539 Construct Actions

sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) #---------------------------------------------------------------------

sgm_const_curve_2d_circle

()

# # Purpose : This file provides an example of a call to the # function sgm_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 sgm_const_curve_2d_circle() # has the following arguments: # # sgm_const_curve_2d_circle # ( output_ids, # radius_method, # radius, # plane_list, # radius_point_list, # center_point_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_radius_method REAL r_radius STRING s_plane_list[32] STRING s_radius_point_list[16] STRING s_center_point_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) #--------------------------------------------------------------------# Calling function to create two circles in two perpendicular planes. # Circles drawn by explicitly giving the radius. s_output_ids = "1" i_radius_method = 1 r_radius = 1.45 s_plane_list = "Coord 0.3 Coord 0.2" s_center_point_list = "[5 5 0] [0 0 0]" # i_return_value = @ sgm_const_curve_2d_circle @ ( s_output_ids, @ i_radius_method, @ r_radius, @ s_plane_list, @

Main Index

540 PCL Reference Manual Examples Construct Actions

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) #---------------------------------------------------------------------

sgm_const_curve_2d_circle_v1

()

# # Purpose : This file provides an example of a call to the # function sgm_const_curve_2d_circle_v1() # # 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 sgm_const_curve_2d_circle_v1() # has the following arguments: # # sgm_const_curve_2d_circle_v1 # ( output_ids, # radius_method, # radius, # plane_list, # radius_point_list, # center_point_list, # project_flag, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_radius_method REAL r_radius STRING s_plane_list[16] STRING s_radius_point_list[16] STRING s_center_point_list[16] LOGICAL l_project_flag STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Enabling the curve and point labeling. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Calling function to create two circles and project them on a plane. # Circles are created by giving radius value. s_output_ids = "#" i_radius_method = 1 r_radius = 1.45 s_plane_list = "Coord 0.3" s_center_point_list = "[0 0 3] [3 3 -1]" l_project_flag = TRUE # i_return_value = @

Main Index

Chapter 3: Geometry Functions 541 Construct Actions

sgm_const_curve_2d_circle_v1 ( s_output_ids, i_radius_method, r_radius, s_plane_list, s_radius_point_list, s_center_point_list, l_project_flag, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) #---------------------------------------------------------------------

sgm_const_curve_2d_normal

()

# # Purpose : This file provides an example of a call to the # function sgm_const_curve_2d_normal() # # 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 two # curves perpendicular to 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 sgm_const_curve_2d_normal() # has the following arguments: # # sgm_const_curve_2d_normal # ( output_ids, # length, # flip, # plane_list, # point_list, # curve_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] REAL r_length LOGICAL l_flip STRING s_plane_list[16] STRING s_point_list[16] STRING s_curve_list[16] 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 curve and point label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating a curve by giving three points. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @

Main Index

542 PCL Reference Manual Examples Construct Actions

"[ 0.5 1 2]", "[1 0.5 1]",1,0.5, sv_asm_line_3point_created_ids) dump i_return_value #--------------------------------------------------------------------# Creating two curves perpendicular to the Curve 1. The curves will # be projected on to the Z plane. New curves will be drawn on the # opposite side of the curve 1 with respect to the points given. s_output_ids = "#" r_length = -3.0 l_flip = TRUE s_plane_list = "Coord 0.3" s_point_list = "[1 2 0][.5 -1 1]" s_curve_list = "Curve 1 " # i_return_value = @ sgm_const_curve_2d_normal @ ( s_output_ids, @ r_length, @ l_flip, @ s_plane_list, @ s_point_list, @ 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) #---------------------------------------------------------------------

sgm_const_curve_2d_normal_v1

()

# # Purpose : This file provides an example of a call to the # function sgm_const_curve_2d_normal_v1() # # 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 two # curves perpendicular to 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 sgm_const_curve_2d_normal_v1() # has the following arguments: # # sgm_const_curve_2d_normal_v1 # ( output_ids, # length, # flip, # plane_list, # point_list, # curve_list, # project_flag, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] REAL r_length LOGICAL l_flip STRING s_plane_list[16] STRING s_point_list[16] STRING s_curve_list[16]

Main Index

Chapter 3: Geometry Functions 543 Construct Actions

LOGICAL l_project_flag 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 curve and point label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating a curve by giving three points. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[ 0.5 1 2]", "[1 0.5 1]",1,0.5, sv_asm_line_3point_created_ids) dump i_return_value #--------------------------------------------------------------------# Creating two curves perpendicular to the Curve 1. The curves will # be projected on the plane parallel to Z plane and passing through # the individual points. New curves will be drawn on the opposite # side of the curve 1 with respect to the points given. s_output_ids = "#" r_length = -3.0 l_flip = TRUE s_plane_list = "Coord 0.3" s_point_list = "[1 2 0][.5 -1 1]" s_curve_list = "Curve 1 " l_project_flag = FALSE # i_return_value = @ sgm_const_curve_2d_normal_v1 @ ( s_output_ids, @ r_length, @ l_flip, @ s_plane_list, @ s_point_list, @ s_curve_list, @ l_project_flag, @ 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) #---------------------------------------------------------------------

()

sgm_const_curve_intersect # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_const_curve_intersect() This session file will create a new database by name ’new.db’ and create two surfaces and a plane. The above mentioned function will be called to create 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 sgm_const_curve_intersect()

544 PCL Reference Manual Examples Construct Actions

# has the following arguments: # # sgm_const_curve_intersect # ( output_ids, # intersect_option, # surface1_list, # surface2_list, # geo_tol, # int_tol, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] INTEGER i_intersect_option STRING s_surface1_list[16] STRING s_surface2_list[32] REAL r_geo_tol REAL r_int_tol STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_crtd_ids[VIRTUAL] STRING sv_sgm_create_plane_3p_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 a plane. i_return_value = @ sgm_const_plane_3point("1","[0 0 0]","[1 0 0]"@ , "[0 1 -1]", sv_sgm_create_plane_3p_crtd_ids ) 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 two curves where the plane is intersecting the two # surfaces. s_output_ids = "#" i_intersect_option = 2 s_surface1_list = "Plane 1" s_surface2_list = "Surface 2 Surface 1" r_geo_tol = 1e-08 r_int_tol = 0.1 # i_return_value = @ sgm_const_curve_intersect @ ( s_output_ids, @ i_intersect_option, @ s_surface1_list, @ s_surface2_list, @ r_geo_tol, @

Main Index

Chapter 3: Geometry Functions 545 Construct Actions

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) sys_free_string(sv_sgm_create_plane_3p_crtd_ids) #---------------------------------------------------------------------

sgm_const_curve_manifold_2point

()

# # Purpose : This file provides an example of a call to the # function sgm_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 sgm_const_curve_manifold_2point() # has the following arguments: # # sgm_const_curve_manifold_2point # ( output_ids, # surface_list, # point1_list, # point2_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_surface_list[16] STRING s_point1_list[32] STRING s_point2_list[32] 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.

Main Index

546 PCL Reference Manual Examples Construct Actions

i_return_value = ga_display_lines_set( "general", 5 ) dump i_return_value #--------------------------------------------------------------------# Creating 2 curves on the surface. 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_return_value = @ sgm_const_curve_manifold_2point @ ( s_output_ids, @ s_surface_list, @ s_point1_list, @ s_point2_list, @ 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) #---------------------------------------------------------------------

sgm_const_curve_manifold_npoint

()

# # Purpose : This file provides an example of a call to the # function sgm_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 sgm_const_curve_manifold_npoint() # has the following arguments: # # sgm_const_curve_manifold_npoint # ( output_ids, # surface, # point_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16] STRING s_surface[16] STRING s_point_list[64] 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) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 547 Construct Actions

# 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. s_output_ids = "#" s_surface = "Surface 1" s_point_list = "[0 0 0] [.75 .35 3] [.5 .5 0] [.1 .9 0]" # i_return_value = @ sgm_const_curve_manifold_npoint @ ( s_output_ids, @ s_surface, @ s_point_list, @ 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) #---------------------------------------------------------------------

sgm_const_curve_project

()

# # Purpose : This file provides an example of a call to the # function sgm_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 sgm_const_curve_project() # has the following arguments: # # sgm_const_curve_project # ( output_ids, # curve_list, # surface_list, # delete_org, # project_method, # vector, # coord_frame, # prjtol, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[16]

Main Index

548 PCL Reference Manual Examples Construct Actions

STRING s_curve_list[16] STRING s_surface_list[16] LOGICAL l_delete_org INTEGER i_project_method STRING s_vector[16] STRING s_coord_frame[16] REAL r_prjtol STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_sgm_create_surface_crtd_ids[VIRTUAL] STRING sv_asm_line_3point_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Enabling curve and point label. curve_label(TRUE) point_label(TRUE) #--------------------------------------------------------------------# Creating a surface by giving vertex points. i_return_value = @ sgm_const_surface_vertex( "1", "[0 0 0]", @ "[4 1 -.5]", "[3.5 2.1 4]", "[-.5 3 2.2]", @ sv_sgm_create_surface_crtd_ids ) dump i_return_value #--------------------------------------------------------------------# Creating a curve by specifying three points. i_return_value = @ asm_const_line_3point( "1", "[1 1 .5]", @ "[.4 -.2 1]", "[3 0 -.1]", 1, 0.5, @ sv_asm_line_3point_created_ids ) dump i_return_value #--------------------------------------------------------------------# Changing view for proper view of the surface. i_return_value = ga_view_aa_set( -20., 70., -160. ) dump i_return_value #--------------------------------------------------------------------# Making the surface interior clear on the screen. i_return_value = ga_display_lines_set( "general", 5 ) dump i_return_value #--------------------------------------------------------------------# Creating a projected curve on the surface without deleting the old. s_output_ids = "#" s_curve_list = "Curve 1" s_surface_list = "Surface 1" l_delete_org = FALSE s_coord_frame = "Coord 0" r_prjtol = 1e-05 # i_return_value = @ sgm_const_curve_project @ ( s_output_ids, @ s_curve_list, @ s_surface_list, @ l_delete_org, @ i_project_method, @ s_vector, @ s_coord_frame, @ r_prjtol, @ sv_created_ids ) dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_sgm_create_surface_crtd_ids) sys_free_string(sv_asm_line_3point_created_ids) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 549 Construct Actions

()

sgm_const_plane_3point

# # Purpose : This file provides an example of a call to the # function sgm_const_plane_3point() # # This function creates planes passing through # three sets of points. # # In this example a new database is opened and # 2 planes, parallel XZ and YZ plane, are created # 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 sgm_const_plane_3point() # has the following arguments: # # sgm_const_plane_3point # ( output_ids, # point1_list, # point2_list, # point3_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 sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# 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 Plane s_output_ids s_point1_list s_point2_list s_point3_list

= = = =

"#" "[0 0 0]" "[10 0 0] [0 10 0]" "[10 0 10] [0 10 10]"

i_return_value = sgm_const_plane_3point ( s_output_ids, s_point1_list, s_point2_list, s_point3_list, sv_created_ids ) dump i_return_value dump sv_created_ids

Main Index

@ @ @ @ @ @

550 PCL Reference Manual Examples Construct Actions

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

sgm_const_plane_curve

()

# # Purpose : This file provides an example of a call to the # function sgm_const_plane_curve() # # This function creates planes normal to a set # of curves at a set of points on the curves. # # In this example a new database is opened and # 2 curves are drawn from [0 0 0] to [10 0 0] and # [10 0 0] to [10 10 0]. Then 2 planes are # created perpendicular to these 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 sgm_const_plane_curve() # has the following arguments: # # sgm_const_plane_curve # ( output_ids, # point_option, # curve_list, # point_list, # u_position, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] INTEGER i_point_option STRING s_curve_list[32] STRING s_point_list[32] REAL r_u_position 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 = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create line i_return_value = @ asm_const_line_2point @ ( "#", "[0 0 0][10 0 0]", @ "[10 0 0][10 10 0]", 0, "", @ 50., 1, sv_point_ids ) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 551 Construct Actions

#

Create Plane

s_output_ids i_point_option s_curve_list s_point_list r_u_position

= = = = =

"#" 2 "Curve 1 2" "Point 1 2" 0.0

i_return_value = sgm_const_plane_curve ( s_output_ids, i_point_option, s_curve_list, s_point_list, r_u_position, sv_created_ids ) dump i_return_value

@ @ @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_point_ids) #---------------------------------------------------------------------

sgm_const_plane_leastsq

()

# # Purpose : This file provides an example of 3 calls to the # function sgm_const_plane_leastsq() # # This function creates a least squares plane # from a set of points, a curve, or a surface. # # In this example a new database is opened and a # cube of 10 unit is created. Then a curve is # created. Then this function is called three # times to create 3 least square planes - first # using "Points 3 6 7 8", second using "Curve 1" # and third using surface "Solid 1.6". # # This file can be run 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_plane_leastsq() # has the following arguments: # # sgm_const_plane_leastsq # ( output_ids, # leastsq_option, # entity_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] INTEGER i_leastsq_option STRING s_entity_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_create_hpat_xyz_created_ids[VIRTUAL] STRING sv_create_curve_2d_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" )

Main Index

552 PCL Reference Manual Examples Construct Actions

$? YES 36000002 # Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value

@ @

# Display Plane labels plane_label(TRUE) #--------------------------------------------------------------------# Create cube of dimension 10 X 10 X 10 i_return_value = @ asm_const_hpat_xyz @ ( "1", "<10 10 10>","[0 0 0]", "Coord 0", @ sv_create_hpat_xyz_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create semicircular arc i_return_value = @ sgm_const_curve_2d_arc2point_v2 @ ( "#", 2, 5., FALSE, FALSE, 1,"Coord 0.3",@ "", "Point 7 ", "Point 6 ", FALSE, @ sv_create_curve_2d_created_ids ) #--------------------------------------------------------------------# Create least square Plane from set of points s_output_ids = "#" i_leastsq_option = 1 s_entity_list = "Point 3 6 7 8" i_return_value = sgm_const_plane_leastsq ( s_output_ids, i_leastsq_option, s_entity_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @

# Session file paused. Press "Resume ..." to continue... sf_pause() #--------------------------------------------------------------------# Create least square Plane from a curve s_output_ids = "#" i_leastsq_option = 2 s_entity_list = "Curve 1" i_return_value = sgm_const_plane_leastsq ( s_output_ids, i_leastsq_option, s_entity_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @

# Session file paused. Press "Resume ..." to continue... sf_pause() #--------------------------------------------------------------------# Create least square Plane from surface s_output_ids = "#" i_leastsq_option = 3 s_entity_list = "Solid 1.6 1.2" i_return_value = sgm_const_plane_leastsq

Main Index

@ @

Chapter 3: Geometry Functions 553 Construct Actions

(

s_output_ids, i_leastsq_option, s_entity_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) sys_free_string( sv_create_curve_2d_created_ids) #---------------------------------------------------------------------

sgm_const_plane_tangent

()

# # Purpose : This file provides an example of a call to the # function sgm_const_plane_tangent() # # This function creates planes that are tangent # to set of surfaces at a set of points on the # surfaces. # # In this example a new database is opened and # surface of dimension 4 X 4 is created along # XY plane. Then this function is called to # create a plane tangential to this plane at # point [10 10 0]. # # This file can be run by starting a session of # Patran, opening a new or existing database, # and running this session file through the # "File","Session","Play" pulldown menus # on the menu bar. # # The function sgm_const_plane_tangent() # has the following arguments: # # sgm_const_plane_tangent # ( output_ids, # point_option, # surface_list, # point_list, # uv_position, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] INTEGER i_point_option STRING s_surface_list[32] STRING s_point_list[32] REAL ra_uv_position(2) STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_xy_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

@ @

554 PCL Reference Manual Examples Construct Actions

dump i_return_value # Display Surface Label surface_label(TRUE) #--------------------------------------------------------------------# Create Surface along XY plane i_return_value = @ asm_const_patch_xyz @ ( "#", "<4 4 0>", "[0 0 0]", "Coord 0", @ sv_xy_ids ) #--------------------------------------------------------------------# Create Plane s_output_ids i_point_option s_surface_list s_point_list ra_uv_position

= = = = =

"" 2 "Surface 1" "Point 3 " [0., 0.]

i_return_value = sgm_const_plane_tangent ( s_output_ids, i_point_option, s_surface_list, s_point_list, ra_uv_position, sv_created_ids ) dump i_return_value

@ @ @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_xy_ids) #---------------------------------------------------------------------

()

sgm_const_plane_interpolate # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_const_plane_interpolate() This function creates planes by interpolation along a set of curves, The normals of the generated planes are along the curve tangents at the points of intersection between the planes and the curves. In this example a new database is opened and a curve is drawn from [0 0 0] to [10 0 0]. Then 3 planes, whose normals are along the curve is created using this function with uniform space ratio. The created planes appear on 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 sgm_const_plane_interpolate() has the following arguments: sgm_const_plane_interpolate ( output_ids,

Chapter 3: Geometry Functions 555 Construct Actions

# curve_list, # space_ratio, # num_planes, # method, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_curve_list[32] REAL r_space_ratio INTEGER i_num_planes INTEGER i_method 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 = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create line i_return_value = @ asm_const_line_2point @ ( "1", "[0 0 0]", "[10 0 0]", 0, "", @ 50., 1, sv_point_ids ) #--------------------------------------------------------------------# Create Plane s_output_ids s_curve_list r_space_ratio i_num_planes i_method

= = = = =

"" "Curve 1 " 0.0 3 1

i_return_value = @ sgm_const_plane_interpolate @ ( s_output_ids, @ s_curve_list, @ r_space_ratio, @ i_num_planes, @ i_method, @ 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) #---------------------------------------------------------------------

sgm_const_plane_vector_normal # # # # #

Main Index

Purpose

:

()

This file provides an example of a call to the function sgm_const_plane_vector_normal() This function creates planes from a set of

556 PCL Reference Manual Examples Construct Actions

# vector normals # # In this function a new database is opened and # vector is created from [0 0 0] to [1 0 0]. Then # this function is called to crated a plane # perpendicular to the created 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 sgm_const_plane_vector_normal() # has the following arguments: # # sgm_const_plane_vector_normal # ( output_ids, # offset_list, # vector_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_offset_list[32] STRING s_vector_list[32] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_vector_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 Vector i_return_value = @ sgm_const_vector_magnitude @ ( "1","1.0","<1 0 0>","[0 0 0]","Coord 0",@ sv_vector_ids ) dump i_return_value #--------------------------------------------------------------------# Create Plane s_output_ids = "" s_offset_list = "0.0" s_vector_list = sv_vector_ids i_return_value = sgm_const_plane_vector_normal ( s_output_ids, s_offset_list, s_vector_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_vector_ids)

Main Index

Chapter 3: Geometry Functions 557 Construct Actions

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

sgm_const_solid_2surface

()

# # Purpose : This file provides an example of a call to the # function sgm_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 sgm_const_solid_2surface() # has the following arguments: # # sgm_const_solid_2surface # ( output_ids, # surface1_list, # surface2_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] 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>",

@ @ @

@ @ @

# Create a solid. s_surface1_list = "surface 1" s_surface2_list = "surface 2" i_return_value = sgm_const_solid_2surface

Main Index

@ @

558 PCL Reference Manual Examples Construct Actions

(

s_output_ids, 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) #---------------------------------------------------------------------

sgm_const_solid_2surface_v1

()

# # Purpose : This file provides an example of a call to the # function sgm_const_solid_2surface_v1() # # 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 sgm_const_solid_2surface_v1() # has the following arguments: # # sgm_const_solid_2surface_v1 # ( 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)

Main Index

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.5>",

Chapter 3: Geometry Functions 559 Construct Actions

"[0.25 1 0.25]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value

@

# Create a solid. l_auto_orient = TRUE s_surface1_list = "surface 1" s_surface2_list = "surface 2" i_return_value = sgm_const_solid_2surface_v1 ( 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) #---------------------------------------------------------------------

sgm_const_solid_3surface_v1

()

# # Purpose : This file provides an example of a call to the # function sgm_const_solid_3surface_v1() # # 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 sgm_const_solid_3surface_v1() # has the following arguments: # # sgm_const_solid_3surface_v1 # ( output_ids, # param_method, # surface1_list, # surface2_list, # surface3_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] 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)

Main Index

560 PCL Reference Manual Examples Construct Actions

ga_group_display_set("default_group","general") ga_display_lines_set( "general", 2 ) 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

@ @ @

0.5>",

@ @ @

0.5>",

@ @ @

# Create a solid. i_param_method = 2 s_surface1_list = "surface 1" s_surface2_list = "surface 2" s_surface3_list = "surface 3" i_return_value = sgm_const_solid_3surface_v1 ( s_output_ids, i_param_method, s_surface1_list, s_surface2_list, s_surface3_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) #---------------------------------------------------------------------

()

sgm_const_solid_3surface_v2 # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_const_solid_3surface_v2() 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 sgm_const_solid_3surface_v2() has the following arguments: sgm_const_solid_3surface_v2

Chapter 3: Geometry Functions 561 Construct Actions

# ( output_ids, # auto_orient, # param_method, # surface1_list, # surface2_list, # surface3_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] LOGICAL l_auto_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 ) 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

@ @ @

0.5>",

@ @ @

0.5>",

@ @ @

# Create a solid. l_auto_orient = TRUE i_param_method = 2 s_surface1_list = "surface 1" s_surface2_list = "surface 2" s_surface3_list = "surface 3" i_return_value = sgm_const_solid_3surface_v2 ( s_output_ids, l_auto_orient, i_param_method, s_surface1_list, s_surface2_list, s_surface3_list, sv_created_ids ) dump i_return_value dump sv_created_ids

Main Index

@ @ @ @ @ @ @ @

562 PCL Reference Manual Examples Construct Actions

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

sgm_const_solid_4surface_v1

()

# # Purpose : This file provides an example of a call to the # function sgm_const_solid_4surface_v1() # # 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 sgm_const_solid_4surface_v1() # has the following arguments: # # sgm_const_solid_4surface_v1 # ( output_ids, # param_method, # surface1_list, # surface2_list, # surface3_list, # surface4_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] 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

Main Index

0.5>",

@ @ @

@ @ @

Chapter 3: Geometry Functions 563 Construct Actions

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>",

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. i_param_method = 2 s_surface1_list = "surface s_surface2_list = "surface s_surface3_list = "surface s_surface4_list = "surface

@ @ @

@ @ @

1" 2" 3" 4"

i_return_value = sgm_const_solid_4surface_v1 ( s_output_ids, i_param_method, 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) #---------------------------------------------------------------------

()

sgm_const_solid_4surface_v2 # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_const_solid_4surface_v2() 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_v2() has the following arguments: sgm_const_solid_4surface_v2 ( output_ids, orient, param_method, surface1_list, surface2_list, surface3_list, surface4_list, created_ids )

564 PCL Reference Manual Examples Construct Actions

#--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] LOGICAL l_auto_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_auto_orient = TRUE i_param_method = 2 s_surface1_list = "surface s_surface2_list = "surface s_surface3_list = "surface s_surface4_list = "surface

@ @ @

1" 2" 3" 4"

i_return_value = sgm_const_solid_4surface_v2 ( s_output_ids, l_auto_orient, i_param_method, s_surface1_list, s_surface2_list, s_surface3_list, s_surface4_list, sv_created_ids ) dump i_return_value dump sv_created_ids

Main Index

@ @ @

@ @ @ @ @ @ @ @ @

Chapter 3: Geometry Functions 565 Construct Actions

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

sgm_const_solid_5face

()

# # Purpose : This file provides an example of a call to the # function sgm_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 sgm_const_solid_5face() # has the following arguments: # # sgm_const_solid_5face # ( output_ids, # surface1_list, # surface2_list, # surface3_list, # surface4_list, # surface5_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 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 )

Main Index

@ @ @

@ @ @

566 PCL Reference Manual Examples Construct Actions

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 = @ sgm_const_solid_5face @ ( s_output_ids, @ s_surface1_list, @ s_surface2_list, @ 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) #---------------------------------------------------------------------

()

sgm_const_solid_6face # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_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.

Chapter 3: Geometry Functions 567 Construct Actions

# The function sgm_const_solid_6face() # has the following arguments: # # sgm_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("", "<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 = "surface 1" s_surface2_list = "surface 2"

Main Index

@ @ @ @

@ @ @ @ @ @

@ @ @ @ @

568 PCL Reference Manual Examples Construct Actions

s_surface3_list s_surface4_list s_surface5_list s_surface6_list

= = = =

"surface "surface "surface "surface

3" 4" 5" 6"

# Create a Solid with the created six surfaces. i_return_value = @ sgm_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) #---------------------------------------------------------------------

sgm_sweep_solid_arc

()

# # Purpose : This file provides an example of a call to the # function sgm_sweep_solid_arc() # # This illustration opens a new database and # creates a Surface in it. Then the Surface is # swept to create the hpat. # # This file can be run 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_sweep_solid_arc() # has the following arguments: # # sgm_sweep_solid_arc # ( output_labels, # axis, # angle, # offset, # coord_frame, # surface, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_labels[128] STRING s_axis[128] REAL r_angle REAL r_offset STRING s_coord_frame[128] STRING s_surface[128] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database

Main Index

Chapter 3: Geometry Functions 569 Construct Actions

uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the surfaces and solids. surface_label(TRUE) solid_label(TRUE) # Create a patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value

@ @ @

# Change the view. ga_view_aa_set( -67., 0., -34. ) # Observe the surface created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to sweep the Surface 1 about Coord 0.2 to create # a hpat. # s_output_labels = "1" s_axis = "Coord 0.2" r_angle = 90.0 r_offset = 0.0 s_coord_frame = "Coord 0" s_surface = "Surface 1" i_return_value = sgm_sweep_solid_arc ( s_output_labels, s_axis, r_angle, r_offset, s_coord_frame, s_surface, sv_created_labels ) dump i_return_value

@ @ @ @ @ @ @ @

# Labels of the created solids dump sv_created_labels sys_free_string(sv_created_labels) sys_free_string( sv_asm_create_patch_xy_creat_id ) #---------------------------------------------------------------------

()

sgm_const_solid_decompose # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_const_solid_decompose() This file opens a new database "new.db" and creates a solid. Later it creates a solid with two surfaces of the solid and eight vertices on these 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 sgm_const_solid_decompose()

570 PCL Reference Manual Examples Construct Actions

# has the following arguments: # # sgm_const_solid_decompose # ( output_ids, # cubic, # solid_face1_list, # solid_face2_list, # vertex1_list, # vertex2_list, # vertex3_list, # vertex4_list, # vertex5_list, # vertex6_list, # vertex7_list, # vertex8_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[64] LOGICAL l_cubic STRING s_solid_face1_list[64] STRING s_solid_face2_list[64] STRING s_vertex1_list[64] STRING s_vertex2_list[64] STRING s_vertex3_list[64] STRING s_vertex4_list[64] STRING s_vertex5_list[64] STRING s_vertex6_list[64] STRING s_vertex7_list[64] STRING s_vertex8_list[64] 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 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 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 s_output_ids s_vertex1_list s_vertex2_list s_vertex3_list s_vertex4_list s_vertex5_list s_vertex6_list s_vertex7_list s_vertex8_list l_cubic

= = = = = = = = = =

"8" "Solid "Solid "Solid "Solid "Solid "Solid "Solid "Solid TRUE

1.1 1.1 1.1 1.1 1.5 1.5 1.5 1.5

(u (u (u (u (u (u (u (u

0.817341) 0.255154) 0.296613) 0.719944) 0.256030) 0.694468) 0.205608) 0.765057)

s_solid_face1_list = "Solid 1.1" s_solid_face2_list = "Solid 1.5" #

Main Index

Create a solid.

(v (v (v (v (v (v (v (v

0.113631)" 0.128562)" 0.659205)" 0.636695)" 0.779096)" 0.619849)" 0.381275)" 0.218996)"

Chapter 3: Geometry Functions 571 Construct Actions

i_return_value = sgm_const_solid_decompose ( s_output_ids, l_cubic, s_solid_face1_list, s_solid_face2_list, s_vertex1_list, s_vertex2_list, s_vertex3_list, s_vertex4_list, s_vertex5_list, s_vertex6_list, s_vertex7_list, s_vertex8_list, 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) #---------------------------------------------------------------------

sgm_const_solid_extrude

()

# # Purpose : This file provides an example of a call to the # function sgm_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 a 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 sgm_const_solid_extrude() # has the following arguments: # # sgm_const_solid_extrude # ( output_ids, # delta, # scale, # angle, # origin, # coord_frame, # 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] 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"

Main Index

572 PCL Reference Manual Examples Construct Actions

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" s_surface_list = "Solid 1.4" # Create a solid. i_return_value = sgm_const_solid_extrude ( s_output_ids, s_delta, r_scale, r_angle, s_origin, s_coord_frame, s_surface_list, sv_created_ids ) dump i_return_value 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) #---------------------------------------------------------------------

()

sgm_const_solid_glide # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_const_solid_glide() This file creates a creates a these two

opens a new database "new.db" and surface and two curves. Later it solid by gliding the surface on 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 sgm_const_solid_glide() has the following arguments: sgm_const_solid_glide ( output_ids, scale, glide_option, director_surface,

Chapter 3: Geometry Functions 573 Construct Actions

# 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. 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 = sgm_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) #---------------------------------------------------------------------

Main Index

574 PCL Reference Manual Examples Construct Actions

sgm_const_solid_normal

()

# # Purpose : This file provides an example of a call to the # function sgm_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 sgm_const_solid_normal() # has the following arguments: # # sgm_const_solid_normal # ( output_ids, # thickness1, # thickness2, # thickness3, # thickness4, # flip, # surface_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = ["8"] STRING s_thickness1[32] STRING s_thickness2[32] STRING s_thickness3[32] STRING s_thickness4[32] 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" l_flip = TRUE s_surface_list = "surface 1"

Main Index

@ @ @

Chapter 3: Geometry Functions 575 Construct Actions

i_return_value = sgm_const_solid_normal ( s_output_ids, s_thickness1, s_thickness2, s_thickness3, s_thickness4, 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) #--------------------------------------------------------------------.

sgm_const_solid_nsurface_v1

()

# # Purpose : This file provides an example of a call to the # function sgm_const_solid_nsurface_v1() # # 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 sgm_const_solid_nsurface_v1() # has the following arguments: # # sgm_const_solid_nsurface_v1 # ( output_ids, # param_method, # surface_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] 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",

Main Index

@ @

576 PCL Reference Manual Examples Construct Actions

"<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 ) dump i_return_value # Create a solid. s_output_ids = "8" i_param_method = 2 s_surface_list = "surface 1 2 3 4" i_return_value = sgm_const_solid_nsurface_v1 ( s_output_ids, 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) #---------------------------------------------------------------------

sgm_const_solid_nsurface_v2

()

# # Purpose : This file provides an example of a call to the # function sgm_const_solid_nsurface_v2() # # 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 sgm_const_solid_nsurface_v2() # has the following arguments: # # sgm_const_solid_nsurface_v2 # ( output_ids, # auto_orient, # param_method, # surface_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] LOGICAL l_auto_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")

Main Index

Chapter 3: Geometry Functions 577 Construct Actions

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 ) dump i_return_value # Create a solid. s_output_ids = "8" l_auto_orient = FALSE i_param_method = 2 s_surface_list = "surface 1 2 3 4" i_return_value = sgm_const_solid_nsurface_v2 ( s_output_ids, l_auto_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) #---------------------------------------------------------------------

sgm_const_solid_revolve

()

# # Purpose : This file provides an example of a call to the # function sgm_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 # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_const_solid_revolve() # has the following arguments: # # sgm_const_solid_revolve # ( output_ids, # axis, # angle, # offset, # coord_frame, # surface_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[32] = "8" STRING s_axis[32]

Main Index

578 PCL Reference Manual Examples Construct Actions

REAL r_angle REAL r_offset STRING s_coord_frame[32] 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" s_surface_list = "surface 1 2" i_return_value = sgm_const_solid_revolve ( s_output_ids, s_axis, r_angle, r_offset, s_coord_frame, s_surface_list, 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) #---------------------------------------------------------------------

()

sgm_const_surface_2curve # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_const_surface_2curve() This function creates bi_parametric surfaces 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.

Chapter 3: Geometry Functions 579 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_surface_2curve() # has the following arguments: # # sgm_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. ) 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 = sgm_const_surface_2curve ( s_output_ids, s_curve1_list, s_curve2_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @

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

Main Index

580 PCL Reference Manual Examples Construct Actions

# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_line_2point_created_ids) #---------------------------------------------------------------------

sgm_const_surface_2curve_man

()

# # Purpose : This file provides an example of a call to the # function sgm_const_surface_2curve_man() # # This function creates manifold surfaces from # 2 set of curves and a set of surfaces. # # In this example a new database is opened and a # surface ( 5 X 5 ) is created on XZ plane. Then # 2 curves are drawn in parallel plane to XZ # plane at Y = 3. Then this function is called to # create a manifold surface on "Surface 1" using # the 2 curves 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 sgm_const_surface_2curve_man() # has the following arguments: # # sgm_const_surface_2curve_man # ( output_ids, # curve1_list, # curve2_list, # surface_list, # object_surface, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_ids[2] STRING s_curve1_list[32] STRING s_curve2_list[32] STRING s_surface_list[32] LOGICAL l_object_surface STRING sv_created_ids[VIRTUAL] INTEGER i_return_value STRING sv_line_2point_created_ids[VIRTUAL] STRING sv_create_patch_xy_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 Manifold Surface

Main Index

Chapter 3: Geometry Functions 581 Construct Actions

i_return_value = @ asm_const_patch_xyz @ ( "1", "<5 0 5>", "[0 0 0]", "Coord 0", @ sv_create_patch_xy_created_ids ) i_return_value #--------------------------------------------------------------------# Create lines i_return_value = @ asm_const_line_2point @ ( "1", "[0 3 0]","[1 3 3]", 0,"",50., 1, @ sv_line_2point_created_ids ) dump i_return_value i_return_value = asm_const_line_2point ( "2", "[3 3 1]","[4 3 4]", 0,"",50., 1, sv_line_2point_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Create Surface in Manifold surfaces s_output_ids s_curve1_list s_curve2_list s_surface_list l_object_surface

= = = = =

"" "Curve 1" "Curve 2" "Surface 1" FALSE

i_return_value = sgm_const_surface_2curve_man ( s_output_ids, s_curve1_list, s_curve2_list, s_surface_list, l_object_surface, sv_created_ids ) dump i_return_value

@ @ @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_line_2point_created_ids) sys_free_string( sv_create_patch_xy_created_ids) #---------------------------------------------------------------------

sgm_const_surface_3curve_v1 # # # # # # # # # # # # # #

Main Index

Purpose

:

()

This file provides an example of a call to the function sgm_const_surface_3curve_v1() This function creates bi_parametric 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

582 PCL Reference Manual Examples Construct Actions

# menus on the menu bar. # # The function sgm_const_surface_3curve_v1() # has the following arguments: # # sgm_const_surface_3curve_v1 # ( output_ids, # param_method, # curve1_list, # curve2_list, # 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 = sgm_const_surface_3curve_v1

Main Index

@ @

Chapter 3: Geometry Functions 583 Construct Actions

(

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

@ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_line_2point_created_ids) #---------------------------------------------------------------------

sgm_const_surface_4curve_v1

()

# # Purpose : This file provides an example of a call to the # function sgm_const_surface_4curve_v1() # # This function creates bi-parametric surfaces # 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 sgm_const_surface_4curve_v1() # has the following arguments: # # sgm_const_surface_4curve_v1 # ( 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

Main Index

@ @

584 PCL Reference Manual Examples Construct Actions

# 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_curve1_list = "Curve 1" s_curve2_list = "Curve 2" s_curve3_list = "Curve 3" s_curve4_list = "Curve 4" i_return_value = sgm_const_surface_4curve_v1 ( 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) #---------------------------------------------------------------------

()

sgm_const_surface_ncurve_v1 # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_const_surface_ncurve_v1() This function creates bi-parametric surfaces from a specified set of curves. In this example a new database is opened and 5 curves are drawn. Then this function is called to create a surface using the 5 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 sgm_const_surface_ncurve_v1() has the following arguments: sgm_const_surface_ncurve_v1 ( output_ids, param_method, curve_list,

Chapter 3: Geometry Functions 585 Construct Actions

# 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]"//@ "[0 15 0]","[1 0 0][3 5 5][1 3 10]"// @ "[3 10 15][5 15 0]", 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:5 " i_return_value = sgm_const_surface_ncurve_v1 ( 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) #---------------------------------------------------------------------

()

sgm_const_surface_extract # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_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.

586 PCL Reference Manual Examples Construct Actions

# # 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 sgm_const_surface_extract() # has the following arguments: # # sgm_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 surface_label(TRUE) #--------------------------------------------------------------------# 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 = sgm_const_surface_extract ( s_output_ids, s_solid_list, i_param_plane, r_param_pos, sv_created_ids ) dump i_return_value

Main Index

@ @ @ @ @ @

Chapter 3: Geometry Functions 587 Construct Actions

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_create_hpat_xyz_created_ids) #---------------------------------------------------------------------

sgm_const_surface_edge

()

# # Purpose : This file provides an example of a call to the # function sgm_const_surface_edge() # # This function creates bi-parametric surfaces # 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 sgm_const_surface_edge() # has the following arguments: # # sgm_const_surface_edge # ( 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 # 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

Main Index

588 PCL Reference Manual Examples Construct Actions

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 s_curve2_list s_curve3_list s_curve4_list

= = = = =

"" "Curve "Curve "Curve "Curve

1" 2" 3" 4"

i_return_value = sgm_const_surface_edge ( s_output_ids, s_curve1_list, s_curve2_list, s_curve3_list, s_curve4_list, sv_created_ids ) dump i_return_value

@ @ @ @ @ @ @

#--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_created_ids) sys_free_string( sv_line_2point_created_ids) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 589 Disassemble Actions

Chapter 3: Geometry Functions Chapter 3: Geometry Functions PCL Reference Manual Examples

Disassemble Actions This section contains examples of some of the functions used to implement the “Disassemble” actions. sgm_disassemble_chain

()

# # Purpose : This file provides an example of a call to the # function sgm_disassemble_chain() # # In this illustration, a new database is opened # 2 lines are created. Then the two curves are # joined to create a chain of curves. Finally # the function is called to disassemble the 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 sgm_disassemble_chain() # has the following arguments: # # sgm_disassemble_chain # ( curve_list, # delete_orig ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_list[128] LOGICAL l_delete_orig INTEGER i_return_value STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] INTEGER i_sgm_create_curve_cha_seg_id STRING sv_sgm_create_curve_ch_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the curves curve_label(TRUE) # Create 2 curves i_return_value = asm_const_line_xyz( "", "<1 0 0><0 1 0>", "[0 0 0][0 0 0]", "Coord 0", sv_asm_create_line_xyz_creat_id ) dump i_return_value

@ @ @

# Create a chain of curve using Curve 1 2. Delete the original # curves. i_return_value = @ sgm_create_curve_chain_v1( "", "Curve 1 2 ", @ TRUE, i_sgm_create_curve_cha_seg_id, @ sv_sgm_create_curve_ch_creat_id ) $? YES 38000217 dump i_return_value # Observe the Curve 3. It is a chain. # Session file paused. Press "Resume" to continue.... sf_pause()

Main Index

590 PCL Reference Manual Examples Disassemble Actions

#--------------------------------------------------------------------# Disassemble the Curve 3 into Curve 4 & 5. Delete the Curve 3. # s_curve_list = "Curve 3" l_delete_orig = TRUE i_return_value = sgm_disassemble_chain ( s_curve_list, l_delete_orig ) $? YES 38000217 dump i_return_value

@ @ @

sys_free_string( sv_asm_create_line_xyz_creat_id ) sys_free_string( sv_sgm_create_curve_ch_creat_id ) #---------------------------------------------------------------------

sgm_disassemble_tsurf

()

# # Purpose : This file provides an example of a call to the # function sgm_disassemble_tsurf() # # In this illustration, a new database is opened. # A trimmed surface is created. The function is # called to disassemble the trimmed surface into # its parent surface and edge 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 sgm_disassemble_tsurf() # has the following arguments: # # sgm_disassemble_tsurf # ( surface_list, # delete_orig ) # #--------------------------------------------------------------------# Variable Declarations STRING s_surface_list[128] LOGICAL l_delete_orig INTEGER i_return_value STRING s_output_ids[128] STRING s_curveo_list[128] STRING s_curvei_list[128] STRING s_surface[128] LOGICAL l_delete_ocurve LOGICAL l_delete_icurve LOGICAL l_delete_surf STRING sv_created_ids[VIRTUAL] INTEGER i_sgm_create_curve_aut_segt_id STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_asm_line_2point_creat_id[VIRTUAL] STRING sv_sgm_create_curve_2d_creat_id[VIRTUAL] STRING sv_sgm_creat_cur_creat_curve_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the surfaces and curves. surface_label(TRUE)

Main Index

Chapter 3: Geometry Functions 591 Disassemble Actions

curve_label(TRUE) # Create a patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value

@ @ @

# Create 4 points. i_return_value = asm_const_grid_xyz( "", "[5 0 0] [0 5 0] "// "[5 10 0][10 5 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id dump i_return_value

@ @ @ )

# Create 4 curves. i_return_value = asm_const_line_2point( "", "Point 5:8 ", "Point 6 7 8 5", 0, "", 50., 1, sv_asm_line_2point_creat_id ) dump i_return_value

@ @ @

# Create a circular curve. i_return_value = sgm_const_curve_2d_circle_v1( "", 1, 1., "Coord 0.3", "", "[5 5 0]", TRUE , sv_sgm_create_curve_2d_creat_id ) dump i_return_value # Convert the Curve 1:4 into a chain curve. i_return_value = sgm_create_curve_chain_v1( "10", " Curve 1:4", TRUE, i_sgm_create_curve_aut_segt_id, sv_sgm_creat_cur_creat_curve_id ) $? YES 38000217

@ @ @

@ @ @ @

# Observe the curves and the surface. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to create a trimmed surface inside Surface 1 # with Curve 10 as outer boundary trim curve and Curve 5 as inner # boundary trim curve. # s_output_ids = "2" s_curveo_list = "Curve 10" s_curvei_list = "Curve 5" s_surface = "Surface 1" l_delete_ocurve = TRUE l_delete_icurve = TRUE l_delete_surf = TRUE i_return_value = sgm_create_surface_trimmed ( s_output_ids, s_curveo_list, s_curvei_list, s_surface, l_delete_ocurve, l_delete_icurve, l_delete_surf, sv_created_ids ) $? YES 38000217 $? YES 38000217 $? YES 38000219 dump i_return_value

Main Index

@ @ @ @ @ @ @ @ @

592 PCL Reference Manual Examples Disassemble Actions

# Created surface is dump sv_created_ids # Observe the trimmed surface created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to disassemble the trimmed surface into its # parent surface. # s_surface_list = "Surface 2" l_delete_orig = TRUE i_return_value = sgm_disassemble_tsurf ( s_surface_list, l_delete_orig ) $? YES 38000219 dump i_return_value sys_free_string( sys_free_string( sys_free_string( sys_free_string( sys_free_string( sys_free_string(

@ @ @

sv_created_ids ) sv_asm_create_patch_xy_creat_id sv_asm_create_grid_xyz_creat_id sv_asm_line_2point_creat_id ) sv_sgm_create_curve_2d_creat_id sv_sgm_creat_cur_creat_curve_id

) ) ) )

# Press "Refresh Graphics" radio button to repaint the graphics # window. #---------------------------------------------------------------------

sgm_disassemble_solid

()

# # Purpose : This file provides an example of a call to the # function sgm_disassemble_solid() # # In this illustration, a new database is opened. # A solid is created. Then the function is called # to disassemble the solid into its subordinate # surface faces. # # This file can be run 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_disassemble_solid() # has the following arguments: # # sgm_disassemble_solid # ( solid_list, # delete_orig, # crtd_lab ) #--------------------------------------------------------------------# Variable Declarations STRING s_solid_list[128] LOGICAL l_delete_orig STRING sv_crtd_lab[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_hpat_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002

Main Index

Chapter 3: Geometry Functions 593 Disassemble Actions

# Show the labels of the surfaces and solids. surface_label(TRUE) solid_label(TRUE) i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_creat_id ) dump i_return_value

@ @ @

# Change the view ga_view_aa_set( -67., 0., -34. ) # Observe the solid created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to disassemble the solid into its subordinate # surface faces. # s_solid_list = " Solid 1" l_delete_orig = TRUE i_return_value = sgm_disassemble_solid ( s_solid_list, l_delete_orig, sv_crtd_lab ) dump i_return_value

@ @ @ @

# The surfaces created dump sv_crtd_lab sys_free_string( sv_crtd_lab ) sys_free_string( sv_asm_create_hpat_xyz_creat_id ) #--------------------------------------------------------------------Associate Actions This section contains examples of some of the functions used to implement the “Associate” actions.

()

sgm_associate_point_curve # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_associate_point_curve() This illustration opens a new database and creates 3 points in it. Using Point 1 and 2, it creates a line. Finally the function is called to associate Point 3 to Curve 1. This file can be run 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_associate_point_curve() has the following arguments: sgm_associate_point_curve ( point_list, curve_list, joined_list )

594 PCL Reference Manual Examples Disassemble Actions

#--------------------------------------------------------------------# Variable Declarations STRING s_point_list[128] STRING s_curve_list[128] STRING sv_joined_list[VIRTUAL] INTEGER i_return_value STRING sv_asm_line_2point_created_id[VIRTUAL] STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of Curves and Points. curve_label(TRUE) point_label(TRUE) # Create 3 points. i_return_value = asm_const_grid_xyz ( "", "[0 0 0][10 0 0][5 0 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id ) dump i_return_value # Create a line between Point 1 and 2. i_return_value = asm_const_line_2point( "", "Point 1", "Point 2", 0, "", 50., 1, sv_asm_line_2point_created_id ) dump i_return_value # #

@ @ @ @

@ @ @

Observe the Curve 1 and Point 3 on it. Note that Point 3 is not associated to the Curve 1.

# Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to associate Point 3 to Curve 1. # s_point_list = "Point 3" s_curve_list = "Curve 1" i_return_value = sgm_associate_point_curve ( s_point_list, s_curve_list, sv_joined_list ) dump i_return_value

@ @ @ @

# Joined entities are dump sv_joined_list sys_free_string( sv_joined_list ) sys_free_string( sv_asm_line_2point_created_id ) sys_free_string( sv_asm_create_grid_xyz_creat_id ) #---------------------------------------------------------------------

()

sgm_associate_point_surface # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_associate_point_surface() This illustration opens a new database and creates a Patch in it. Four points are created

Chapter 3: Geometry Functions 595 Disassemble Actions

# on that patch. Function is called to associate # the points to the patch. # # This file can be run 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_associate_point_surface() # has the following arguments: # # sgm_associate_point_surface # ( point_list, # surface_list, # joined_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_point_list[128] STRING s_surface_list[128] STRING sv_joined_list[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of Points and Surfaces. point_label(TRUE) surface_label(TRUE) # Create a Patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value # Create 4 points. i_return_value = asm_const_grid_xyz ( "", "[5 0 0][10 5 0][0 5 0][5 10 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id ) dump i_return_value

@ @ @

@ @ @ @

# Observe the Patch and the Points. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to associate Point 5:8 to Surface 1. # s_point_list = "Point 5:8" s_surface_list = "Surface 1" i_return_value = sgm_associate_point_surface ( s_point_list, s_surface_list, sv_joined_list ) dump i_return_value # List of joined entities dump sv_joined_list sys_free_string( sv_joined_list )

Main Index

@ @ @ @

596 PCL Reference Manual Examples Disassemble Actions

sys_free_string( sv_asm_create_grid_xyz_creat_id ) sys_free_string( sv_asm_create_patch_xy_creat_id ) #---------------------------------------------------------------------

sgm_associate_curve_curve

()

# # Purpose : This file provides an example of a call to the # function sgm_associate_curve_curve() # # This illustration opens a new database and # creates two curves in it. Then it calls the # function to associate Curve 1 to Curve 2. # # This file can be run 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_associate_curve_curve() # has the following arguments: # # sgm_associate_curve_curve # ( curve_list1, # curve_list2, # joined_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_list1[128] STRING s_curve_list2[128] STRING sv_joined_list[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the curve labels. curve_label(TRUE) # Create 2 Curves i_return_value = @ asm_const_line_xyz( "", "<5 0 0><10 0 0>", @ "[0 0 0][0 0 0]", "Coord 0", @ sv_asm_create_line_xyz_creat_id ) dump i_return_value #--------------------------------------------------------------------# Associate Curve 1 to Curve 2. # s_curve_list1 = "Curve 1" s_curve_list2 = "Curve 2" i_return_value = sgm_associate_curve_curve ( s_curve_list1, s_curve_list2, sv_joined_list ) dump i_return_value

@ @ @ @

# Joined curves are dump sv_joined_list sys_free_string( sv_joined_list ) sys_free_string( sv_asm_create_line_xyz_creat_id )

Main Index

Chapter 3: Geometry Functions 597 Disassemble Actions

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

sgm_associate_curve_surface

()

# # Purpose : This file provides an example of a call to the # function sgm_associate_curve_surface() # # This illustration opens a new database and # creates a Curve and a Surface in it. Then it # calls the function to associate Curve 1 to # Surface 1. # # This file can be run 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_associate_curve_surface() # has the following arguments: # # sgm_associate_curve_surface # ( curve_list, # surface_list, # joined_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_list[128] STRING s_surface_list[128] STRING sv_joined_list[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of Curves and Surfaces. curve_label(TRUE) surface_label(TRUE) # Create a Curve. i_return_value = asm_const_line_xyz( "", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_line_xyz_creat_id ) dump i_return_value # Create a Patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value

@ @ @

@ @ @

# Observe the Patch and the Curve. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to associate Curve 1 to Surface 1. # s_curve_list = " Curve 1" s_surface_list = " Surface 1 "

Main Index

598 PCL Reference Manual Examples Disassemble Actions

i_return_value = sgm_associate_curve_surface ( s_curve_list, s_surface_list, sv_joined_list ) dump i_return_value

@ @ @ @

# Joined entities. dump sv_joined_list sys_free_string( sv_joined_list ) sys_free_string( sv_asm_create_line_xyz_creat_id ) sys_free_string( sv_asm_create_patch_xy_creat_id ) #--------------------------------------------------------------------Disassociate Actions This section contains examples of some of the functions used to implement the “Disassociate” actions.

sgm_disassociate_point

()

# # Purpose : This file provides an example of a call to the # function sgm_disassociate_point() # # This illustration opens a new database and # creates a patch in it. It calls the function # to disassociate the 4 Points associated with # the patch 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 sgm_disassociate_point() # has the following arguments: # # sgm_disassociate_point # ( point_list, # entity_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_point_list[128] STRING sv_entity_list[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of Surfaces and Points. surface_label(TRUE) point_label(TRUE) # Create a Patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value # #

Main Index

@ @ @

Observe the patch created. When Patch is created in XYZ method, 4 points also created and associated with the patch.

Chapter 3: Geometry Functions 599 Disassemble Actions

# Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to disassociate the Point 1:4 from the Surface 1. # s_point_list = "Point 1:4" i_return_value = sgm_disassociate_point ( s_point_list, sv_entity_list ) dump i_return_value

@ @ @

# List of disassociated entities dump sv_entity_list sys_free_string( sv_entity_list ) sys_free_string( sv_asm_create_patch_xy_creat_id ) #---------------------------------------------------------------------

sgm_disassociate_curve

()

# # Purpose : This file provides an example of a call to the # function sgm_disassociate_curve() # # This illustration opens a new database and # creates a curve and a patch in it. It # associates the curve to the patch. Finally # it calls the function to disassociate the # curve from the patch. # # This file can be run 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_disassociate_curve() # has the following arguments: # # sgm_disassociate_curve # ( curve_list, # entity_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_list[128] STRING sv_entity_list[VIRTUAL] INTEGER i_return_value STRING s_curve_list[128] STRING s_surface_list[128] STRING sv_joined_list[VIRTUAL] STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of Surfaces and Curves. surface_label(TRUE) curve_label(TRUE) # Create a Curve. i_return_value = asm_const_line_xyz( "", "<10 10 0>",

Main Index

@ @

600 PCL Reference Manual Examples Disassemble Actions

"[0 0 0]", "Coord 0", sv_asm_create_line_xyz_creat_id ) dump i_return_value # Create a Patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value

@

@ @ @

# Associate Curve 1 to Surface 1. # s_curve_list = " Curve 1" s_surface_list = " Surface 1 " i_return_value = sgm_associate_curve_surface ( s_curve_list, s_surface_list, sv_joined_list ) dump i_return_value

@ @ @ @

# Observe that Curve 1 is associated to Surface 1. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to disassociate the Curve 1 from the Surface 1. # s_curve_list = "Curve 1" i_return_value = sgm_disassociate_curve ( s_curve_list, sv_entity_list ) dump i_return_value

@ @ @

# List of the disassociated entities dump sv_entity_list sys_free_string( sv_joined_list ) sys_free_string( sv_entity_list ) sys_free_string( sv_asm_create_line_xyz_creat_id ) sys_free_string( sv_asm_create_patch_xy_creat_id ) #---------------------------------------------------------------------

()

sgm_disassociate_surface # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_disassociate_surface() This illustration opens a new database and creates one curve and Surface in it. It associates the curve to the surface. Finally it calls the function to disassociate the 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_disassociate_surface() has the following arguments:

Chapter 3: Geometry Functions 601 Disassemble Actions

# sgm_disassociate_surface # ( surface_list, # entity_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_surface_list[128] STRING sv_entity_list[VIRTUAL] INTEGER i_return_value STRING s_curve_list[128] STRING s_surface_list[128] STRING sv_joined_list[VIRTUAL] STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of Curves and Surfaces. curve_label(TRUE) surface_label(TRUE) # Create a Curve. i_return_value = asm_const_line_xyz( "", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_line_xyz_creat_id ) dump i_return_value # Create a Patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value

@ @ @

@ @ @

# Call the function to associate Curve 1 to Surface 1. s_curve_list = " Curve 1" s_surface_list = " Surface 1 " i_return_value = sgm_associate_curve_surface ( s_curve_list, s_surface_list, sv_joined_list ) dump i_return_value

@ @ @ @

# Observe that the Curve 1 is associated to Surface 1. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to disassociate the Surface 1. # s_surface_list = "Surface 1" i_return_value = sgm_disassociate_surface ( s_surface_list, sv_entity_list ) dump i_return_value

@ @ @

# List of the disassociated entities dump sv_entity_list sys_free_string( sv_entity_list ) sys_free_string( sv_joined_list ) sys_free_string( sv_asm_create_line_xyz_creat_id )

Main Index

602 PCL Reference Manual Examples Disassemble Actions

sys_free_string( sv_asm_create_patch_xy_creat_id ) #--------------------------------------------------------------------Sweep Actions This section contains examples of some of the functions used to implement the “Sweep” actions.

asm_sweep_hpat_arc

()

# # Purpose : This file provides an example of a call to the # function asm_sweep_hpat_arc() # # This illustration opens a new database and # creates a Surface in it. Then the Surface is # swept to create the hpat. # # This file can be run 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_sweep_hpat_arc() # has the following arguments: # # asm_sweep_hpat_arc # ( hpat_labels, # axis, # angle, # offset, # coord_frame, # num_hpats, # surface_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_hpat_labels[128] STRING s_axis[128] REAL r_angle REAL r_offset STRING s_coord_frame[128] INTEGER i_num_hpats STRING s_surface_list[128] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the surfaces and solids. surface_label(TRUE) solid_label(TRUE) # Create a patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value # Change the view. ga_view_aa_set( -67., 0., -34. ) #

Main Index

Observe the surface created.

@ @ @

Chapter 3: Geometry Functions 603 Disassemble Actions

# Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to sweep the Surface 1 about Coord 0.2 to create # a hpat. # s_hpat_labels = "1" s_axis = "Coord 0.2" r_angle = 90.0 r_offset = 0.0 s_coord_frame = "Coord 0" i_num_hpats = 1 s_surface_list = "Surface 1" i_return_value = asm_sweep_hpat_arc ( s_hpat_labels, s_axis, r_angle, r_offset, s_coord_frame, i_num_hpats, s_surface_list, sv_created_labels ) dump i_return_value

@ @ @ @ @ @ @ @ @

# Labels of the hpats created dump sv_created_labels sys_free_string( sv_created_labels ) sys_free_string( sv_asm_create_patch_xy_creat_id ) #---------------------------------------------------------------------

asm_sweep_hpat_extrude

()

# # Purpose : This file provides an example of two calls to # the function asm_sweep_hpat_extrude() # # This illustration opens a new database and # creates a Surface in it. Then the Surface is # extruded to create the hpat. # # This file can be run 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_sweep_hpat_extrude() # has the following arguments: # # asm_sweep_hpat_extrude # ( hpat_labels, # delta, # scaleu, # scalev, # angle, # origin, # coord_frame, # num_hpats, # patch_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_hpat_labels[128]

Main Index

604 PCL Reference Manual Examples Disassemble Actions

STRING s_delta[128] REAL r_scaleu REAL r_scalev REAL r_angle STRING s_origin[128] STRING s_coord_frame[128] INTEGER i_num_hpats STRING s_patch_list[128] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the surfaces and solids. surface_label(TRUE) solid_label(TRUE) # Create a patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value

@ @ @

# Change the view. ga_view_aa_set( -67., 0., -34. ) # Observe the surface created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to create hyperpatch by extruding Surface 1. # s_hpat_labels = "" s_delta = "<0 0 10>" r_scaleu = 1.0 r_scalev = 1.0 r_angle = 0.0 s_origin = "[0 0 0]" s_coord_frame = "Coord 0" i_num_hpats = 1 s_patch_list = "Surface 1" i_return_value = asm_sweep_hpat_extrude ( s_hpat_labels, s_delta, r_scaleu, r_scalev, r_angle, s_origin, s_coord_frame, i_num_hpats, s_patch_list, sv_created_labels ) dump i_return_value

@ @ @ @ @ @ @ @ @ @ @

# Labels of the created hyperpatch dump sv_created_labels # Observe the hpat created. # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Call the function to create hyperpatch by extruding Surface 1 with

Main Index

Chapter 3: Geometry Functions 605 Disassemble Actions

# scaling and rotation. # s_hpat_labels = "" s_delta = "<0 0 -10>" r_scaleu = 0.5 r_scalev = 0.5 r_angle = 30.0 s_origin = "[5 5 0]" s_coord_frame = "Coord 0" i_num_hpats = 1 s_patch_list = "Surface 1" i_return_value = asm_sweep_hpat_extrude ( s_hpat_labels, s_delta, r_scaleu, r_scalev, r_angle, s_origin, s_coord_frame, i_num_hpats, s_patch_list, sv_created_labels ) dump i_return_value

@ @ @ @ @ @ @ @ @ @ @

# Labels of the created hyperpatch dump sv_created_labels sys_free_string( sv_asm_create_patch_xy_creat_id ) sys_free_string( sv_created_labels ) #---------------------------------------------------------------------

asm_sweep_hpat_glide

()

# # Purpose : This file provides an example of a call to the # function asm_sweep_hpat_glide() # # This illustration opens a new database and # creates a Surface and a line in it. Then the # Surface is glided to create the hpat. # # This file can be run 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_sweep_hpat_glide() # has the following arguments: # # asm_sweep_hpat_glide # ( hpat_labels, # scale, # glide_option, # director_line, # base_patch, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_hpat_labels[128] REAL r_scale INTEGER i_glide_option STRING s_director_line[128] STRING s_base_patch[128]

Main Index

606 PCL Reference Manual Examples Disassemble Actions

STRING sv_created_labels[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the curves, surfaces and solids. curve_label(TRUE) surface_label(TRUE) solid_label(TRUE) # Create a patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value i_return_value = asm_const_line_xyz( "1", "< 0 5 10>", "[5 5 0]", "Coord 0", sv_asm_create_line_xyz_creat_id )

@ @ @

@ @ @

# Change the view. ga_view_aa_set( -67., 0., -34. ) # Observe the surface and line created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to create the hyperpatch by gliding Surface 1 # along Line 1. # s_hpat_labels = "" r_scale = 1.0 i_glide_option = 0 s_director_line = "Line 1" s_base_patch = "Surface 1" i_return_value = asm_sweep_hpat_glide ( s_hpat_labels, r_scale, i_glide_option, s_director_line, s_base_patch, sv_created_labels ) dump i_return_value

@ @ @ @ @ @ @

# Label of the hyperpatch created dump sv_created_labels sys_free_string( sv_created_labels ) sys_free_string( sv_asm_create_patch_xy_creat_id ) sys_free_string( sv_asm_create_line_xyz_creat_id ) #---------------------------------------------------------------------

()

asm_sweep_hpat_normal # # # #

Main Index

Purpose

:

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

Chapter 3: Geometry Functions 607 Disassemble Actions

# This illustration opens a new database and # creates a Surface in it. Then hyperpatch is # created with the various thickness. # # This file can be run 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_sweep_hpat_normal() # has the following arguments: # # asm_sweep_hpat_normal # ( hpat_labels, # thickness1, # thickness2, # thickness3, # thickness4, # num_patch, # flip, # surface_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_hpat_labels[128] STRING s_thickness1[128] STRING s_thickness2[128] STRING s_thickness3[128] STRING s_thickness4[128] INTEGER i_num_patch LOGICAL l_flip STRING s_surface_list[128] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the surface_label(TRUE) solid_label(TRUE)

surfaces and solids.

# Create a patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value

@ @ @

# Change the view. ga_view_aa_set( -67., 0., -34. ) # Observe the surface created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to create a hyperpatch with varying thickness and # flip is set to FALSE. # s_hpat_labels = "" s_thickness1 = "1.0" s_thickness2 = "2.0" s_thickness3 = "3.0" s_thickness4 = "4.0" i_num_patch = 1

Main Index

608 PCL Reference Manual Examples Disassemble Actions

l_flip = FALSE s_surface_list = "Surface 1" i_return_value = asm_sweep_hpat_normal ( s_hpat_labels, s_thickness1, s_thickness2, s_thickness3, s_thickness4, i_num_patch, l_flip, s_surface_list, sv_created_labels ) dump i_return_value

@ @ @ @ @ @ @ @ @ @

# Label of the hyperpatch created dump sv_created_labels # Observe the hpat created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to create a hyperpatch with varying thickness # with flip is set to TRUE. # s_thickness1 = "4.0" s_thickness2 = "3.0" s_thickness3 = "2.0" s_thickness4 = "1.0" l_flip = TRUE i_return_value = asm_sweep_hpat_normal ( s_hpat_labels, s_thickness1, s_thickness2, s_thickness3, s_thickness4, i_num_patch, l_flip, s_surface_list, sv_created_labels ) dump i_return_value

@ @ @ @ @ @ @ @ @ @

# Label of the hyperpatch created dump sv_created_labels sys_free_string( sv_created_labels ) sys_free_string( sv_asm_create_patch_xy_creat_id ) #---------------------------------------------------------------------

()

asm_sweep_line_arc # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function asm_sweep_line_arc() This illustration opens a new database and creates a point in it. Then the point is arced to create a line. This file can be run by starting a session of Patran and running this session file through the "File","Session","Play" pulldown

Chapter 3: Geometry Functions 609 Disassemble Actions

# menus on the menu bar. # # The function asm_sweep_line_arc() # has the following arguments: # # asm_sweep_line_arc # ( line_labels, # axis, # angle, # offset, # coord_frame, # num_lines, # point_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_line_labels[128] STRING s_axis[128] REAL r_angle REAL r_offset STRING s_coord_frame[128] INTEGER i_num_lines STRING s_point_list[128] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the curves. curve_label(TRUE) # Change the view. ga_view_aa_set( -67., 0., -34. ) # Create a point. i_return_value = @ asm_const_grid_xyz( "", "[10 0 0 ] ", @ "Coord 0", @ sv_asm_create_grid_xyz_creat_id ) dump i_return_value #--------------------------------------------------------------------# Call the function to create 2 lines by arcing the point 1 # s_line_labels = "" s_axis = "Coord 0.3" r_angle = 180.0 r_offset = 0.0 s_coord_frame = "Coord 0" i_num_lines = 2 s_point_list = "Point 1" i_return_value = asm_sweep_line_arc ( s_line_labels, s_axis, r_angle, r_offset, s_coord_frame, i_num_lines, s_point_list, sv_created_labels ) dump i_return_value #

Main Index

Labels of the lines created

@ @ @ @ @ @ @ @ @

610 PCL Reference Manual Examples Disassemble Actions

dump sv_created_labels sys_free_string( sv_created_labels ) sys_free_string( sv_asm_create_grid_xyz_creat_id ) #---------------------------------------------------------------------

asm_sweep_line_involute

()

# # Purpose : This file provides an example of two calls to # the function asm_sweep_line_involute() # # This illustration opens a new database and # creates a line by involute option with angle # method. Again it calls the function to create # another line using involute option with radii # method. # # This file can be run 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_sweep_line_involute() # has the following arguments: # # asm_sweep_line_involute # ( line_labels, # axis, # option, # scalar1, # scalar2, # num_lines, # coord_frame, # point_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_line_labels[128] STRING s_axis[128] INTEGER i_option REAL r_scalar1 REAL r_scalar2 INTEGER i_num_lines STRING s_coord_frame[128] STRING s_point_list[128] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the curves. curve_label(TRUE) # Change the view. ga_view_aa_set( -67., 0., -34. ) #--------------------------------------------------------------------# Call the function to create a line by involute option with angle # method. # s_line_labels = "" s_axis = "Coord 0.3" i_option = 0

Main Index

Chapter 3: Geometry Functions 611 Disassemble Actions

r_scalar1 = 360.0 r_scalar2 = 0.0 i_num_lines = 1 s_coord_frame = "Coord 0" s_point_list = "[10 0 0]" i_return_value = asm_sweep_line_involute ( s_line_labels, s_axis, i_option, r_scalar1, r_scalar2, i_num_lines, s_coord_frame, s_point_list, sv_created_labels ) dump i_return_value

@ @ @ @ @ @ @ @ @ @

# Created Curve dump sv_created_labels # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to create a line by involute option with radii # method. # s_line_labels = "" s_axis = "Coord 0.3" i_option = 1 r_scalar1 = 5.0 r_scalar2 = 120.0 i_num_lines = 1 s_coord_frame = "Coord 0" s_point_list = "[10 0 0]" i_return_value = asm_sweep_line_involute ( s_line_labels, s_axis, i_option, r_scalar1, r_scalar2, i_num_lines, s_coord_frame, s_point_list, sv_created_labels ) dump i_return_value

@ @ @ @ @ @ @ @ @ @

# Created Curve dump sv_created_labels sys_free_string( sv_created_labels ) #---------------------------------------------------------------------

()

asm_sweep_patch_arc # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function asm_sweep_patch_arc() This illustration opens a new database and creates a line in it. Then that line is arced to create two patches.

612 PCL Reference Manual Examples Disassemble 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_sweep_patch_arc() has the following arguments: # # asm_sweep_patch_arc # ( patch_labels, # axis, # angle, # offset, # coord_frame, # num_patch, # curve_list, # created_labels ) #--------------------------------------------------------------------# Variable Declarations STRING s_patch_labels[128] STRING s_axis[128] REAL r_angle REAL r_offset STRING s_coord_frame[128] INTEGER i_num_patch STRING s_curve_list[128] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the curves and surfaces. curve_label(TRUE) surface_label(TRUE) # Change the view. ga_view_aa_set( -67., 0., -34. ) # Create a Line i_return_value = asm_const_line_xyz( "1", "<10 0 0>", "[10 0 0]", "Coord 0", sv_asm_create_line_xyz_creat_id ) dump i_return_value

@ @ @

# Observe the line created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to arc the line to create two patches. # s_patch_labels = "" s_axis = "Coord 0.3" r_angle = 180.0 r_offset = 0.0 s_coord_frame = "Coord 0" i_num_patch = 2 s_curve_list = "Curve 1" i_return_value = asm_sweep_patch_arc ( s_patch_labels, s_axis, r_angle, r_offset, s_coord_frame,

Main Index

@ @ @ @ @ @ @

Chapter 3: Geometry Functions 613 Disassemble Actions

i_num_patch, s_curve_list, sv_created_labels ) dump i_return_value

@ @

# Labels of the created patches. dump sv_created_labels sys_free_string( sv_created_labels ) sys_free_string( sv_asm_create_line_xyz_creat_id ) #---------------------------------------------------------------------

asm_sweep_patch_extrude

()

# # Purpose : This file provides an example of a call to the # function asm_sweep_patch_extrude() # # This illustration opens a new database and # creates a Line in it. Then the line is # extruded to create the patch. # # This file can be run 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_sweep_patch_extrude() # has the following arguments: # # asm_sweep_patch_extrude # ( patch_labels, # delta, # scale, # angle, # origin, # coord_frame, # num_patches, # curve_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_patch_labels[128] STRING s_delta[128] REAL r_scale REAL r_angle STRING s_origin[128] STRING s_coord_frame[128] INTEGER i_num_patches STRING s_curve_list[128] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the curves and surfaces. curve_label(TRUE) surface_label(TRUE) # Change the view. ga_view_aa_set( -67., 0., -34. )

Main Index

614 PCL Reference Manual Examples Disassemble Actions

# Create a Line i_return_value = asm_const_line_xyz( "1", "<10 0 0>", "[10 0 0]", "Coord 0", sv_asm_create_line_xyz_creat_id ) dump i_return_value

@ @ @

# Observe the surface created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to create a patch by extruding Line 1. # s_patch_labels = "" s_delta = "<0 0 10>" r_scale = 1.0 r_angle = 0.0 s_origin = "[0 0 0]" s_coord_frame = "Coord 0" i_num_patches = 1 s_curve_list = "Curve 1" i_return_value = asm_sweep_patch_extrude ( s_patch_labels, s_delta, r_scale, r_angle, s_origin, s_coord_frame, i_num_patches, s_curve_list, sv_created_labels ) dump i_return_value

@ @ @ @ @ @ @ @ @ @

# Labels of the created patches. dump sv_created_labels sys_free_string( sv_created_labels ) sys_free_string( sv_asm_create_line_xyz_creat_id ) #---------------------------------------------------------------------

()

asm_sweep_patch_glide # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function asm_sweep_patch_glide() This illustration opens a new database and creates two Curves in it. Then one Curve is glided along the other to create the patch. This file can be run 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_sweep_patch_glide() has the following arguments: asm_sweep_patch_glide ( patch_labels, scale, glide_option, director_line,

Chapter 3: Geometry Functions 615 Disassemble Actions

# base_line, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_patch_labels[128] REAL r_scale INTEGER i_glide_option STRING s_director_line[128] STRING s_base_line[128] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the curves, surfaces. curve_label(TRUE) surface_label(TRUE) # Create a line i_return_value = @ asm_const_line_xyz( "", "< 3 4 0 >< 0 5 10>", @ "[3 0 0][5 5 0]", "Coord 0", @ sv_asm_create_line_xyz_creat_id ) dump i_return_value # Change the view. ga_view_aa_set( -67., 0., -34. ) # Observe the line created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to create a patch by gliding Curve 1 along # Curve 2. # s_patch_labels = "" r_scale = 1.0 i_glide_option = 0 s_director_line = "Curve 2" s_base_line = "Curve 1" i_return_value = asm_sweep_patch_glide ( s_patch_labels, r_scale, i_glide_option, s_director_line, s_base_line, sv_created_labels ) dump i_return_value

@ @ @ @ @ @ @

# Label of the patch created dump sv_created_labels sys_free_string( sv_created_labels ) sys_free_string( sv_asm_create_line_xyz_creat_id ) #---------------------------------------------------------------------

()

asm_sweep_patch_normal # #

Main Index

Purpose

:

This file provides an example of a call to the

616 PCL Reference Manual Examples Disassemble Actions

# function asm_sweep_patch_normal() # # This illustration opens a new database and # creates a line in it. Then the function is # called to create a patch normal to the line # 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_sweep_patch_normal() # has the following arguments: # # asm_sweep_patch_normal # ( patch_labels, # thickness1, # thickness2, # origin, # num_patch, # flip, # curve_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_patch_labels[128] STRING s_thickness1[128] STRING s_thickness2[128] STRING s_origin[128] INTEGER i_num_patch LOGICAL l_flip STRING s_curve_list[128] STRING sv_created_labels[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the surface_label(TRUE) curve_label(TRUE)

surfaces and curves.

# Create a line i_return_value = asm_const_line_xyz( "", "< 10 5 0>", "[5 5 0]", "Coord 0", sv_asm_create_line_xyz_creat_id ) dump i_return_value

@ @ @

# Change the view. ga_view_aa_set( -67., 0., -34. ) # Observe the curve created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to create a patch with varying thickness and # flip is set to TRUE. # s_patch_labels = "" s_thickness1 = "10.0" s_thickness2 = "20.0" s_origin = "[0 0 0]" i_num_patch = 1

Main Index

Chapter 3: Geometry Functions 617 Disassemble Actions

l_flip = TRUE s_curve_list = "Curve 1" i_return_value = asm_sweep_patch_normal ( s_patch_labels, s_thickness1, s_thickness2, s_origin, i_num_patch, l_flip, s_curve_list, sv_created_labels ) dump i_return_value

@ @ @ @ @ @ @ @ @

# Label of the patch created dump sv_created_labels sys_free_string( sv_created_labels ) sys_free_string( sv_asm_create_line_xyz_creat_id ) #--------------------------------------------------------------------Transform Actions This section contains examples of some of the functions used to implement the “Transform” actions.

asm_transform_cord_rotate

()

# # Purpose : This file provides an example of a call to the # function asm_transform_cord_rotate() # # This file opens a new database "new.db" and # creates a coordinate frame with label = 8 # by rotating the reference coordinate frame # by 45 degrees about the "[0 0 0][1 1 1]" 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 asm_transform_cord_rotate() # has the following arguments: # # asm_transform_cord_rotate # ( output_labels, # axis, # angle, # offset, # coord_frame, # nrepeat, # delete_orig, # coord_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_labels[32] STRING s_axis[32] REAL r_angle REAL r_offset STRING s_coord_frame[32] INTEGER i_nrepeat LOGICAL l_delete_orig STRING s_coord_list[32]

Main Index

618 PCL Reference Manual Examples Disassemble Actions

STRING sv_created_labels[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.) s_output_labels s_axis r_angle r_offset s_coord_frame i_nrepeat l_delete_orig s_coord_list

="8" = "{[0 0 0] [1 1 1]}" = 45.0 = 0.0 = "coord 0" = 1 = FALSE = "coord 0"

i_return_value = asm_transform_cord_rotate ( s_output_labels, s_axis, r_angle, r_offset, s_coord_frame, i_nrepeat, l_delete_orig, s_coord_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) #---------------------------------------------------------------------

asm_transform_cord_translate

()

# # Purpose : This file provides an example of a call to the # function asm_transform_cord_translate() # # This file opens a new database "new.db" and # creates two coordinate frames with label = 8 # and 9 by translating the reference coordinate # frame. # # This file can be run 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_transform_cord_translate() # has the following arguments: # # asm_transform_cord_translate # ( output_labels, # delta, # coord_frame, # nrepeat, # delete_orig, # coord_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_output_labels[32]

Main Index

Chapter 3: Geometry Functions 619 Disassemble Actions

STRING s_delta[32] STRING s_coord_frame[32] INTEGER i_nrepeat LOGICAL l_delete_orig STRING s_coord_list[32] STRING sv_created_labels[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.) s_output_labels = "8 9" s_delta = "<0.5 0 0>" s_coord_frame = "coord 0" i_nrepeat = 2 l_delete_orig = FALSE s_coord_list = "coord 0" # i_return_value = asm_transform_cord_translate ( s_output_labels, s_delta, s_coord_frame, i_nrepeat, l_delete_orig, s_coord_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) #---------------------------------------------------------------------

asm_transform_curve_vsum

()

# # Purpose : This file provides an example of a call to the # function asm_transform_curve_vsum() # # This file opens a new database "new.db" and # creates 4 curves to form a circle and 4 lines # normal to the circle. Later it creates 4 curves # by vector summing the four curves and 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_transform_curve_vsum() # has the following arguments: # # asm_transform_curve_vsum # ( curve_ids, # origin_1, # origin_2, # scales_1, # scales_2, # curve_list1, # curve_list2, # created_ids ) # #---------------------------------------------------------------------

Main Index

620 PCL Reference Manual Examples Disassemble Actions

# Variable Declarations STRING s_curve_ids[32] STRING s_origin_1[32] STRING s_origin_2[32] REAL ra_scales_1(3) REAL ra_scales_2(3) STRING s_curve_list1[32] STRING s_curve_list2[32] 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 s_curve_ids = "9" ga_view_aa_set(23.,-34.,0.) curve_label(TRUE) # Create 4 curves and 4 lines. i_return_value = @ sgm_const_curve_2d_arcangles_v1( "1", 1., 0., @ 90., "Coord 0.2", "[0 0 0]", TRUE, @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ sgm_const_curve_2d_arcangles_v1( "2", 1.,90., @ 180., "Coord 0.2", "[0 0 0]", TRUE, @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ sgm_const_curve_2d_arcangles_v1( "3", 1.,180.,@ 270., "Coord 0.2", "[0 0 0]", TRUE, @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = @ sgm_const_curve_2d_arcangles_v1( "4", 1.,270.,@ 360., "Coord 0.2", "[0 0 0]", TRUE, @ sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = asm_const_line_2point( "5", "[0 0 0][0 0.2 0][0 0.4 0][0 0.6 0]", "[0 0.2 0][0 0.4 0][0 0.6 0][0 0.8 0]", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value

@ @ @ @ @

# Transform the two set of curves. s_origin_1 = "[0 0 0]" s_origin_2 = "[0 0 0]" ra_scales_1 = [ 1.0 1.0 1.0 ] ra_scales_2 = [ 1.0 1.0 1.0 ] s_curve_list1 = "curve 1:4" s_curve_list2 = "curve 5:8" i_return_value = asm_transform_curve_vsum ( s_curve_ids, s_origin_1, s_origin_2,

Main Index

@ @ @ @ @

Chapter 3: Geometry Functions 621 Disassemble Actions

ra_scales_1, ra_scales_2, s_curve_list1, s_curve_list2, 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_transform_grid_mcord

()

# # Purpose : This file provides an example of a call to the # function asm_transform_grid_mcord() # # This file opens a new database "new.db" and # creates four points. Later it creates a # coordinate frame with label = 100. Finally it # transforms the points from the reference # coordinate frame to the created coordinate # frame. # # This file can be run 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_transform_grid_mcord() # has the following arguments: # # asm_transform_grid_mcord # ( point_labels, # coord_frame_1, # coord_frame_2, # delete_orig, # point_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_point_labels[32] STRING s_coord_frame_1[32] STRING s_coord_frame_2[32] LOGICAL l_delete_orig STRING s_point_list[32] STRING sv_created_labels[VIRTUAL] STRING sv_asm_create_cord_3po_created[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 point_label(TRUE) # Create 4 point with labels 1,2,3 and 4. i_return_value = @ asm_const_grid_xyz( "1", @ "[.5 .5 0.][1. .5 0.][1.5 .5 0.][2. .5 0.]"@ ,"coord 0",sv_asm_create_grid_xyz_created)

Main Index

622 PCL Reference Manual Examples Disassemble Actions

dump i_return_value # Create a coordinate with label = 100. i_return_value = asm_const_coord_3point( "100", "Coord 0", 1, "[1 1 1]", "[1 1 2]", "[2 1 1]", sv_asm_create_cord_3po_created ) dump i_return_value s_point_labels s_coord_frame_1 s_coord_frame_2 l_delete_orig s_point_list

= = = = =

@ @ @

"8 9 10 11" "coord 0" "coord 100" FALSE "point 1:4"

# Transform the points. i_return_value = asm_transform_grid_mcord ( s_point_labels, s_coord_frame_1, s_coord_frame_2, l_delete_orig, s_point_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_cord_3po_created) sys_free_string(sv_asm_create_grid_xyz_created) #---------------------------------------------------------------------

asm_transform_grid_mirror

()

# # Purpose : This file provides an example of a call to the # function asm_transform_grid_mirror() # # This file opens a new database "new.db" and # creates 4 points. Later it transforms these # points by mirroring them about a particular # 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 asm_transform_grid_mirror() # has the following arguments: # # asm_transform_grid_mirror # ( point_labels, # plane, # offset, # delete_orig, # point_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_point_labels[32] STRING s_plane[32] REAL r_offset LOGICAL l_delete_orig STRING s_point_list[32]

Main Index

Chapter 3: Geometry Functions 623 Disassemble Actions

STRING sv_created_labels[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 point_label(TRUE) # Create 4 point with labels 1,2,3 and 4. i_return_value = @ asm_const_grid_xyz( "1", "[.5 .5 0.]"// @ "[1. 1. 0.][1.2 1.5 0.][.7 2. 0.]" @ ,"coord 0",sv_asm_create_grid_xyz_created) dump i_return_value s_point_labels s_plane r_offset l_delete_orig s_point_list

= = = = =

"8 9 10 11" "coord 0.1" 0.0 FALSE "point 1:4"

# Transform the points. i_return_value = asm_transform_grid_mirror ( s_point_labels, s_plane, r_offset, l_delete_orig, s_point_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_grid_xyz_created) #---------------------------------------------------------------------

()

asm_transform_grid_mscale # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function asm_transform_grid_mscale() This file opens a new database "new.db" and creates 5 points. Later it transforms these points by rotation and translation. This file can be run 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_transform_grid_mscale() has the following arguments: asm_transform_grid_mscale ( point_labels, coord_frame, origin, translation, rotation_matrix, delete_orig, point_list, created_labels )

624 PCL Reference Manual Examples Disassemble Actions

# #--------------------------------------------------------------------# Variable Declarations STRING s_point_labels[32] STRING s_coord_frame[32] STRING s_origin[32] STRING s_translation[32] REAL raa_rotation_matrix(3,3) = [-1, 0, 0, 0, 1, 0, 0, 0, 1] LOGICAL l_delete_orig STRING s_point_list[32] STRING sv_created_labels[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 point_label(TRUE) # Create 5 point with labels 1,2,3 4 and 5. i_return_value = asm_const_grid_xyz( "1", "[0.2 0.5 0.][1.0 1.0 0.][1.2 1.5 0.]", "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value i_return_value = asm_const_grid_xyz( "4", "[0.9 1.7 0.][0.5 2.0 0.]", "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value s_point_labels s_coord_frame s_origin s_translation l_delete_orig s_point_list

= = = = = =

@ @ @

@ @ @

"8 9 10 11 12" "coord 0" "[0 0 0]" "<3 0 0>" FALSE "point 1:5"

# Transform the points. i_return_value = asm_transform_grid_mscale ( s_point_labels, s_coord_frame, s_origin, s_translation, raa_rotation_matrix, l_delete_orig, s_point_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_grid_xyz_created) #---------------------------------------------------------------------

()

asm_transform_grid_pivot # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function asm_transform_grid_pivot() This file opens a new database "new.db" and creates 4 points. Later it pivots these

Chapter 3: Geometry Functions 625 Disassemble Actions

# points about origin. # # This file can be run 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_transform_grid_pivot() # has the following arguments: # # asm_transform_grid_pivot # ( point_labels, # pivot_point_1, # pivot_point_2, # pivot_point_3, # delete_orig, # point_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_point_labels[32] STRING s_pivot_point_1[32] STRING s_pivot_point_2[32] STRING s_pivot_point_3[32] LOGICAL l_delete_orig STRING s_point_list[32] STRING sv_created_labels[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 point_label(TRUE) # Create 4 point with labels 100,200,3 and 4. i_return_value = asm_const_grid_xyz( "100","[0.5 0.5 0.]", "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value i_return_value = asm_const_grid_xyz( "200","[0.7 1.0 0.]", "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value

@ @

i_return_value = asm_const_grid_xyz( "3 4", "[1.5 1.5 0.][2.0 2.0 0.]", "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value

@ @ @

s_point_labels s_pivot_point_1 s_pivot_point_2 s_pivot_point_3 l_delete_orig s_point_list

= = = = = =

"8 9" "[0 0 0]" "point 100" "point 200" FALSE "point 3 4"

# Transform the points. i_return_value = asm_transform_grid_pivot ( s_point_labels, s_pivot_point_1, s_pivot_point_2, s_pivot_point_3,

Main Index

@ @

@ @ @ @ @ @

626 PCL Reference Manual Examples Disassemble Actions

l_delete_orig, s_point_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_grid_xyz_created) #---------------------------------------------------------------------

asm_transform_grid_position

()

# Purpose : This file provides an example of a call to the # function asm_transform_grid_position() # # This file opens a new database "new.db" and # creates 2 points. Later it transforms these # points by position transformation. # # This file can be run 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_transform_grid_position() # has the following arguments: # # asm_transform_grid_position # ( point_labels, # point_1, # point_2, # point_3, # point_4, # point_5, # point_6, # delete_orig, # point_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_point_labels[32] STRING s_point_1[32] STRING s_point_2[32] STRING s_point_3[32] STRING s_point_4[32] STRING s_point_5[32] STRING s_point_6[32] LOGICAL l_delete_orig STRING s_point_list[32] STRING sv_created_labels[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 point_label(TRUE) # Create 2 point with labels 100 and 200. i_return_value = asm_const_grid_xyz( "100 200", "[0.5 0.5 0.][0.7 1.0 0.]", "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value

Main Index

@ @ @

Chapter 3: Geometry Functions 627 Disassemble Actions

s_point_labels s_point_1 s_point_2 s_point_3 s_point_4 s_point_5 s_point_6 l_delete_orig s_point_list

= = = = = = = = =

"8 9" "[0 0 0]" "[0 1 0]" "[1 0 0]" "[-1 1 0]" "[-2 1 0]" "[-1 2 0]" FALSE "point 100 200 "

# Transform the points. i_return_value = asm_transform_grid_position ( s_point_labels, s_point_1, s_point_2, s_point_3, s_point_4, s_point_5, s_point_6, l_delete_orig, s_point_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_grid_xyz_created) #---------------------------------------------------------------------

asm_transform_grid_rotate

()

# # Purpose : This file provides an example of a call to the # function asm_transform_grid_rotate() # # This file opens a new database "new.db" and # creates 2 points. Later it transforms these # points by 30 degrees with a initial offset # angle of 60 degrees and repeating the operation # four times about the 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 asm_transform_grid_rotate() # has the following arguments: # # asm_transform_grid_rotate # ( point_labels, # axis, # angle, # offset, # coord_frame, # nrepeat, # delete_orig, # point_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_point_labels[32] STRING s_axis[32]

Main Index

628 PCL Reference Manual Examples Disassemble Actions

REAL r_angle REAL r_offset STRING s_coord_frame[32] INTEGER i_nrepeat LOGICAL l_delete_orig STRING s_point_list[32] STRING sv_created_labels[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 point_label(TRUE) # Create 2 point with labels 100 and 200. i_return_value = asm_const_grid_xyz( "100 200", "[0.5 0.5 0.][0.7 1.0 0.]", "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value s_point_labels s_axis r_angle r_offset s_coord_frame i_nrepeat l_delete_orig s_point_list

= = = = = = = =

@ @ @

"8 9 10 11 12 13 14 15" "coord 0.3" 60.0 30.0 "coord 0" 4 FALSE "point 100 200 "

# Transform the points. i_return_value = asm_transform_grid_rotate ( s_point_labels, s_axis, r_angle, r_offset, s_coord_frame, i_nrepeat, l_delete_orig, s_point_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_grid_xyz_created) #---------------------------------------------------------------------

()

asm_transform_grid_scale # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function asm_transform_grid_scale() This file opens a creates 4 points. points by scaling direction, with [

new database "new.db" and Later it transforms these them in the x and y 0 0 0 ] as the origin.

This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown

Chapter 3: Geometry Functions 629 Disassemble Actions

# menus on the menu bar. # # The function asm_transform_grid_scale() # has the following arguments: # # asm_transform_grid_scale # ( point_labels, # origin, # scale, # coord_frame, # nrepeat, # trans_type, # delete_orig, # point_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_point_labels[32] STRING s_origin[32] REAL ra_scale(3) STRING s_coord_frame[32] INTEGER i_num_repeat LOGICAL l_trans_type LOGICAL l_delete_orig STRING s_point_list[32] STRING sv_created_labels[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 point_label(TRUE) # Create 4 point with labels 100 and 200. i_return_value = asm_const_grid_xyz( "100 200", "[.5 .5 0.][-.5 .5 0.]", "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value i_return_value = asm_const_grid_xyz( "300 400", "[-.5 -.5 0.][.5 -.5 0.]", "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value s_point_labels s_origin ra_scale(1) ra_scale(2) ra_scale(3) s_coord_frame i_num_repeat l_trans_type l_delete_orig s_point_list

= = = = = = = = = =

@ @ @

"8 9 10 11 12 13 14 15" "[0 0 0]" 2 2 1 "coord 0" 2 FALSE FALSE "point 100 200 300 400 "

# Transform the points. i_return_value = asm_transform_grid_scale ( s_point_labels, s_origin, ra_scale, s_coord_frame, i_num_repeat,

Main Index

@ @ @

@ @ @ @ @ @ @

630 PCL Reference Manual Examples Disassemble Actions

l_trans_type, l_delete_orig, s_point_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_grid_xyz_created) #---------------------------------------------------------------------

asm_transform_grid_translate

()

# # Purpose : This file provides an example of a call to the # function asm_transform_grid_translate() # # This file opens a new database "new.db" and # creates 4 points. Later it transforms these # points using curvilinear coordinate frame, # translating radially by 2 units. # # This file can be run 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_transform_grid_translate() # has the following arguments: # # asm_transform_grid_translate # ( point_labels, # delta, # coord_frame, # nrepeat, # trans_type, # delete_orig, # point_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_point_labels[32] STRING s_delta[32] STRING s_coord_frame[32] INTEGER i_num_repeat LOGICAL l_trans_type LOGICAL l_delete_orig STRING s_point_list[32] STRING sv_created_labels[VIRTUAL] STRING sv_asm_create_grid_xyz_created[VIRTUAL] STRING sv_asm_create_cord_3po_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 point_label(TRUE) # Create 4 point with labels 100 and 200. i_return_value = asm_const_grid_xyz( "100 200", "[0.75 0.75 0.][1.0 0.5 0.]", "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value

Main Index

@ @ @

Chapter 3: Geometry Functions 631 Disassemble Actions

i_return_value = asm_const_grid_xyz( "300 400", "[-0.75 0.75 0.][-1.0 0.5 0.]", "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value # Create a cylindrical coordinate system. 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_created ) dump i_return_value s_point_labels s_delta s_coord_frame i_num_repeat l_trans_type l_delete_orig s_point_list

= = = = = = =

@ @ @

@ @ @

"8 9 10 11 12 13 14 15" "<3 0 0>" "coord 1" 2 TRUE FALSE "point 100 200 300 400 "

# Transform the points. i_return_value = asm_transform_grid_translate ( s_point_labels, s_delta, s_coord_frame, i_num_repeat, l_trans_type, l_delete_orig, s_point_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_grid_xyz_created) sys_free_string(sv_asm_create_cord_3po_created) #---------------------------------------------------------------------

()

asm_transform_grid_vsum # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function asm_transform_grid_vsum() This file opens a new database "new.db" and creates 4 points. Later it creates grids by performing vector sum of two existing 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_transform_grid_vsum() has the following arguments: asm_transform_grid_vsum ( point_labels, origin_1, origin_2, scale_1, scale_2,

632 PCL Reference Manual Examples Disassemble Actions

# point_list1, # point_list2, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_point_labels[32] STRING s_origin_1[32] STRING s_origin_2[32] REAL ra_scale_1(3) REAL ra_scale_2(3) STRING s_point_list1[32] STRING s_point_list2[32] STRING sv_created_labels[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 point_label(TRUE) # Create 4 point with labels 100,200,300 and 400. i_return_value = @ asm_const_grid_xyz( "100 200", @ "[0.75 0.75 0.][1.0 0.5 0.]", @ "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value i_return_value = asm_const_grid_xyz( "300 400", "[0.75 2.5 0.][1.0 1.5 0.]", "coord 0",sv_asm_create_grid_xyz_created) dump i_return_value s_point_labels s_origin_1 s_origin_2 ra_scale_1(1) ra_scale_1(2) ra_scale_1(3) ra_scale_2(1) ra_scale_2(2) ra_scale_2(3) s_point_list1 s_point_list2

= = = = = = = = = = =

@ @ @

"8 9" "[0 0 0]" "[0 0 0]" 1 1 1 2 2 2 "point 100 200" "point 300 400"

# Transform the points. i_return_value = asm_transform_grid_vsum ( s_point_labels, s_origin_1, s_origin_2, ra_scale_1, ra_scale_2, s_point_list1, s_point_list2, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_grid_xyz_created) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 633 Disassemble Actions

asm_transform_line_mirror

()

# # Purpose : This file provides an example of a call to the # function asm_transform_line_mirror() # # This file opens a new database "new.db" and # creates two curves. Later it transforms these # curves by mirroring them about a 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 asm_transform_line_mirror() # has the following arguments: # # asm_transform_line_mirror # ( line_labels, # plane, # offset, # reverse, # delete_orig, # curve_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_line_labels[32] STRING s_plane[32] REAL r_offset LOGICAL l_reverse LOGICAL l_delete_orig STRING s_curve_list[32] STRING sv_created_labels[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 curve_label(TRUE) # Create two curves. i_return_value = asm_const_line_3point( "1", "[0.0 0.8 0.0]", "[0.6 1.0 0]", "[0 0 0]", 1, 0.5, sv_asm_line_3point_created_ids ) dump i_return_value i_return_value = asm_const_line_3point( "2", "[0.0 0.7 0.0]", "[0.5 0.9 0]", "[0 0.1 0]", 1, 0.5, sv_asm_line_3point_created_ids ) dump i_return_value s_line_labels s_plane r_offset l_reverse l_delete_orig s_curve_list

Main Index

= = = = = =

"8 9" "coord 0.1" 0.0 FALSE FALSE "curve 1 2"

@ @ @

@ @ @

634 PCL Reference Manual Examples Disassemble Actions

# Transform the curves. i_return_value = asm_transform_line_mirror ( s_line_labels, s_plane, r_offset, l_reverse, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_line_3point_created_ids) #---------------------------------------------------------------------

asm_transform_patch_mirror

()

# # Purpose : This file provides an example of a call to the # function asm_transform_patch_mirror() # # This file opens a new database "new.db" and # creates two surfaces. Later it transforms these # surfaces by mirroring them about a 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 asm_transform_patch_mirror() # has the following arguments: # # asm_transform_patch_mirror # ( patch_labels, # plane, # offset, # reverse, # delete_orig, # surface_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_patch_labels[32] STRING s_plane[32] REAL r_offset LOGICAL l_reverse LOGICAL l_delete_orig STRING s_surface_list[32] STRING sv_created_labels[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 surface_label(TRUE) i_return_value = ga_view_aa_set(24.,-34.,0.) dump i_return_value

Main Index

@

Chapter 3: Geometry Functions 635 Disassemble Actions

# Create two surfaces. i_return_value = asm_const_patch_xyz( "1", "<1 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 1 0]" , "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value s_patch_labels s_plane r_offset l_reverse l_delete_orig s_surface_list

= = = = = =

@ @ @

@ @ @

"8 9" "coord 0.1" 0.0 FALSE FALSE "surface 1 2"

# Transform the surface. i_return_value = asm_transform_patch_mirror ( s_patch_labels, s_plane, r_offset, l_reverse, l_delete_orig, s_surface_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

()

sgm_transform_mcord # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function sgm_transform_mcord() This file opens a new database "new.db" and creates a curve and surface. Later it creates a coordinate frame with label = 1. Finally it transforms the surface and curve from the reference coordinate frame to the created coordinate frame. This file can be run 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_transform_mcord() has the following arguments: sgm_transform_mcord ( entity_labels, entity_type, coord_frame_1, coord_frame_2, delete_orig, curve_list, created_labels )

636 PCL Reference Manual Examples Disassemble Actions

# #--------------------------------------------------------------------# Variable Declarations STRING s_entity_labels[32] STRING s_entity_type[32] STRING s_coord_frame_1[32] STRING s_coord_frame_2[32] LOGICAL l_delete_orig STRING s_curve_list[32] STRING sv_created_labels[VIRTUAL] STRING sv_asm_line_2point_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_asm_create_cord_3po_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 surface_label(TRUE) curve_label(TRUE) # Create a surface with label 100. i_return_value = asm_const_patch_xyz( "100", "<0.8 0.8 0>", "[0.5 0.5 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create a line with label 300. i_return_value = asm_const_line_2point( "300", "[0.2 0.2 0]", "[1.0 0.5 0.]", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value # Create a coordinate with label = 1. i_return_value = asm_const_coord_3point( "1", "Coord 0", 1, "[1 1 1]", "[1 1 2]", "[2 1 1]", sv_asm_create_cord_3po_created ) dump i_return_value s_entity_labels s_coord_frame_1 s_coord_frame_2 l_delete_orig s_curve_list s_entity_type

= = = = = =

@ @ @

@ @ @

@ @ @

"8" "coord 0" "coord 1" FALSE "surface 100" "surface"

# Transform the surface. i_return_value = sgm_transform_mcord ( s_entity_labels, s_entity_type, s_coord_frame_1, s_coord_frame_2, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @

s_curve_list = "curve 300" s_entity_type = "curve" # Transform the curve. i_return_value =

Main Index

@

Chapter 3: Geometry Functions 637 Disassemble Actions

sgm_transform_mcord ( s_entity_labels, s_entity_type, s_coord_frame_1, s_coord_frame_2, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_line_2point_created_ids) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_asm_create_cord_3po_created) #---------------------------------------------------------------------

sgm_transform_mirror

()

# # Purpose : This file provides an example of two calls to # the function sgm_transform_mirror() # # This file opens a new database "new.db" and # creates two surfaces and two curves. Later it # transforms these surfaces and curves by # mirroring them about a 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 sgm_transform_mirror() # has the following arguments: # # sgm_transform_mirror # ( entity_labels, # entity_type, # plane, # offset, # reverse, # delete_orig, # curve_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_entity_labels[32] STRING s_entity_type[32] STRING s_plane[32] REAL r_offset LOGICAL l_reverse LOGICAL l_delete_orig STRING s_curve_list[128] STRING sv_created_labels[VIRTUAL] STRING sv_asm_create_patch_xy_created[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 surface_label(TRUE) curve_label(TRUE)

Main Index

638 PCL Reference Manual Examples Disassemble Actions

i_return_value = ga_view_aa_set(24.,-34.,0.) dump i_return_value # Create two surfaces. i_return_value = asm_const_patch_xyz( "1", "<1 1 1><1 0 1>", "[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_3point( "1", "[0.0 0.8 0.0]", "[0.6 1.0 0]", "[0 0 0]", 1, 0.5, sv_asm_line_3point_created_ids ) dump i_return_value i_return_value = asm_const_line_3point( "2", "[0.0 0.7 0.0]", "[0.5 0.9 0]", "[0 0.1 0]", 1, 0.5, sv_asm_line_3point_created_ids ) dump i_return_value s_entity_labels s_plane r_offset l_reverse l_delete_orig s_curve_list s_entity_type

= = = = = = =

@

@ @ @

@ @ @

@ @ @

"8 9" "coord 0.1" 0.0 FALSE FALSE "surface 1 2" "surface"

# Transform the surface. i_return_value = sgm_transform_mirror ( s_entity_labels, s_entity_type, s_plane, r_offset, l_reverse, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------s_curve_list = "curve 1 2" s_entity_type = "curve" # Transform the curves. i_return_value = sgm_transform_mirror ( s_entity_labels, s_entity_type, s_plane, r_offset, l_reverse, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_patch_xy_created)

Main Index

@ @ @ @ @ @ @ @ @

Chapter 3: Geometry Functions 639 Disassemble Actions

sys_free_string(sv_asm_line_3point_created_ids) #---------------------------------------------------------------------

sgm_transform_pivot

()

# # Purpose : This file provides an example of two calls to # the function sgm_transform_pivot() # # This file opens a new database "new.db" and # creates a surface and curve.Later it transforms # these surface and curve by pivoting method. # # This file can be run 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_transform_pivot() # has the following arguments: # # sgm_transform_pivot # ( entity_labels, # entity_type, # pivot_point_1, # pivot_point_2, # pivot_point_3, # delete_orig, # curve_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_entity_labels[32] STRING s_entity_type[32] STRING s_pivot_point_1[32] STRING s_pivot_point_2[32] STRING s_pivot_point_3[32] LOGICAL l_delete_orig STRING s_curve_list[32] STRING sv_created_labels[VIRTUAL] STRING sv_asm_create_patch_xy_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 surface_label(TRUE) curve_label(TRUE) # Create a surface with label 100. i_return_value = asm_const_patch_xyz( "100", "<0.8 0.8 0>", "[0.5 0.5 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create a line with label 300. i_return_value = asm_const_line_2point( "300", "[0.2 0.2 0]", "[1.0 0.5 0.]", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value

Main Index

@ @ @

@ @ @

640 PCL Reference Manual Examples Disassemble Actions

s_entity_labels s_pivot_point_1 s_pivot_point_2 s_pivot_point_3 l_delete_orig s_curve_list s_entity_type

= = = = = = =

"8" "[0 0 0]" "[1 1 1]" "[-1 1 1]" FALSE "surface 100" "surface"

# Transform the surface. i_return_value = sgm_transform_pivot ( s_entity_labels, s_entity_type, s_pivot_point_1, s_pivot_point_2, s_pivot_point_3, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @

s_curve_list = "curve 300" s_entity_type = "curve" # Transform the curve. i_return_value = sgm_transform_pivot ( s_entity_labels, s_entity_type, s_pivot_point_1, s_pivot_point_2, s_pivot_point_3, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_asm_line_2point_created_ids) #---------------------------------------------------------------------

()

sgm_transform_position # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_transform_position() This file opens a new database "new.db" and creates a surface and a curve. Later it transforms these surface and curve by position transformation. This file can be run 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_transform_position() has the following arguments: sgm_transform_position ( entity_labels, entity_type,

Chapter 3: Geometry Functions 641 Disassemble Actions

# point_1, # point_2, # point_3, # point_4, # point_5, # point_6, # delete_orig, # curve_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_entity_labels[32] STRING s_entity_type[32] STRING s_point_1[32] STRING s_point_2[32] STRING s_point_3[32] STRING s_point_4[32] STRING s_point_5[32] STRING s_point_6[32] LOGICAL l_delete_orig STRING s_curve_list[32] STRING sv_created_labels[VIRTUAL] STRING sv_asm_create_patch_xy_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 curve_label(TRUE) surface_label(TRUE) # Create a surface with label 100. i_return_value = asm_const_patch_xyz( "100", "<0.8 0.8 0>", "[0.5 0.5 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create a line with label 300. i_return_value = asm_const_line_2point( "300", "[0.2 0.2 0]", "[1.0 0.5 0.]", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value s_entity_labels s_point_1 s_point_2 s_point_3 s_point_4 s_point_5 s_point_6 l_delete_orig s_curve_list s_entity_type

= = = = = = = = = =

@ @ @

"8" "[0 0 0]" "[0 1 0]" "[1 0 0]" "[-1 1 0]" "[-2 1 0]" "[-1 2 0]" FALSE "surface 100 " "surface"

# Transform the surface. i_return_value = sgm_transform_position ( s_entity_labels, s_entity_type, s_point_1, s_point_2, s_point_3, s_point_4,

Main Index

@ @ @

@ @ @ @ @ @ @ @

642 PCL Reference Manual Examples Disassemble Actions

s_point_5, s_point_6, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @

s_curve_list = "curve 300 " s_entity_type = "curve" # Transform the curve. i_return_value = sgm_transform_position ( s_entity_labels, s_entity_type, s_point_1, s_point_2, s_point_3, s_point_4, s_point_5, s_point_6, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

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

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_asm_line_2point_created_ids) #---------------------------------------------------------------------

()

sgm_transform_rotate # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function sgm_transform_rotate() This file opens a new database "new.db" and creates a curve and a surface. Later it transforms these surface and curve by 30 degrees with a initial offset angle of 60 degrees and repeating the operation four times about the 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 sgm_transform_rotate() has the following arguments: sgm_transform_rotate ( entity_labels, entity_type, axis, angle, offset, coord_frame, nrepeat, delete_orig, curve_list,

Chapter 3: Geometry Functions 643 Disassemble Actions

# created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_entity_labels[32] STRING s_entity_type[32] STRING s_axis[32] REAL r_angle REAL r_offset STRING s_coord_frame[32] INTEGER i_num_repeat LOGICAL l_delete_orig STRING s_curve_list[32] STRING sv_created_labels[VIRTUAL] STRING sv_asm_create_grid_xyz_created[VIRTUAL] STRING sv_asm_line_2point_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 surface_label(TRUE) curve_label(TRUE) # Create a surface with label 100. i_return_value = asm_const_patch_xyz( "100", "<0.8 0.8 0>", "[0.5 0.5 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create a line with label 300. i_return_value = asm_const_line_2point( "300", "[0.2 0.2 0]", "[1.0 0.5 0.]", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value s_entity_labels s_axis r_angle r_offset s_coord_frame i_num_repeat l_delete_orig s_curve_list s_entity_type

= = = = = = = = =

@ @ @

@ @ @

"8 9 10 11" "coord 0.3" 60.0 30.0 "coord 0" 4 FALSE "surface 100" "surface"

# Transform the points. i_return_value = sgm_transform_rotate ( s_entity_labels, s_entity_type, s_axis, r_angle, r_offset, s_coord_frame, i_num_repeat, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @ @ @

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

Main Index

644 PCL Reference Manual Examples Disassemble Actions

s_curve_list = "curve 300 " s_entity_type = "curve" # Transform the curve. i_return_value = sgm_transform_rotate ( s_entity_labels, s_entity_type, s_axis, r_angle, r_offset, s_coord_frame, i_num_repeat, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_create_grid_xyz_created) sys_free_string(sv_asm_line_2point_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

sgm_transform_scale

()

# # Purpose : This file provides an example of a call to the # function sgm_transform_scale() # # This file opens a new database "new.db" and # creates curve and surface. Later it transforms # these curve and surface by scaling them in the # x and y direction, with [0 0 0] as the origin. # # This file can be run 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_transform_scale() # has the following arguments: # # sgm_transform_scale # ( entity_labels, # entity_type, # scale, # origin, # coord_frame, # nrepeat, # delete_orig, # curve_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_entity_labels[32] STRING s_entity_type[32] REAL ra_scale(3) STRING s_origin[32] STRING s_coord_frame[32] INTEGER i_num_repeat LOGICAL l_delete_orig STRING s_curve_list[32]

Main Index

Chapter 3: Geometry Functions 645 Disassemble Actions

STRING sv_created_labels[VIRTUAL] STRING sv_asm_line_2point_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 curve_label(TRUE) surface_label(TRUE) # Create a surface with label 100. i_return_value = asm_const_patch_xyz( "100", "<0.8 0.8 0>", "[0.5 0.5 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create a line with label 300. i_return_value = asm_const_line_2point( "300", "[0.2 0.2 0]", "[1.0 0.5 0.]", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value s_entity_labels s_origin ra_scale(1) ra_scale(2) ra_scale(3) s_coord_frame i_num_repeat l_delete_orig s_curve_list s_entity_type

= = = = = = = = = =

@ @ @

@ @ @

"8 9" "[0 0 0]" 2 2 1 "coord 0" 2 FALSE "surface 100" "surface"

# Transform the surface. i_return_value = sgm_transform_scale ( s_entity_labels, s_entity_type, ra_scale, s_origin, s_coord_frame, i_num_repeat, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @ @

s_curve_list = "curve 300" s_entity_type = "curve" # Transform the curve. i_return_value = sgm_transform_scale ( s_entity_labels, s_entity_type, ra_scale, s_origin, s_coord_frame, i_num_repeat, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value

Main Index

@ @ @ @ @ @ @ @ @ @

646 PCL Reference Manual Examples Disassemble Actions

dump sv_created_labels sys_free_string(sv_created_labels) sys_free_string(sv_asm_line_2point_created_ids) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

asm_transform_solid_vsum

()

# # Purpose : This file provides an example of a call to the # function asm_transform_solid_vsum() # # This file opens a new database "new.db" and # creates 2 solids. Later it creates a solid # by vector summing the 2 solids. # # This file can be run 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_transform_solid_vsum() # has the following arguments: # # asm_transform_solid_vsum # ( solid_ids, # origin_1, # origin_2, # scales_1, # scales_2, # solid_list1, # solid_list2, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_solid_ids[32] STRING s_origin_1[32] STRING s_origin_2[32] REAL ra_scales_1(3) REAL ra_scales_2(3) STRING s_solid_list1[32] STRING s_solid_list2[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 i_return_value = ga_view_aa_set(23.,-34.,0.) dump i_return_value

@

solid_label(TRUE) # Create two solids. 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 i_return_value = asm_const_hpat_xyz( "2", "<0.5 0.5 0.5>",

Main Index

@ @ @ @ @

Chapter 3: Geometry Functions 647 Disassemble Actions

"[2 1 1]", "Coord 0", sv_asm_create_hpat_xyz_created ) dump i_return_value

@

# Transform the solids. s_solid_ids = "8" s_origin_1 = "[0 0 0]" s_origin_2 = "[0 0 0]" ra_scales_1 = [ 2.0 2.0 2.0 ] ra_scales_2 = [ 2.0 2.0 2.0 ] s_solid_list1 = "solid 1" s_solid_list2 = "solid 2" i_return_value = asm_transform_solid_vsum ( s_solid_ids, s_origin_1, s_origin_2, ra_scales_1, ra_scales_2, s_solid_list1, s_solid_list2, 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_transform_surface_vsum

()

# # Purpose : This file provides an example of a call to the # function asm_transform_surface_vsum() # # This file opens a new database "new.db" and # creates 2 surfaces. Later it creates a surface # by vector summing the 2 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_transform_surface_vsum() # has the following arguments: # # asm_transform_surface_vsum # ( surface_ids, # origin_1, # origin_2, # scales_1, # scales_2, # surface_list1, # surface_list2, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_surface_ids[32] STRING s_origin_1[32] STRING s_origin_2[32] REAL ra_scales_1(3) REAL ra_scales_2(3) STRING s_surface_list1[32]

Main Index

648 PCL Reference Manual Examples Disassemble Actions

STRING s_surface_list2[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

@

surface_label(TRUE) # Create two surfaces. i_return_value = asm_const_patch_xyz( "1", "<1 0 1>", "[0 1 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.5>", "[0 0.5 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value

@ @ @ @ @ @

# Transform the surfaces. s_surface_ids = "8" s_origin_1 = "[0 0 0]" s_origin_2 = "[0 0 0]" ra_scales_1 = [ 1.0 1.0 1.0 ] ra_scales_2 = [ 1.0 1.0 1.0 ] s_surface_list1 = "surface 1" s_surface_list2 = "surface 2" i_return_value = asm_transform_surface_vsum ( s_surface_ids, s_origin_1, s_origin_2, ra_scales_1, ra_scales_2, s_surface_list1, s_surface_list2, 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) #---------------------------------------------------------------------

()

sgm_transform_translate # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_transform_translate() This file opens a new database "new.db" and creates a curve and surface. Later it transforms these surface and curve using curvilinear coordinate frame,translating radially by 2 units. This file can be run by starting a session of

Chapter 3: Geometry Functions 649 Disassemble Actions

# Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function sgm_transform_translate() # has the following arguments: # # sgm_transform_translate # ( entity_labels, # entity_type, # delta, # coord_frame, # nrepeat, # delete_orig, # curve_list, # created_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_entity_labels[32] STRING s_entity_type[32] STRING s_delta[32] STRING s_coord_frame[32] INTEGER i_num_repeat LOGICAL l_delete_orig STRING s_curve_list[32] STRING sv_created_labels[VIRTUAL] STRING sv_asm_line_2point_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_asm_create_cord_3po_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 curve_label(TRUE) surface_label(TRUE) # Create a surface with label 100. i_return_value = asm_const_patch_xyz( "100", "<0.8 0.8 0>", "[0.5 0.5 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create a line with label 300. i_return_value = asm_const_line_2point( "300", "[0.2 0.2 0]", "[1.0 0.5 0.]", 0, "", 50., 1, sv_asm_line_2point_created_ids ) dump i_return_value # Create a cylindrical coordinate system. 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_created ) dump i_return_value s_entity_labels s_delta s_coord_frame i_num_repeat l_delete_orig s_curve_list s_entity_type

Main Index

= = = = = = =

"8 9" "<3 3 0>" "coord 1" 2 FALSE "surface 100" "surface"

@ @ @

@ @ @

@ @ @

650 PCL Reference Manual Examples Disassemble Actions

# Transform the surface. i_return_value = sgm_transform_translate ( s_entity_labels, s_entity_type, s_delta, s_coord_frame, i_num_repeat, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @

s_curve_list = "curve 300" s_entity_type = "curve" # Transform the curve. i_return_value = sgm_transform_translate ( s_entity_labels, s_entity_type, s_delta, s_coord_frame, i_num_repeat, l_delete_orig, s_curve_list, sv_created_labels ) dump i_return_value dump sv_created_labels

@ @ @ @ @ @ @ @ @

sys_free_string(sv_created_labels) sys_free_string(sv_asm_line_2point_created_ids) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_asm_create_cord_3po_created) #--------------------------------------------------------------------Edit Actions This section contains examples of some of the functions used to implement the “Edit” actions.

()

asm_edit_curve_blend # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function asm_edit_curve_blend() This file opens a new database "new.db" and creates five lines. Later it blends the curves such that first derivative continuity is enforced at the boundaries. This file can be run 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_edit_curve_blend() has the following arguments: asm_edit_curve_blend ( curve_ids, weights, curve_list, delete_orig, created_ids )

Chapter 3: Geometry Functions 651 Disassemble Actions

# #--------------------------------------------------------------------# Variable Declarations STRING s_curve_ids[32] STRING s_weights[32] STRING s_curve_list[32] LOGICAL l_delete_orig STRING sv_asm_create_line_xyz_created[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_curve_ids = "#" # Create five lines with sharp edges. i_return_value = @ asm_const_line_xyz( "1", "<1 1 0>", "[0 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "2", "<1 0 0>", "[1 1 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "3", "<1 -1 0>","[2 1 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "4", "<1 0 0>", "[3 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "5", "<1 1 0>", "[4 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value s_weights = "1e-6 1.0 1.0 1e6" s_curve_list = "curve 1:5" l_delete_orig = FALSE i_return_value = asm_edit_curve_blend ( s_curve_ids, s_weights, s_curve_list, l_delete_orig, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_line_xyz_created) #---------------------------------------------------------------------

()

asm_edit_curve_merge # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function asm_edit_curve_merge() This file opens a new database "new.db" and

652 PCL Reference Manual Examples Disassemble Actions

# creates five lines. Later it merges the curves # to three cubic 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_edit_curve_merge() # has the following arguments: # # asm_edit_curve_merge # ( curve_ids, # curve_list, # ncurves, # geotol, # niterations, # delete_orig, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_ids[32] STRING s_curve_list[32] INTEGER i_ncurves REAL r_geotol INTEGER i_niterations LOGICAL l_delete_orig STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_line_xyz_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_curve_ids = "#" curve_label(TRUE) # Create five curves. i_return_value = @ asm_const_line_xyz( "1", "<1 1 0>", "[0 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "2", "<1 0 0>", "[1 1 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "3", "<1 -1 0>","[2 1 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "4", "<1 0 0>", "[3 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "5", "<1 1 0>", "[4 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value s_curve_list = "curve 1:5" i_ncurves = 3 r_geotol = 0.005

Main Index

Chapter 3: Geometry Functions 653 Disassemble Actions

i_niterations = 0 l_delete_orig = FALSE i_return_value = asm_edit_curve_merge ( s_curve_ids, s_curve_list, i_ncurves, r_geotol, i_niterations, l_delete_orig, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_line_xyz_created) #---------------------------------------------------------------------

asm_edit_solid_blend

()

# # Purpose : This file provides an example of a call to the # function asm_edit_solid_blend() # # This file opens a new database "new.db" and # creates three solids. Later it blends the # solids such that first derivative continuity # is enforced at the boundaries. # # This file can be run 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_edit_solid_blend() # has the following arguments: # # asm_edit_solid_blend # ( solid_ids, # weights, # solid_list, # delete_orig, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_solid_ids[32] STRING s_weights[32] STRING s_solid_list[32] LOGICAL l_delete_orig STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_hpat_xyz_created[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_sgm_solid_2surface_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 solid_label(TRUE) s_solid_ids = "#" i_return_value =

Main Index

@

654 PCL Reference Manual Examples Disassemble Actions

ga_view_aa_set( 23., -34., 0. ) dump i_return_value # Create three surfaces. i_return_value = asm_const_patch_xyz("1","<0 2 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 1 1>","[1 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value i_return_value = @ asm_const_patch_xyz( "3","<0 1 1>","[2 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value i_return_value = @ asm_const_patch_xyz( "4","<0 .2 1>","[3 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value i_return_value = sgm_const_solid_2surface_v1( "1", TRUE, "Surface 1 ", "Surface 2 ", sv_sgm_solid_2surface_created) dump i_return_value

@ @ @

i_return_value = sgm_const_solid_2surface_v1( "2", TRUE, "Surface 2 ", "Surface 3 ", sv_sgm_solid_2surface_created) dump i_return_value

@ @ @

i_return_value = sgm_const_solid_2surface_v1( "3", TRUE, "Surface 3 ", "Surface 4 ", sv_sgm_solid_2surface_created) dump i_return_value

@ @ @

s_weights = "1 " s_solid_list = "solid 1:3" l_delete_orig = TRUE # Blend the solids. # Session file paused. Press "Resume" to continue.. sf_pause() i_return_value = asm_edit_solid_blend ( s_solid_ids, s_weights, s_solid_list, l_delete_orig, sv_created_ids ) $? YES 38000221 dump i_return_value dump sv_created_ids

@ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_hpat_xyz_created) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_sgm_solid_2surface_created) #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 655 Disassemble Actions

asm_edit_surface_blend

()

# # Purpose : This file provides an example of a call to the # function asm_edit_surface_blend() # # This file opens a new database "new.db" and # creates three surfaces. Later it blends the # surfaces such that first derivative continuity # is enforced at the boundaries. # # This file can be run 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_edit_surface_blend() # has the following arguments: # # asm_edit_surface_blend # ( surface_ids, # edge_list, # weights, # surface_list, # delete_orig, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_surface_ids[32] STRING s_edge_list[32] STRING s_weights[32] STRING s_surface_list[32] LOGICAL l_delete_orig STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_sgm_surface_2curve_created[VIRTUAL] STRING sv_asm_create_line_xyz_created[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 surface_label(TRUE) i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

s_surface_ids = "#" # Create three surfaces. i_return_value = asm_const_patch_xyz( "1", "<1 0 1>", "[0 4 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value

Main Index

@ @ @

i_return_value = asm_const_line_xyz( "1", "<0 0 1>", "[2 3 0]", "Coord 0", sv_asm_create_line_xyz_created ) dump i_return_value

@ @ @

i_return_value =

@

656 PCL Reference Manual Examples Disassemble Actions

asm_const_line_xyz( "2", "<0 0 1>", "[7 2 0]", "Coord 0", sv_asm_create_line_xyz_created ) dump i_return_value

@ @

i_return_value = @ sgm_const_surface_2curve( "2", "surface 1.2 ",@ "Curve 1 ",sv_sgm_surface_2curve_created ) dump i_return_value i_return_value = @ sgm_const_surface_2curve( "3", "Curve 1 ", @ "Curve 2 ",sv_sgm_surface_2curve_created ) dump i_return_value s_weights = "1e-6 0.8 0.5" s_edge_list = "Surface 1.2 2.2 3.2" s_surface_list = "surface 1:3" l_delete_orig = FALSE # Blend the surfaces. i_return_value = asm_edit_surface_blend ( s_surface_ids, s_edge_list, s_weights, s_surface_list, l_delete_orig, 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_xyz_created) sys_free_string(sv_sgm_surface_2curve_created) #---------------------------------------------------------------------

asm_edit_hpat_blend

()

# # Purpose : This file provides an example of a call to the # function asm_edit_hpat_blend() # # This file opens a new database "new.db" and # creates a three hpats. Later it blends the # hpats such that the first derivative continuity # is enforced across surface boundaries between # adjacent hpats. # # This file can be run 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_edit_hpat_blend() # has the following arguments: # # asm_edit_hpat_blend # ( hpat_ids, # weights, # hpat_list, # delete_orig, # created_ids ) # #---------------------------------------------------------------------

Main Index

Chapter 3: Geometry Functions 657 Disassemble Actions

# Variable Declarations STRING s_hpat_ids[32] = "#" STRING s_weights[32] STRING s_hpat_list[32] LOGICAL l_delete_orig STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_hpat_xyz_created[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_sgm_solid_2surface_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 solid_label(TRUE) i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

s_hpat_ids = "#" # Create three solid surfaces. i_return_value = asm_const_patch_xyz("1","<0 2 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 1 1>","[1 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value i_return_value = @ asm_const_patch_xyz( "3","<0 1 1>","[2 0 0]", @ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value i_return_value = @ asm_const_patch_xyz( "4","<0 .2 1>","[3 0 0]",@ "Coord 0",sv_asm_create_patch_xy_created) dump i_return_value i_return_value = sgm_const_solid_2surface_v1( "1", TRUE, "Surface 1 ", "Surface 2 ", sv_sgm_solid_2surface_created) dump i_return_value

@ @ @

i_return_value = sgm_const_solid_2surface_v1( "2", TRUE, "Surface 2 ", "Surface 3 ", sv_sgm_solid_2surface_created) dump i_return_value

@ @ @

i_return_value = sgm_const_solid_2surface_v1( "3", TRUE, "Surface 3 ", "Surface 4 ", sv_sgm_solid_2surface_created) dump i_return_value

@ @ @

s_weights = "1 " s_hpat_list = "solid 1:3" l_delete_orig = TRUE # #

Main Index

Blend the solids. Session file paused. Press "Resume" to continue..

658 PCL Reference Manual Examples Disassemble Actions

sf_pause() # Blend the surfaces. i_return_value = asm_edit_hpat_blend ( s_hpat_ids, s_weights, s_hpat_list, l_delete_orig, sv_created_ids ) $? YES 1000031 dump i_return_value dump sv_created_ids

@ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_hpat_xyz_created) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_sgm_solid_2surface_created) #---------------------------------------------------------------------

asm_edit_hpat_break

()

# # Purpose : This file provides an example of three calls # to the function asm_edit_hpat_break() # # This file opens a new database "new.db" and # creates a solid,a surface intersecting the # solid and a curve on one of the surfaces. # Later it breaks the solid by using break type # surface,curve and parametric position. # # This file can be run 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_edit_hpat_break() # has the following arguments: # # asm_edit_hpat_break # ( hpat_ids, # break_type, # break_entity_list, # param_pos, # delete_orig, # solid_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_hpat_ids[32] = "8" INTEGER i_break_type STRING s_break_entity_list[32] REAL ra_param_pos(3) LOGICAL l_delete_orig STRING s_solid_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_sgm_solid_2surface_created[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_asm_line_2point_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db")

Main Index

Chapter 3: Geometry Functions 659 Disassemble Actions

$? YES 36000002 i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

solid_label(TRUE) s_hpat_ids = "8" # Create a solid ,surface and a curve. 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.5>", "[0.5 2 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value

@ @ @

i_return_value = sgm_const_solid_2surface_v1( "1", TRUE, "Surface 1 ", "Surface 2 ", sv_sgm_solid_2surface_created ) dump i_return_value

@ @ @

i_return_value = asm_const_patch_xyz( "3", "<-2.5 0 -2.5>", "[2 1 2]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value

@ @ @

i_return_value = asm_const_line_2point( "1", "[1 0 0.5]", "Point 7 ", 0, "", 50., 1, sv_asm_line_2point_created ) dump i_return_value

@ @ @

l_delete_orig

= FALSE

# Break the hpat with break type surface. i_break_type = 3 s_break_entity_list = "surface 3" s_solid_list = "solid 1" i_return_value = asm_edit_hpat_break ( s_hpat_ids, i_break_type, s_break_entity_list, ra_param_pos, l_delete_orig, s_solid_list, sv_created_ids ) dump i_return_value dump sv_created_ids # Break the hpat with break type curve. s_hpat_ids = "100" i_break_type = 2 s_break_entity_list = "curve 1" s_solid_list = "solid 8" i_return_value = asm_edit_hpat_break ( s_hpat_ids, i_break_type, s_break_entity_list,

Main Index

@ @ @

@ @ @ @ @ @ @ @

@ @ @ @ @

660 PCL Reference Manual Examples Disassemble Actions

ra_param_pos, l_delete_orig, s_solid_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @

# Break the hpat with break type parametric position. s_hpat_ids = "200" i_break_type = 0 s_solid_list = "solid 9" ra_param_pos(1) = 0.0 ra_param_pos(2) = 0.0 ra_param_pos(3) = 0.5 i_return_value = asm_edit_hpat_break ( s_hpat_ids, i_break_type, s_break_entity_list, ra_param_pos, l_delete_orig, s_solid_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_sgm_solid_2surface_created) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_asm_line_2point_created) #---------------------------------------------------------------------

asm_edit_hpat_reverse

()

# # Purpose : This file provides an example of a call to the # function asm_edit_hpat_reverse() # # This file opens a new database "new.db" and # creates a solid. Later it reverses the # parametric directions of the solid 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_edit_hpat_reverse() # has the following arguments: # # asm_edit_hpat_reverse # ( hpat_list, # reversed_labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_hpat_list[32] STRING sv_reversed_labels[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")

Main Index

Chapter 3: Geometry Functions 661 Disassemble Actions

$? 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_parametric_set("general",1) dump i_return_value # Create a Solid. i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_created ) dump i_return_value

@

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Reverse the Solid. s_hpat_list = "solid 1" i_return_value = asm_edit_hpat_reverse ( s_hpat_list, sv_reversed_labels ) dump i_return_value dump sv_reversed_labels #

@ @ @

Note the change of parametric directions.

sys_free_string(sv_reversed_labels) sys_free_string(sv_asm_create_hpat_xyz_created) #---------------------------------------------------------------------

asm_edit_line_blend

()

# # Purpose : This file provides an example of a call to the # function asm_edit_line_blend() # # This file opens a new database "new.db" and # creates five lines. Later it blends the curves # such that first derivative continuity is # enforced at the boundaries. # # This file can be run 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_edit_line_blend() # has the following arguments: # # asm_edit_line_blend # ( line_ids, # weights, # curve_list, # delete_orig, # created_ids ) # #---------------------------------------------------------------------

Main Index

662 PCL Reference Manual Examples Disassemble Actions

# Variable Declarations STRING s_line_ids[32] STRING s_weights[32] STRING s_curve_list[32] LOGICAL l_delete_orig STRING sv_asm_create_line_xyz_created[VIRTUAL] 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) s_line_ids = "#" # Create five lines with sharp edges. i_return_value = @ asm_const_line_xyz( "1", "<1 1 0>", "[0 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "2", "<1 0 0>", "[1 1 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "3", "<1 -1 0>","[2 1 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "4", "<1 0 0>", "[3 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "5", "<1 1 0>", "[4 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value s_weights = "1e-6 1.0 1.0 1e6" s_curve_list = "curve 1:5" l_delete_orig = FALSE i_return_value = asm_edit_line_blend ( s_line_ids, s_weights, s_curve_list, l_delete_orig, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_line_xyz_created) #---------------------------------------------------------------------

()

asm_edit_line_merge # # #

Main Index

Purpose

:

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

Chapter 3: Geometry Functions 663 Disassemble Actions

# # This file opens a new database "new.db" and # creates five lines. Later it merges the lines # to three lines 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_edit_line_merge() # has the following arguments: # # asm_edit_line_merge # ( line_ids, # curve_list, # nlines, # geotol, # niterations, # delete_orig, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_line_ids[32] STRING s_curve_list[32] INTEGER i_nlines REAL r_geotol INTEGER i_niterations LOGICAL l_delete_orig STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_line_xyz_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 s_line_ids = "#" curve_label(TRUE) # Create five curves. i_return_value = @ asm_const_line_xyz( "1", "<1 1 0>", "[0 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "2", "<1 0 0>", "[1 1 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "3", "<1 -1 0>","[2 1 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "4", "<1 0 0>", "[3 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "5", "<1 1 0>", "[4 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value s_curve_list = "curve 1:5"

Main Index

664 PCL Reference Manual Examples Disassemble Actions

i_nlines = 3 r_geotol = 0.005 i_niterations = 0 l_delete_orig = FALSE i_return_value = asm_edit_line_merge ( s_line_ids, s_curve_list, i_nlines, r_geotol, i_niterations, l_delete_orig, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_line_xyz_created) #---------------------------------------------------------------------

asm_edit_patch_blend

()

# # Purpose : This file provides an example of a call to the # function asm_edit_patch_blend() # # This file opens a new database "new.db" and # creates three surfaces. Later it blends the # surfaces such that first derivative continuity # is enforced at the boundaries. # # This file can be run 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_edit_patch_blend() # has the following arguments: # # asm_edit_patch_blend # ( patch_ids, # weights, # surface_list, # delete_orig, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_patch_ids[32] STRING s_edge_list[32] STRING s_weights[32] STRING s_surface_list[32] LOGICAL l_delete_orig STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_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 s_patch_ids = "#" surface_label(TRUE) i_return_value =

Main Index

@

Chapter 3: Geometry Functions 665 Disassemble Actions

ga_view_aa_set( 23., -34., 0. ) dump i_return_value # 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", "<1 0 1>", "[3 1 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value

@ @ @

@ @ @

i_return_value = @ sgm_const_surface_2curve( "3", "surface 1.2", @ "surface 2.4",sv_sgm_surface_2curve_created) dump i_return_value s_weights = "0.5" s_edge_list = "" s_surface_list = "surface 1:3" l_delete_orig = TRUE # Session file paused. Press "Resume" to continue.. sf_pause() # Blend the surfaces. i_return_value = asm_edit_patch_blend ( s_patch_ids, s_edge_list, s_weights, s_surface_list, l_delete_orig, sv_created_ids ) $? YES 1000030 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_sgm_surface_2curve_created) #---------------------------------------------------------------------

()

asm_edit_patch_break # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function asm_edit_patch_break() This file opens a new database "new.db" and creates a surface. Later it breaks it by parametric option. Finally it breaks one of the divided surface by point option. This file can be run 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_edit_patch_break()

666 PCL Reference Manual Examples Disassemble Actions

# has the following arguments: # # asm_edit_patch_break # ( patch_ids, # break_type, # break_entity_list, # param_pos, # delete_orig, # surface_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_patch_ids[32] INTEGER i_break_type STRING s_break_entity_list[32] REAL ra_param_pos(2) LOGICAL l_delete_orig 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 surface_label(TRUE) i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

s_patch_ids = "8" # Create 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 l_delete_orig

@ @ @

= FALSE

# Break the patch with break type parametric position. i_break_type = 0 s_surface_list = "surface 1" ra_param_pos(1) = 0.3 ra_param_pos(2) = 0.3 i_return_value = asm_edit_patch_break ( s_patch_ids, i_break_type, s_break_entity_list, ra_param_pos, l_delete_orig, s_surface_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @ @

# Break the patch with break type point option. s_patch_ids = "200" i_break_type = 1 s_surface_list = "surface 8" s_break_entity_list = "point 1" i_return_value =

Main Index

@

Chapter 3: Geometry Functions 667 Disassemble Actions

asm_edit_patch_break ( s_patch_ids, i_break_type, s_break_entity_list, ra_param_pos, l_delete_orig, 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) #---------------------------------------------------------------------

sgm_edit_brep_break_plane

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_brep_break_plane() # # This file opens a new database "new.db" and # creates a solid and a plane. Later it breaks # the surface along the plane 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 sgm_edit_brep_break_plane() # has the following arguments: # # sgm_edit_brep_break_plane # ( solid_list, # plane_list, # delete_flag, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_solid_list[32] STRING s_plane_list[32] LOGICAL l_delete_flag STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_hpat_xyz_created[VIRTUAL] STRING sv_sgm_create_plane_3p_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 solid_label(TRUE) i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value # Create a Solid. i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_created ) dump i_return_value

Main Index

@

@ @ @

668 PCL Reference Manual Examples Disassemble Actions

# Create a Plane. i_return_value = @ sgm_const_plane_3point( "1", "[0.5 0.5 0.5]", @ "[0.85 0.25 0.25]", "[0.25 0.25 0.85]", @ sv_sgm_create_plane_3p_created ) dump i_return_value s_solid_list = "solid 1" s_plane_list = "plane 1" l_delete_flag = FALSE # Break the solid with a plane. i_return_value = sgm_edit_brep_break_plane ( s_solid_list, s_plane_list, l_delete_flag, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_hpat_xyz_created) sys_free_string(sv_sgm_create_plane_3p_created) #---------------------------------------------------------------------

sgm_edit_brep_break_surface

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_brep_break_surface() # # This file opens a new database "new.db" and # creates a solid and a surface. Later it breaks # the solid along the surface 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 sgm_edit_brep_break_surface() # has the following arguments: # # sgm_edit_brep_break_surface # ( solid_list, # surface_list, # delete_flag, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_solid_list[32] STRING s_surface_list[32] LOGICAL l_delete_flag STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_hpat_xyz_created[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 =

Main Index

@

Chapter 3: Geometry Functions 669 Disassemble Actions

ga_view_aa_set( 23., -34., 0. ) dump i_return_value solid_label(TRUE) # Create a Solid. i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_created ) dump i_return_value

@ @ @

# Create a Surface. i_return_value = asm_const_patch_xyz( "1", "<1 1.5 1.2>", "[0.3 0 -0.5]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value

@ @ @

s_solid_list = "solid 1" s_surface_list = "surface 1" l_delete_flag = FALSE # Break the solid with a surface. i_return_value = sgm_edit_brep_break_surface ( s_solid_list, s_surface_list, l_delete_flag, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_hpat_xyz_created) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

sgm_edit_curve_break_parametric

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_curve_break_parametric() # # This file opens a new database "new.db" and # creates two circular curves. Later it breaks # the curves at a parametric value of 0.4. # # This file can be run 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_edit_curve_break_parametric() # has the following arguments: # # sgm_edit_curve_break_parametric # ( curve_ids, # c_pos, # curve_list, # delete_orig, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_ids[32]

Main Index

670 PCL Reference Manual Examples Disassemble Actions

REAL r_c_pos STRING s_curve_list[32] LOGICAL l_delete_orig 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 curve_label(TRUE) s_curve_ids = "#" r_c_pos = 0.4 s_curve_list = "curve 1 2" l_delete_orig = TRUE # Create two curves. i_return_value = sgm_const_curve_2d_circle_v1( "1", 1, 1., "Coord 0.3", "", "[0 0 0]", TRUE, sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = sgm_const_curve_2d_circle_v1( "2", 1, 0.7, "Coord 0.3", "", "[0 0 0]", TRUE, sv_sgm_create_curve_2d_created ) dump i_return_value # Break the Curve. i_return_value = sgm_edit_curve_break_parametric ( s_curve_ids, r_c_pos, s_curve_list, l_delete_orig, sv_created_ids ) $? YES 38000217 dump i_return_value dump sv_created_ids

@ @ @

@ @ @

@ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_sgm_create_curve_2d_created) #---------------------------------------------------------------------

()

sgm_edit_curve_break_plane # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_edit_curve_break_plane() This file opens a new database "new.db" and creates two circular curves and a plane. Later it breaks the curves using the created 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 sgm_edit_curve_break_plane() has the following arguments: sgm_edit_curve_break_plane

Chapter 3: Geometry Functions 671 Disassemble Actions

# ( curve_ids, # plane_list, # curve_list, # delete_flag, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_ids[32] STRING s_plane_list[32] STRING s_curve_list[32] LOGICAL l_delete_flag STRING sv_created_ids[VIRTUAL] STRING sv_sgm_create_curve_2d_created[VIRTUAL] STRING sv_sgm_create_plane_3p_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 curve_label(TRUE) s_curve_ids = "#" # Create two curves. i_return_value = sgm_const_curve_2d_circle_v1( "1", 1, 1., "Coord 0.3", "", "[0 0 0]", TRUE, sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = sgm_const_curve_2d_circle_v1( "2", 1, 0.7, "Coord 0.3", "", "[0 0 0]", TRUE, sv_sgm_create_curve_2d_created ) dump i_return_value

@ @ @

@ @ @

# Create a Plane. i_return_value = @ sgm_const_plane_3point( "1", "[0.2 0.2 0.2]", @ "[0.85 0.25 0.25]", "[0.25 0.25 0.85]", @ sv_sgm_create_plane_3p_created ) dump i_return_value s_plane_list = "plane 1" s_curve_list = "curve 1 2" l_delete_flag = TRUE # Break the Curve. i_return_value = sgm_edit_curve_break_plane ( s_curve_ids, s_plane_list, s_curve_list, l_delete_flag, sv_created_ids ) $? YESFORALL 38000217 dump i_return_value dump sv_created_ids

@ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_sgm_create_plane_3p_created) sys_free_string(sv_sgm_create_curve_2d_created) #---------------------------------------------------------------------

Main Index

672 PCL Reference Manual Examples Disassemble Actions

sgm_edit_curve_break_point

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_curve_break_point() # # This file opens a new database "new.db" and # creates two circular curves. Later it breaks # the curves at two 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 sgm_edit_curve_break_point() # has the following arguments: # # sgm_edit_curve_break_point # ( curve_ids, # point_list, # curve_list, # delete_orig, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_ids[32] STRING s_point_list[32] STRING s_curve_list[32] LOGICAL l_delete_orig 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 curve_label(TRUE) s_curve_ids = "#" # Create two curves. i_return_value = sgm_const_curve_2d_circle_v1( "1", 1, 1., "Coord 0.3", "", "[0 0 0]", TRUE, sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = sgm_const_curve_2d_circle_v1( "2", 1, 0.7, "Coord 0.3", "", "[0 0 0]", TRUE, sv_sgm_create_curve_2d_created ) dump i_return_value

@ @ @

@ @ @

s_point_list = "[-1 0 0] [0.7 0 0]" s_curve_list = "curve 1 2" l_delete_orig = TRUE # Break the Curve. i_return_value = sgm_edit_curve_break_point ( s_curve_ids, s_point_list, s_curve_list,

Main Index

@ @ @ @ @

Chapter 3: Geometry Functions 673 Disassemble Actions

l_delete_orig, sv_created_ids ) $? YES 38000217 dump i_return_value dump sv_created_ids

@

sys_free_string(sv_created_ids) sys_free_string(sv_sgm_create_curve_2d_created) #---------------------------------------------------------------------

sgm_edit_curve_disassemble

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_curve_disassemble() # # In this illustration, a new database is opened # 2 lines are created. Then the two curves are # joined to create a chain of curves. Finally # the function is called to disassemble the 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 sgm_edit_curve_disassemble() # has the following arguments: # # sgm_edit_curve_disassemble # ( curve_list, # delete_original ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_list[32] LOGICAL l_delete_original STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] INTEGER i_sgm_create_curve_cha_seg_id STRING sv_sgm_create_curve_ch_creat_id[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the curves curve_label(TRUE) # Create 2 curves i_return_value = asm_const_line_xyz( "", "<1 0 0><0 1 0>", "[0 0 0][0 0 0]", "Coord 0", sv_asm_create_line_xyz_creat_id ) dump i_return_value

@ @ @

# Create a chain of curve using Curve 1 2. Delete the original # curves. i_return_value = @ sgm_create_curve_chain_v1( "", "Curve 1 2 ", @ TRUE, i_sgm_create_curve_cha_seg_id, @ sv_sgm_create_curve_ch_creat_id ) $? YES 38000217 dump i_return_value

Main Index

674 PCL Reference Manual Examples Disassemble Actions

# Observe the Curve 3. It is a chain. # Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Disassemble the Curve 3 into Curve 4 & 5. Delete the Curve 3. # s_curve_list = "Curve 3" l_delete_original = TRUE i_return_value = sgm_edit_curve_disassemble ( s_curve_list, l_delete_original ) $? YES 38000217

@ @ @

dump i_return_value sys_free_string( sv_asm_create_line_xyz_creat_id ) sys_free_string( sv_sgm_create_curve_ch_creat_id ) #---------------------------------------------------------------------

sgm_edit_curve_extend_1curve

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_curve_extend_1curve() # # This file opens a new database "new.db" and # creates a semi circular curve. Later it # extends the curve 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 sgm_edit_curve_extend_1curve() # has the following arguments: # # sgm_edit_curve_extend_1curve # ( curve_ids, # extend_type, # length_type, # curve_length, # curveextendpoint, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_ids[32] INTEGER i_extend_type INTEGER i_length_type REAL r_curve_length STRING s_curveextendpoint[256] 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 curve_label(TRUE) s_curve_ids = "#" #

Main Index

Create a semi-circular curve.

Chapter 3: Geometry Functions 675 Disassemble Actions

i_return_value = sgm_const_curve_2d_arcangles_v1( "1", 1.,90., 270., "Coord 0.3", "[0 0 0]", TRUE, sv_sgm_create_curve_2d_created ) dump i_return_value i_extend_type = 2 i_length_type = 2 r_curve_length = 0.5 s_curveextendpoint = "Construct PointCurveUOnCurve (Evaluate Geometry (Point 1 )) (Evaluate Geo" // "metry (Curve 1 ))"

@ @ @

@ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Extend the curve i_return_value = sgm_edit_curve_extend_1curve ( s_curve_ids, i_extend_type, i_length_type, r_curve_length, s_curveextendpoint, 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) #---------------------------------------------------------------------

sgm_edit_curve_extend_2curve

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_curve_extend_2curve() # # This file opens a new database "new.db" and # creates two curves. Later it extends the # curves upto their intersection 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 sgm_edit_curve_extend_2curve() # has the following arguments: # # sgm_edit_curve_extend_2curve # ( curve_ids, # curve1_list, # curve2_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_ids[32] STRING s_curve1_list[32] STRING s_curve2_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"

Main Index

676 PCL Reference Manual Examples Disassemble Actions

uil_file_new.go("","new.db") $? YES 36000002 curve_label(TRUE) s_curve_ids = "#" # Create two curves. i_return_value = asm_const_line_3point( "1", "[0.5 0.8 0.0]", "[1.1 1.0 0]", "[0.5 0 0]", 1, 0.5, sv_asm_line_3point_created_ids ) dump i_return_value

@ @ @

i_return_value = @ asm_const_line_3point( "2", "[-0.5 0.8 0.0]", @ "[-1.1 1.0 0]", "[-0.5 0 0]", 1, 0.5, @ sv_asm_line_3point_created_ids ) dump i_return_value s_curve1_list = "curve 1" s_curve2_list = "curve 2" # Session file paused.Press resume to continue. sf_pause() # Extend the two curves till their intersection point. i_return_value = @ sgm_edit_curve_extend_2curve @ ( s_curve_ids, @ 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) #---------------------------------------------------------------------

sgm_edit_curve_extend_circle

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_curve_extend_circle() # # This file opens a new database "new.db" and # creates a curve. Later it extends the curve # by creating a full circle. # # This file can be run 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_edit_curve_extend_circle() # has the following arguments: # # sgm_edit_curve_extend_circle # ( curve_ids, # curveextendpoint, # delete_orig, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_ids[32]

Main Index

Chapter 3: Geometry Functions 677 Disassemble Actions

STRING s_curveextendpoint[256] LOGICAL l_delete_orig 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 curve_label(TRUE) s_curve_ids = "#" # Create a curve. i_return_value = asm_const_line_3point( "1", "[0.5 0.8 0.0]", "[1.1 1.0 0]", "[0.5 0 0]", 1, 0.5, sv_asm_line_3point_created_ids ) dump i_return_value

@ @ @

s_curveextendpoint = " Construct PointCurveUOnCurve(Evaluate @ Geometry (Point 1 )) (Evaluate Geometry (Curve 1 ))" l_delete_orig = FALSE # Session file paused. Press "Resume" to continue... sf_pause() # Extend the curve by creating a full circle. i_return_value = sgm_edit_curve_extend_circle ( s_curve_ids, s_curveextendpoint, l_delete_orig, 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) #---------------------------------------------------------------------

()

sgm_edit_curve_extend_points # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_edit_curve_extend_points() This file opens a new database "new.db" and creates a curve and two points. Later it extends the curve through the created 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 sgm_edit_curve_extend_points() has the following arguments: sgm_edit_curve_extend_points ( curve_ids, curve, point_list, created_ids )

678 PCL Reference Manual Examples Disassemble Actions

#--------------------------------------------------------------------# Variable Declarations STRING s_curve_ids[32] STRING s_curve[32] STRING s_point_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_line_xyz_created[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 a curve and two points. i_return_value = asm_const_line_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", sv_asm_create_line_xyz_created ) dump i_return_value

@ @

i_return_value = @ asm_const_grid_xyz("3 4","[1.3 1.1 0][.8 .9 0]",@ "Coord 0",sv_asm_create_grid_xyz_created ) dump i_return_value s_curve = "curve 1" s_point_list = "point 3 4 " # Session file paused. Press "Resume" to continue.. sf_pause() # Extend the curve. i_return_value = sgm_edit_curve_extend_points ( s_curve_ids, s_curve, s_point_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_line_xyz_created) #---------------------------------------------------------------------

()

sgm_edit_curve_merge # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_edit_curve_merge() This file opens a new database "new.db" and creates five lines. Later it merges the curves to three cubic 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 sgm_edit_curve_merge() has the following arguments: sgm_edit_curve_merge ( curve_ids, curve_list,

Chapter 3: Geometry Functions 679 Disassemble Actions

# num_curves, # merge_tol, # delete_original, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_ids[32] STRING s_curve_list[32] INTEGER i_num_curves REAL r_merge_tol LOGICAL l_delete_original STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_line_xyz_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 curve_label(TRUE) s_curve_ids = "#" # Create five curves. i_return_value = @ asm_const_line_xyz( "1", "<1 1 0>", "[0 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "2", "<1 0 0>", "[1 1 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "3", "<1 -1 0>","[2 1 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "4", "<1 0 0>", "[3 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value i_return_value = @ asm_const_line_xyz( "5", "<1 1 0>", "[4 0 0]",@ "Coord 0",sv_asm_create_line_xyz_created) dump i_return_value s_curve_list = "curve 1:5" i_num_curves = 3 r_merge_tol = 0.005 l_delete_original = FALSE i_return_value = sgm_edit_curve_merge ( s_curve_ids, s_curve_list, i_num_curves, r_merge_tol, l_delete_original, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_asm_create_line_xyz_created) #---------------------------------------------------------------------

Main Index

680 PCL Reference Manual Examples Disassemble Actions

sgm_edit_curve_refit

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_curve_refit() # # This file opens a new database "new.db" and # creates a curve. Later it refits this curve # 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 sgm_edit_curve_refit() # has the following arguments: # # sgm_edit_curve_refit # ( curve_ids, # curve_list, # refit_method, # refit_tolerance, # ncurves, # delete_original, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_ids[32] STRING s_curve_list[32] INTEGER i_refit_method REAL r_refit_tolerance INTEGER i_ncurves LOGICAL l_delete_original 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 s_curve_ids = "8" curve_label(TRUE) # Create a Curve. i_return_value = asm_const_line_3point( "1", "[0 0 0]", "[0.5 0.5 0]", "[1 0.4 0]", 1, 0.5, sv_asm_line_3point_created_ids ) dump i_return_value

@ @ @

s_curve_list = "curve 1" i_refit_method = 2 r_refit_tolerance = 0.005 i_ncurves = 2 l_delete_original = FALSE # Refit the curve. i_return_value = sgm_edit_curve_refit ( s_curve_ids, s_curve_list, i_refit_method,

Main Index

@ @ @ @ @

Chapter 3: Geometry Functions 681 Disassemble Actions

r_refit_tolerance, i_ncurves, l_delete_original, 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) #---------------------------------------------------------------------

sgm_edit_curve_reverse

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_curve_reverse() # # This file opens a new database "new.db" and # creates a curve and sets the display for # parametric direction. Later it reverses the # parametric direction 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 sgm_edit_curve_reverse() # has the following arguments: # # sgm_edit_curve_reverse # ( reverse_mesh, # curve_list, # reversed_ids ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_reverse_mesh STRING s_curve_list[32] STRING sv_reversed_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 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_parametric_set("general",1) dump i_return_value # Create one curve. i_return_value = asm_const_line_3point( "1", "[0 0 0 ]", "[0.5 0.5 0]", "[1.0 0.8 0]", 1, 0.5, sv_asm_line_3point_created_ids ) dump i_return_value

Main Index

@

@ @ @

682 PCL Reference Manual Examples Disassemble Actions

# Session file paused. Press "Resume" to continue.. sf_pause() # Reverse the parameterization of the curve. l_reverse_mesh = FALSE s_curve_list = "curve 1" i_return_value = sgm_edit_curve_reverse ( l_reverse_mesh, s_curve_list, sv_reversed_ids ) dump i_return_value dump sv_reversed_ids

@ @ @ @

sys_free_string(sv_reversed_ids) sys_free_string(sv_asm_line_3point_created_ids ) #---------------------------------------------------------------------

sgm_edit_curve_trim_parametric

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_curve_trim_parametric() # # This file opens a new database "new.db" and # creates a curve. Later it trims the curve # at parametric position of 0.5. # # This file can be run 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_edit_curve_trim_parametric() # has the following arguments: # # sgm_edit_curve_trim_parametric # ( c_pos, # curve_trimpoint, # trimmed_ids ) # #--------------------------------------------------------------------# Variable Declarations REAL r_c_pos STRING s_curve_trimpoint[256] STRING sv_trimmed_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 # Create a curve. i_return_value = asm_const_line_3point( "1", "[0 0 0 ]", "[0.5 0.5 0]", "[1.0 0.0 0]", 1, 0.5, sv_asm_line_3point_created_ids ) dump i_return_value

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() r_c_pos = 0.5 s_curve_trimpoint = "Construct PointCurveUOnCurve (Evaluate" // @

Main Index

Chapter 3: Geometry Functions 683 Disassemble Actions

" Geometry (Point 2 )) (Evaluate Geometry (Curve 1 ))" # Trim the curve. i_return_value = sgm_edit_curve_trim_parametric ( r_c_pos, s_curve_trimpoint, sv_trimmed_ids ) dump i_return_value dump sv_trimmed_ids

@ @ @ @

sys_free_string(sv_trimmed_ids) sys_free_string(sv_asm_line_3point_created_ids ) #---------------------------------------------------------------------

sgm_edit_curve_trim_point

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_curve_trim_point() # # This file opens a new database "new.db" and # creates a curve. Later it trims the curve # at a particular 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 sgm_edit_curve_trim_point() # has the following arguments: # # sgm_edit_curve_trim_point # ( trimpoint, # curve_trimpoint, # trimmed_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_trimpoint[32] STRING s_curve_trimpoint[256] STRING sv_trimmed_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 # Create a curve. i_return_value = asm_const_line_3point( "1", "[0 0 0 ]", "[0.5 0.5 0]", "[1.0 0.0 0]", 1, 0.5, sv_asm_line_3point_created_ids ) dump i_return_value

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() s_trimpoint = "[0.6 0.48 0]" s_curve_trimpoint = "Construct PointCurveUOnCurve (Evaluate" // @ " Geometry (Point 2 )) (Evaluate Geometry (Curve 1 ))" # Trim the curve. i_return_value =

Main Index

@

684 PCL Reference Manual Examples Disassemble Actions

sgm_edit_curve_trim_point ( s_trimpoint, s_curve_trimpoint, sv_trimmed_ids ) dump i_return_value dump sv_trimmed_ids

@ @ @

sys_free_string(sv_trimmed_ids) sys_free_string(sv_asm_line_3point_created_ids ) #---------------------------------------------------------------------

sgm_edit_solid_break_v1

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_solid_break_v1() # # This file opens a new database "new.db" and # creates a solid,a surface intersecting the # solid and a curve on one of the surfaces. # Later it breaks the solid by using break type # surface,curve and parametric position. # # This file can be run 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_edit_solid_break_v1() # has the following arguments: # # sgm_edit_solid_break_v1 # ( solid_ids, # break_type, # break_entity_list, # param_pos, # delete_orig, # solid_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_solid_ids[32] INTEGER i_break_type STRING s_break_entity_list[32] REAL ra_param_pos(3) LOGICAL l_delete_orig STRING s_solid_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_sgm_solid_2surface_created[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_asm_line_2point_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 solid_label(TRUE) s_solid_ids = "8"

Main Index

@

Chapter 3: Geometry Functions 685 Disassemble Actions

# Create a solid ,surface and a curve. 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.5>", "[0.5 2 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value

@ @ @

i_return_value = sgm_const_solid_2surface_v1( "1", TRUE, "Surface 1 ", "Surface 2 ", sv_sgm_solid_2surface_created ) dump i_return_value

@ @ @

i_return_value = asm_const_patch_xyz( "3", "<-2.5 0 -2.5>", "[2 1 2]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value

@ @ @

i_return_value = asm_const_line_2point( "1", "[1 0 0.5]", "Point 7 ", 0, "", 50., 1, sv_asm_line_2point_created ) dump i_return_value

@ @ @

l_delete_orig

= FALSE

# Session file paused. Press "Resume" to continue.. sf_pause() # Break the solid with break type surface. i_break_type = 4 s_break_entity_list = "surface 3" s_solid_list = "solid 1" i_return_value = sgm_edit_solid_break_v1 ( s_solid_ids, i_break_type, s_break_entity_list, ra_param_pos, l_delete_orig, s_solid_list, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Break the solid with break type curve. s_solid_ids = "100" i_break_type = 3 s_break_entity_list = "curve 1" s_solid_list = "solid 8" i_return_value = sgm_edit_solid_break_v1 ( s_solid_ids, i_break_type, s_break_entity_list, ra_param_pos, l_delete_orig, s_solid_list,

Main Index

@ @ @ @ @ @ @ @

686 PCL Reference Manual Examples Disassemble Actions

sv_created_ids ) dump i_return_value dump sv_created_ids # Session file paused. Press "Resume" to continue.. sf_pause() # Break the solid with break type parametric position. s_solid_ids = "200" i_break_type = 1 s_solid_list = "solid 9" ra_param_pos(1) = 0.0 ra_param_pos(2) = 0.0 ra_param_pos(3) = 0.5 i_return_value = sgm_edit_solid_break_v1 ( s_solid_ids, i_break_type, s_break_entity_list, ra_param_pos, l_delete_orig, s_solid_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_sgm_solid_2surface_created) sys_free_string(sv_asm_create_patch_xy_created) sys_free_string(sv_asm_line_2point_created) #---------------------------------------------------------------------

sgm_edit_solid_disassemble

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_solid_disassemble() # # In this illustration, a new database is opened. # A solid is created. Then the function is called # to disassemble the solid into its subordinate # surface faces. # # This file can be run 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_edit_solid_disassemble() # has the following arguments: # # sgm_edit_solid_disassemble # ( solid_list, # delete_orig, # crtd_lab ) #--------------------------------------------------------------------# Variable Declarations STRING s_solid_list[32] LOGICAL l_delete_orig STRING sv_crtd_lab[VIRTUAL] INTEGER i_return_value STRING sv_asm_create_hpat_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database

Main Index

Chapter 3: Geometry Functions 687 Disassemble Actions

uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the surfaces and solids. surface_label(TRUE) solid_label(TRUE) # Create a solid. i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_creat_id ) dump i_return_value # Change the view i_return_value = ga_view_aa_set( -67., 0., -34. ) dump i_return_value

@ @ @

@

# Observe the solid created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to disassemble the solid into its subordinate # surface faces. # s_solid_list = " Solid 1" l_delete_orig = TRUE i_return_value = sgm_edit_solid_disassemble ( s_solid_list, l_delete_orig, sv_crtd_lab ) $? YES 38000221 dump i_return_value

@ @ @ @

# The surfaces created dump sv_crtd_lab sys_free_string( sv_crtd_lab ) sys_free_string( sv_asm_create_hpat_xyz_creat_id ) #---------------------------------------------------------------------

()

sgm_edit_surface_break # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function sgm_edit_surface_break() This file opens a new database "new.db" and creates a surface and a curve. Later it breaks it by parametric option. Then it breaks one of the divided surface by point option.Finally it breaks other divided surface by curve option. This file can be run 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_edit_surface_break() has the following arguments:

688 PCL Reference Manual Examples Disassemble Actions

# sgm_edit_surface_break # ( surface_ids, # surface, # delete_orig, # break_method, # iuv, # uv, # point1, # point2, # curve, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_surface_ids[32] STRING s_surface[32] LOGICAL l_delete_orig INTEGER i_break_method INTEGER i_iuv REAL r_uv STRING s_point1[32] STRING s_point2[32] STRING s_curve[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_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 i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

surface_label(TRUE) s_surface_ids = "8" # Create surface and a curve. 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 = @ asm_const_line_2point( "1", "[-0.3 0.2 0.0]", @ "[1.2 0.2 0.0]", 0, "", 50., 1, @ sv_asm_line_2point_created_ids ) dump i_return_value l_delete_orig

= FALSE

# Break the patch with break type parametric position. s_surface = "surface 1" i_break_method = 1 i_iuv = 2 r_uv = 0.3 i_return_value = sgm_edit_surface_break ( s_surface_ids, s_surface, l_delete_orig, i_break_method, i_iuv, r_uv,

Main Index

@ @ @ @ @ @ @ @

Chapter 3: Geometry Functions 689 Disassemble Actions

s_point1, s_point2, s_curve, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Break the patch with break type point option. s_surface_ids = "100" s_surface = "surface 9" i_break_method = 2 s_point1 = "[0.0 0.7 0.0] " s_point2 = "[1.0 0.9 0.0] " i_return_value = sgm_edit_surface_break ( s_surface_ids, s_surface, l_delete_orig, i_break_method, i_iuv, r_uv, s_point1, s_point2, s_curve, sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @ @ @ @ @ @ @ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Break the patch with break type curve option. s_surface_ids = "200" s_surface = "surface 8" i_break_method = 3 s_curve = "curve 1" i_return_value = @ sgm_edit_surface_break @ ( s_surface_ids, @ s_surface, @ l_delete_orig, @ i_break_method, @ i_iuv, @ r_uv, @ s_point1, @ s_point2, @ s_curve, @ 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) #---------------------------------------------------------------------

()

sgm_edit_surface_break_v1 # # # #

Main Index

Purpose

:

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

690 PCL Reference Manual Examples Disassemble Actions

# This file opens a new database "new.db" and # creates three surfaces and a curve. Later it # breaks the two surfaces using the surface # option. Later it breaks the divided surface # using curve option # # This file can be run 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_edit_surface_break_v1() # has the following arguments: # # sgm_edit_surface_break_v1 # ( surface_ids, # surface_list, # delete_orig, # break_type, # iuv # uv, # point1_list, # point2_list, # break_entity_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_surface_ids[32] STRING s_surface_list[32] LOGICAL l_delete_orig INTEGER i_break_type INTEGER i_iuv REAL r_uv STRING s_point1_list[32] STRING s_point2_list[32] STRING s_break_entity_list[32] STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_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 i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

surface_label(TRUE) s_surface_ids = "8" # Create surface and a curve. i_return_value = asm_const_patch_xyz( "1 2 3", "<1 1 0><1 1 0><3.0 0 2.2>", "[0 0 0][1.2 0 0][-0.2 0.6 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value

@ @ @ @

i_return_value = @ asm_const_line_2point( "1", "[-0.3 0.2 0.0]", @ "[2.5 0.2 0.0]", 0, "", 50., 1, @ sv_asm_line_2point_created_ids ) dump i_return_value l_delete_orig

Main Index

= TRUE

Chapter 3: Geometry Functions 691 Disassemble Actions

# Session file paused. Press "Resume" to continue.. sf_pause() # Break the surface with break type surface option. s_surface_list = "surface 1 2" i_break_type = 4 s_break_entity_list = "surface 3 3" i_return_value = @ sgm_edit_surface_break_v1 @ ( s_surface_ids, @ s_surface_list, @ l_delete_orig, @ i_break_type, @ i_iuv, @ r_uv, @ s_point1_list, @ s_point2_list, @ s_break_entity_list, @ sv_created_ids ) $? YES 38000219 dump i_return_value dump sv_created_ids # Session file paused. Press "Resume" to continue.. sf_pause() # Break the surface with break type curve option. s_surface_ids = "100" s_surface_list = "surface 8 10" i_break_type = 3 s_break_entity_list = "curve 1 1" i_return_value = @ sgm_edit_surface_break_v1 @ ( s_surface_ids, @ s_surface_list, @ l_delete_orig, @ i_break_type, @ i_iuv, @ r_uv, @ s_point1_list, @ s_point2_list, @ s_break_entity_list, @ 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_line_2point_created_ids) #---------------------------------------------------------------------

sgm_edit_surface_break_plane # # # # # # # # # # #

Main Index

Purpose

:

()

This file provides an example of a call to the function sgm_edit_surface_break_plane() This file opens a new database "new.db" and creates two surfaces and a plane. Later it breaks the surfaces using the created plane. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown

692 PCL Reference Manual Examples Disassemble Actions

# menus on the menu bar. # # The function sgm_edit_surface_break_plane() # has the following arguments: # # sgm_edit_surface_break_plane # ( surface_ids, # surface_list, # plane_list, # delete_flag, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_surface_ids[32] STRING s_plane_list[32] STRING s_surface_list[32] LOGICAL l_delete_flag STRING sv_created_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL] STRING sv_sgm_create_plane_3p_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 surface_label(TRUE) s_surface_ids = "8" # Create two surfaces. 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 = asm_const_patch_xyz( "2", "<1 1 0>", "[1.1 0 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value # Create a Plane. i_return_value = sgm_const_plane_3point( "1", "[0 0.2 0]", "[0.25 0.25 -0.25]", "[0.25 0.25 0.25]", sv_sgm_create_plane_3p_created ) dump i_return_value

@ @ @

@ @ @

@ @ @

s_plane_list = "plane 1 1" s_surface_list = "surface 1 2" l_delete_flag = TRUE # Break the surface. i_return_value = sgm_edit_surface_break_plane ( s_surface_ids, s_surface_list, s_plane_list, l_delete_flag, sv_created_ids ) $? YESFORALL 38000219 dump i_return_value dump sv_created_ids sys_free_string(sv_created_ids) sys_free_string(sv_sgm_create_plane_3p_created)

Main Index

@ @ @ @ @ @

Chapter 3: Geometry Functions 693 Disassemble Actions

sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

sgm_edit_surface_disassemble

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_surface_disassemble() # # In this illustration, a new database is opened. # A trimmed surface is created. The function is # called to disassemble the trimmed surface into # its parent surface and edge 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 sgm_edit_surface_disassemble() # has the following arguments: # # sgm_edit_surface_disassemble # ( surface_list, # delete_orig ) # #--------------------------------------------------------------------# Variable Declarations STRING s_surface_list[128] LOGICAL l_delete_orig INTEGER i_return_value STRING s_output_ids[128] STRING s_curveo_list[128] STRING s_curvei_list[128] STRING s_surface[128] LOGICAL l_delete_ocurve LOGICAL l_delete_icurve LOGICAL l_delete_surf STRING s_created_ids[128] INTEGER i_sgm_create_curve_aut_segt_id STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_asm_line_2point_creat_id[VIRTUAL] STRING sv_sgm_create_curve_2d_creat_id[VIRTUAL] STRING sv_sgm_creat_cur_creat_curve_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the surfaces and curves. surface_label(TRUE) curve_label(TRUE) # Create a patch. i_return_value = asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value # Create 4 points. i_return_value = asm_const_grid_xyz( "", "[5 0 0] [0 5 0] "// "[5 10 0][10 5 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id

Main Index

@ @ @

@ @ @ )

694 PCL Reference Manual Examples Disassemble Actions

dump i_return_value # Create 4 curves. i_return_value = asm_const_line_2point( "", "Point 5:8 ", "Point 6 7 8 5", 0, "", 50., 1, sv_asm_line_2point_creat_id ) dump i_return_value # Create a circular curve. i_return_value = sgm_const_curve_2d_circle_v1( "", 1, 1., "Coord 0.3", "", "[5 5 0]", TRUE , sv_sgm_create_curve_2d_creat_id ) dump i_return_value # Convert the Curve 1:4 into a chain curve. i_return_value = sgm_create_curve_chain_v1( "10", " Curve 1:4", TRUE, i_sgm_create_curve_aut_segt_id, sv_sgm_creat_cur_creat_curve_id ) $? YES 38000217

@ @ @

@ @ @

@ @ @ @

# Observe the curves and the surface. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to create a trimmed surface inside Surface 1 # with Curve 10 as outer boundary trim curve and Curve 5 as inner # boundary trim curve. # s_output_ids = "2" s_curveo_list = "Curve 10" s_curvei_list = "Curve 5" s_surface = "Surface 1" l_delete_ocurve = TRUE l_delete_icurve = TRUE l_delete_surf = TRUE i_return_value = sgm_create_surface_trimmed ( s_output_ids, s_curveo_list, s_curvei_list, s_surface, l_delete_ocurve, l_delete_icurve, l_delete_surf, s_created_ids ) $? YES 38000217 $? YES 38000217 $? YES 38000219 dump i_return_value

@ @ @ @ @ @ @ @ @

# Created surface is dump s_created_ids # Observe the trimmed surface created. # Session file paused. Press "Resume" to continue... sf_pause() #--------------------------------------------------------------------# Call the function to disassemble the trimmed surface into its # parent surface. # s_surface_list = "Surface 2" l_delete_orig = TRUE

Main Index

Chapter 3: Geometry Functions 695 Disassemble Actions

i_return_value = sgm_edit_surface_disassemble ( s_surface_list, l_delete_orig ) $? YES 38000219 dump i_return_value

@ @ @

sys_free_string( sys_free_string( sys_free_string( sys_free_string( sys_free_string(

) )

sv_asm_create_patch_xy_creat_id sv_asm_create_grid_xyz_creat_id sv_asm_line_2point_creat_id ) sv_sgm_create_curve_2d_creat_id sv_sgm_creat_cur_creat_curve_id

) )

# Press "Refresh Graphics" radio button to repaint the graphics # window. #---------------------------------------------------------------------

sgm_edit_surface_refit

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_surface_refit() # # This file opens a new database "new.db" and # creates a surface. Later it refits the surface # 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 sgm_edit_surface_refit() # has the following arguments: # # sgm_edit_surface_refit # ( curve_ids, # refit_to_nurbs, # refit_tolerance, # delete_original, # surface_list, # created_ids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_ids[32] LOGICAL l_refit_to_nurbs REAL r_refit_tolerance LOGICAL l_delete_original STRING s_surface_list[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 i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value surface_label(TRUE) s_curve_ids = "#" #

Main Index

Create two surfaces.

@

696 PCL Reference Manual Examples Disassemble Actions

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_surface_revolve("1","coord 0.1",90.,@ 0.,"coord 0","curve 1",sv_created_ids) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() s_surface_list = "surface 1" l_refit_to_nurbs = FALSE r_refit_tolerance = 0.005 l_delete_original = FALSE # Refit the curve. i_return_value = sgm_edit_surface_refit ( s_curve_ids, l_refit_to_nurbs, r_refit_tolerance, l_delete_original, s_surface_list, 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) #---------------------------------------------------------------------

sgm_edit_surface_reverse

()

# # Purpose : This file provides an example of a call to the # function sgm_edit_surface_reverse() # # This file opens a new database "new.db" and # creates a surface and sets the display for # parametric direction. Later it reverses the # parametric direction 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 sgm_edit_surface_reverse() # has the following arguments: # # sgm_edit_surface_reverse # ( reverse_mesh, # surface_list, # reversed_ids ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_reverse_mesh STRING s_surface_list[32] STRING sv_reversed_ids[VIRTUAL] STRING sv_asm_create_patch_xy_created[VIRTUAL]

Main Index

Chapter 3: Geometry Functions 697 Disassemble Actions

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_parametric_set("general",1) dump i_return_value

@

# 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 # Session file paused. Press "Resume" to continue.. sf_pause() # Reverse the parameterization of the surface. l_reverse_mesh = FALSE s_surface_list = "surface 1" i_return_value = @ sgm_edit_surface_reverse @ ( l_reverse_mesh, @ s_surface_list, @ sv_reversed_ids ) dump i_return_value dump sv_reversed_ids sys_free_string(sv_reversed_ids) sys_free_string(sv_asm_create_patch_xy_created) #--------------------------------------------------------------------Delete Actions This section contains examples of some of the functions used to implement the “Delete” actions.

()

asm_delete_coord # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function asm_delete_coord() This file opens a new database "new.db" and creates two coordinate frames. Later it deletes these coordinates 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_delete_coord() has the following arguments: asm_delete_coord

698 PCL Reference Manual Examples Disassemble Actions

# ( coord_list, # deleted_coords ) # #--------------------------------------------------------------------# Variable Declarations STRING s_coord_list[32] STRING sv_deleted_coords[VIRTUAL] STRING sv_asm_create_cord_3po_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Creating two coordinate frames. i_return_value = asm_const_coord_3point( "1", "Coord 0", 1, "[.3 .3 .3]", "[.3 .3 2]", "[2 .3 .3]", sv_asm_create_cord_3po_created ) dump i_return_value i_return_value = asm_const_coord_3point( "2", "Coord 0", 2, "[.5 .5 .5]", "[.5 .5 2]","[2 .5 .5]" , sv_asm_create_cord_3po_created ) dump i_return_value

@ @ @

@ @ @

s_coord_list = "coord 1 2" # Session file paused. Press "Resume" to continue.. sf_pause() # Delete the coordinate frames. i_return_value = asm_delete_coord ( s_coord_list, sv_deleted_coords ) dump i_return_value dump sv_deleted_coords

@ @ @

sys_free_string(sv_deleted_coords) sys_free_string(sv_asm_create_cord_3po_created) #---------------------------------------------------------------------

()

asm_delete_curve # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function asm_delete_curve() This file opens a new database "new.db" and creates two curves. Later it deletes these 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_delete_curve() has the following arguments: asm_delete_curve ( curve_list, deleted_curves )

Chapter 3: Geometry Functions 699 Disassemble Actions

#--------------------------------------------------------------------# Variable Declarations STRING s_curve_list[32] STRING sv_deleted_curves[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 curve_label(TRUE) # Creating two curves. i_return_value = sgm_const_curve_2d_circle_v1( "1", 1, 1., "Coord 0.3", "", "[0 0 0]", TRUE, sv_sgm_create_curve_2d_created ) dump i_return_value i_return_value = sgm_const_curve_2d_circle_v1( "2", 1, 0.8, "Coord 0.3", "", "[0 0 0]", TRUE, sv_sgm_create_curve_2d_created ) dump i_return_value

@ @ @

@ @ @

s_curve_list = "curve 1 2" # Session file paused. Press "Resume" to continue.. sf_pause() # Delete the curves. i_return_value = asm_delete_curve ( s_curve_list, sv_deleted_curves ) dump i_return_value dump sv_deleted_curves

@ @ @

sys_free_string(sv_deleted_curves) sys_free_string(sv_sgm_create_curve_2d_created) #---------------------------------------------------------------------

asm_delete_grid

()

# # Purpose : This file provides an example of a call to the # function asm_delete_grid() # # This file opens a new database "new.db" and # creates two grids. Later it deletes these # grids 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_delete_grid() # has the following arguments: # # asm_delete_grid # ( point_list, # deleted_points ) # #---------------------------------------------------------------------

Main Index

700 PCL Reference Manual Examples Disassemble Actions

# Variable Declarations STRING s_point_list[32] STRING sv_deleted_points[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 point_label(TRUE) # Creating two grids. i_return_value = @ asm_const_grid_xyz( "100", "[0.5 0.5 0]", @ "Coord 0", sv_asm_create_grid_xyz_created ) dump i_return_value i_return_value = @ asm_const_grid_xyz( "200", "[0.7 0.7 0]", @ "Coord 0",sv_asm_create_grid_xyz_created ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() s_point_list = "point 100 200" # Delete the grids. i_return_value = asm_delete_grid ( s_point_list, sv_deleted_points ) dump i_return_value dump sv_deleted_points

@ @ @

sys_free_string(sv_deleted_points) sys_free_string(sv_asm_create_grid_xyz_created) #---------------------------------------------------------------------

asm_delete_hpat

()

# # Purpose : This file provides an example of a call to the # function asm_delete_hpat() # # This file opens a new database "new.db" and # creates two hpats. Later it deletes the hpats # 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_delete_hpat() # has the following arguments: # # asm_delete_hpat # ( solid_list, # deleted_solids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_solid_list[32] STRING sv_deleted_solids[VIRTUAL]

Main Index

Chapter 3: Geometry Functions 701 Disassemble Actions

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 solid_label(TRUE) i_return_value = ga_view_aa_set(23.,-34.,0) dump i_return_value

@

# Create 2 hpats. i_return_value = asm_const_hpat_xyz( "100", "<0.3 0.3 0.3>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_created ) dump i_return_value i_return_value = asm_const_hpat_xyz( "200", "<0.4 0.4 0.4>", "[0.3 0.3 0.3]", "Coord 0", sv_asm_create_hpat_xyz_created ) dump i_return_value

@ @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() s_solid_list = "solid 100 200" # Delete 2 hpats. i_return_value = asm_delete_hpat ( s_solid_list, sv_deleted_solids ) dump i_return_value dump sv_deleted_solids

@ @ @

sys_free_string( sv_deleted_solids ) sys_free_string( sv_asm_create_hpat_xyz_created ) #---------------------------------------------------------------------

asm_delete_line

()

# # Purpose : This file provides an example of a call to the # function asm_delete_line() # # This file opens a new database "new.db" and # creates two lines. Later it deletes these # lines 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_delete_line() # has the following arguments: # # asm_delete_line # ( curve_list, # deleted_curves ) # #--------------------------------------------------------------------# Variable Declarations

Main Index

702 PCL Reference Manual Examples Disassemble Actions

STRING s_curve_list[32] STRING sv_deleted_curves[VIRTUAL] STRING sv_asm_line_3point_created[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. i_return_value = asm_const_line_3point( "1", "[0 0.7 0]", "[0.5 1 0]", "[0 0 0 ]", 1, 0.5, sv_asm_line_3point_created ) dump i_return_value i_return_value = asm_const_line_3point( "2", "[0 0.7 0]", "[-0.5 1 0]", "[0 0 0 ]", 1, 0.5, sv_asm_line_3point_created ) dump i_return_value

@ @ @

@ @ @

s_curve_list = "line 1 2" # Session file paused. Press "Resume" to continue.. sf_pause() # Delete the lines. i_return_value = asm_delete_curve ( s_curve_list, sv_deleted_curves ) dump i_return_value dump sv_deleted_curves

@ @ @

sys_free_string(sv_deleted_curves) sys_free_string(sv_asm_line_3point_created) #---------------------------------------------------------------------

asm_delete_patch

()

# # Purpose : This file provides an example of a call to the # function asm_delete_patch() # # This file opens a new database "new.db" and # and creates a two patches. Later it deletes # the created patches. # # This file can be run 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_delete_patch() # has the following arguments: # # asm_delete_patch # ( surface_list, # deleted_surfaces ) # #--------------------------------------------------------------------# Variable Declarations STRING s_surface_list[32]

Main Index

Chapter 3: Geometry Functions 703 Disassemble Actions

STRING sv_deleted_surfaces[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 surface_label(TRUE) # Create 2 patches. i_return_value = asm_const_patch_xyz( "1", "<0.3 0.3 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value i_return_value = asm_const_patch_xyz( "2", "<0.4 0.4 0>", "[0.3 0.3 0]", "Coord 0", sv_asm_create_patch_xy_created ) dump i_return_value

@ @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() s_surface_list = "patch 1 2" # Delete the 2 patches. i_return_value = asm_delete_patch ( s_surface_list, sv_deleted_surfaces ) dump i_return_value dump sv_deleted_surfaces

@ @ @

sys_free_string(sv_deleted_surfaces) sys_free_string(sv_asm_create_patch_xy_created) #---------------------------------------------------------------------

asm_delete_plane

()

# # Purpose : This file provides an example of a call to the # function asm_delete_plane() # # This file opens a new database "new.db" and # creates two planes. Later it deletes the # created 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_delete_plane() # has the following arguments: # # asm_delete_plane # ( plane_list, # deleted_planes ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plane_list[32] STRING sv_deleted_planes[VIRTUAL] STRING sv_sgm_create_plane_3p_created[VIRTUAL]

Main Index

704 PCL Reference Manual Examples Disassemble Actions

INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create two planes. i_return_value = sgm_const_plane_3point( "1", "[0 0 0]", "[0.5 1 0]", "[1 0 0]", sv_sgm_create_plane_3p_created ) dump i_return_value i_return_value = sgm_const_plane_3point( "2", "[0.3 0.3 0]", "[2 2 2]", "[3 3 3]", sv_sgm_create_plane_3p_created ) dump i_return_value

@ @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() s_plane_list = "plane 1 2" # Delete the planes. i_return_value = asm_delete_plane ( s_plane_list, sv_deleted_planes ) dump i_return_value dump sv_deleted_planes

@ @ @

sys_free_string(sv_deleted_planes) sys_free_string(sv_sgm_create_plane_3p_created) #---------------------------------------------------------------------

asm_delete_point

()

# # Purpose : This file provides an example of a call to the # function asm_delete_point() # # This file opens a new database "new.db" and # creates two points. Later it deletes these # points 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_delete_point() # has the following arguments: # # asm_delete_point # ( point_list, # deleted_points ) # #--------------------------------------------------------------------# Variable Declarations STRING s_point_list[32] STRING sv_deleted_points[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")

Main Index

Chapter 3: Geometry Functions 705 Disassemble Actions

$? YES 36000002 point_label(TRUE) # Creating two points. i_return_value = @ asm_const_grid_xyz( "100", "[0.5 0.5 0]", @ "Coord 0", sv_asm_create_grid_xyz_created ) dump i_return_value i_return_value = @ asm_const_grid_xyz( "200", "[0.7 0.7 0]", @ "Coord 0",sv_asm_create_grid_xyz_created ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() s_point_list = "point 100 200" # Delete the points. i_return_value = asm_delete_point ( s_point_list, sv_deleted_points ) dump i_return_value dump sv_deleted_points

@ @ @

sys_free_string(sv_deleted_points) sys_free_string(sv_asm_create_grid_xyz_created) #---------------------------------------------------------------------

asm_delete_solid

()

# # Purpose : This file provides an example of a call to the # function asm_delete_solid() # # This file opens a new database "new.db" and # creates two solids. Later it deletes the # solids 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_delete_solid() # has the following arguments: # # asm_delete_solid # ( solid_list, # deleted_solids ) # #--------------------------------------------------------------------# Variable Declarations STRING s_solid_list[32] STRING sv_deleted_solids[VIRTUAL] STRING sv_sgm_create_surface_created[VIRTUAL] STRING sv_sgm_sweep_solid_rev_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

706 PCL Reference Manual Examples Disassemble Actions

solid_label(TRUE) # Create two solids. i_return_value = sgm_const_surface_vertex( "1", "[1 1 1]", "[2 1 1]", "[2 2 1]", "[1 2 1]", sv_sgm_create_surface_created ) dump i_return_value

@ @ @

i_return_value = sgm_const_solid_revolve( "1", "Coord 0.3", 90., 0., "Coord 0", "Surface 1 ", sv_sgm_sweep_solid_rev_created ) dump i_return_value

@ @ @

i_return_value = sgm_const_solid_revolve( "2", "Coord 0.3", 90., 180., "Coord 0", "Surface 1 ", sv_sgm_sweep_solid_rev_created ) dump i_return_value

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() s_solid_list = "solid 1 2" # Delete the solids. i_return_value = asm_delete_solid ( s_solid_list, sv_deleted_solids ) dump i_return_value dump sv_deleted_solids

@ @ @

sys_free_string(sv_deleted_solids) sys_free_string(sv_sgm_create_surface_created) sys_free_string(sv_sgm_sweep_solid_rev_created) #---------------------------------------------------------------------

asm_delete_surface

()

# # Purpose : This file provides an example of a call to the # function asm_delete_surface() # # This file opens a new database "new.db" and # and creates a two surfaces. Later it deletes # the 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_delete_surface() # has the following arguments: # # asm_delete_surface # ( surface_list, # deleted_surfaces ) # #--------------------------------------------------------------------# Variable Declarations STRING s_surface_list[32] STRING sv_deleted_surfaces[VIRTUAL] STRING sv_sgm_create_surface_created[VIRTUAL] INTEGER i_return_value

Main Index

Chapter 3: Geometry Functions 707 Disassemble Actions

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 surface_label(TRUE) # Create 2 surfaces. i_return_value = sgm_const_surface_vertex( "1", "[1 1 1]", "[2 1 1]", "[2 2 1]", "[1 2 1]", sv_sgm_create_surface_created ) dump i_return_value i_return_value = sgm_const_surface_vertex( "2", "[0 0 0]", "[1 0 0]", "[1 1 0]", "[0 1 0]", sv_sgm_create_surface_created ) dump i_return_value

@ @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() s_surface_list = "surface 1 2" # Delete the 2 surfaces. i_return_value = asm_delete_surface ( s_surface_list, sv_deleted_surfaces ) dump i_return_value dump sv_deleted_surfaces

@ @ @

sys_free_string(sv_deleted_surfaces) sys_free_string(sv_sgm_create_surface_created) #---------------------------------------------------------------------

asm_delete_vector

()

# # Purpose : This file provides an example of a call to the # function asm_delete_vector() # # This file opens a new database "new.db" and # creates two vectors. Later it deletes these # vectors 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_delete_vector() # has the following arguments: # # asm_delete_vector # ( vector_list, # deleted_vectors ) # #--------------------------------------------------------------------# Variable Declarations STRING s_vector_list[32] STRING sv_deleted_vectors[VIRTUAL] STRING sv_sgm_create_vector_m_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db"

Main Index

708 PCL Reference Manual Examples Disassemble Actions

uil_file_new.go("","new.db") $? YES 36000002 # Create two vectors. i_return_value = sgm_const_vector_magnitude( "1", "2.0", "<1 0 0>", "[0 0 0]", "Coord 0", sv_sgm_create_vector_m_created ) dump i_return_value i_return_value = sgm_const_vector_magnitude( "2", "4.0", "<2 2 2>", "[1 1 1]", "Coord 0", sv_sgm_create_vector_m_created ) dump i_return_value

@ @ @

@ @ @

# Session file paused. Press "Resume" to continue.. sf_pause() s_vector_list = "vector 1 2" # Delete the vectors. i_return_value = asm_delete_vector ( s_vector_list, sv_deleted_vectors ) dump i_return_value dump sv_deleted_vectors

@ @ @

sys_free_string(sv_deleted_vectors) sys_free_string(sv_sgm_create_vector_m_created) #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions PCL Reference Manual Examples

4

Main Index

Finite Element Functions 

Introduction



Create Action



Transform Action



Sweep Action



Renumber Action



Disassociate Action

782



Equivalence Action

785



Optimize Action



Verify Action

802



Show Action

882



Modify Action

885



Delete Action

905



Utilities

914

710 711 745

754 779

800

710 PCL Reference Manual Examples Introduction

Introduction This chapter provides examples for functions that are used in the implementation of the “Finite Elements” switch bar form. See Finite Element Functions (Ch. 4) in the PCL Reference Manual for a description of these functions.

Main Index

Chapter 4: Finite Element Functions 711 Create Action

Create Action This section contains examples of some of the functions used to create finite element model (FEM) nodes, elements, multi-point constraints (MPCs), meshes, and mesh seeds. fem_create_nodes_1

()

# # Purpose : This file provides an example of a call to the # function fem_create_nodes_1() # # This session file create a new database by name # new.db. A point will be created and this point # will be used for creating a node. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_create_nodes() # has the following arguments: # # fem_create_nodes_1 # ( ref_coord_frame, # anly_coord_frame, # flag_geometry, # node_select, # point_select ) # #--------------------------------------------------------------------# Variable Declarations STRING s_ref_coord_frame[32] STRING s_anly_coord_frame[32] INTEGER i_flag_geometry STRING s_node_select[32] STRING s_point_select[32] STRING sv_fem_nodes_created[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# A point is created by giving ’xyz’ coordinates. i_return_value = @ asm_const_grid_xyz("1", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value node_label( TRUE ) point_label( TRUE ) #--------------------------------------------------------------------# Calling function to create node at the point. s_ref_coord_frame = "Coord 0" s_anly_coord_frame = "Coord 0" i_flag_geometry = TRUE s_node_select = "11" s_point_select = "Point 1" # i_return_value = @ fem_create_nodes @ ( s_ref_coord_frame, @ s_anly_coord_frame, @

Main Index

712 PCL Reference Manual Examples Create Action

i_flag_geometry, @ s_node_select, s_point_select, sv_fem_nodes_created ) dump i_return_value dump sv_fem_nodes_created

@ @

sys_free_string(sv_fem_nodes_created) sys_free_string(sv_created_ids) #----------------------------------------------------------------------

fem_create_elems_1

()

# # Purpose : This file provides an example of a call to the # function fem_create_elems_1() # # This session file will create a new database by # name new.db and nodes will be created. The # nodes will be used to create elements. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_create_elems() # has the following arguments: # # fem_create_elems_1 # ( shape, # element_type, # element_select, # connection_pattern, # flag, # corner1_node_select, # corner2_node_select, # corner3_node_select, # corner4_node_select, # corner5_node_select, # corner6_node_select, # corner7_node_select, # corner8_node_select, # fem_elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_shape[32] STRING s_element_type[32] STRING s_element_select[32] STRING s_connection_pattern[32] INTEGER i_flag STRING s_corner1_node_select[32] STRING s_corner2_node_select[32] STRING s_corner3_node_select[32] STRING s_corner4_node_select[32] STRING s_corner5_node_select[32] STRING s_corner6_node_select[32] STRING s_corner7_node_select[32] STRING s_corner8_node_select[32] STRING s_fem_elements_created[260] INTEGER i_return_value STRING sv_fem_nodes_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db")

Main Index

Chapter 4: Finite Element Functions 713 Create Action

$? YES 36000002 #--------------------------------------------------------------------# Creating 16 nodes without using any geometry. i_return_value = @ fem_create_nodes("Coord 0", "Coord 0", FALSE, @ "1", "[0 0 0][0 1 0][1 0 0][0.5 1 0]"// @ "[1 0 1][0.5 1 1][0 0 1][0 1 1][0 1 0]"// @ "[0 2 0][1 1 0][0.5 2 0][1 1 1][0.5 2 1]"//@ "[0 1 1][0 2 1]", sv_fem_nodes_created) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set(23., -34., 0.) dump i_return_value node_label( TRUE ) hex_elem_label( TRUE ) #--------------------------------------------------------------------# Calling function to create 2 HEX27 elements. s_shape = "Hex" s_element_type = "Hex27" s_element_select = "1 10" s_connection_pattern = "Standard" i_flag = TRUE s_corner1_node_select = "Node 1 2" s_corner2_node_select = "Node 3 4" s_corner3_node_select = "Node 5 6" s_corner4_node_select = "Node 7 8" s_corner5_node_select = "Node 9 10" s_corner6_node_select = "Node 11 12" s_corner7_node_select = "Node 13 14" s_corner8_node_select = "Node 15 16" # i_return_value = @ fem_create_elems_1 @ ( s_shape, @ s_element_type, @ s_element_select, @ s_connection_pattern, @ i_flag, @ s_corner1_node_select, @ s_corner2_node_select, @ s_corner3_node_select, @ s_corner4_node_select, @ s_corner5_node_select, @ s_corner6_node_select, @ s_corner7_node_select, @ s_corner8_node_select, @ s_fem_elements_created ) dump i_return_value dump s_fem_elements_created sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

()

fem_create_mpc_nodal # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_create_mpc_nodal() This session file will create a new database by name new.db. Two 2D circle will be created. These two curves will be meshed and the above mentioned function will be called to create a mpc between two nodes.

714 PCL Reference Manual Examples Create Action

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_create_mpc_nodal() # has the following arguments: # # fem_create_mpc_nodal # ( mpc_id, # mpc_type, # constant, # num_terms, # dependancy_state, # term_coefficients, # node_select, # freedom_select ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_mpc_id STRING s_mpc_type[32] REAL r_constant INTEGER i_num_terms LOGICAL la_dependancy_state(3) REAL ra_term_coefficients(3) STRING saa_node_select[16](3) STRING saa_freedom_select[4](3) INTEGER i_return_value STRING sv_created_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 #--------------------------------------------------------------------# Creating two circles. i_return_value = @ sgm_const_curve_2d_circle_v1( "1", 1, 1., @ "Coord 0.3", "", "[0 0 0][0 0 0.1]", FALSE, sv_created_ids ) dump i_return_value # Meshing the two curves with Bar elements. i_return_value = @ fem_create_mesh_curv( "Curve 1 2 ", 0.2, @ "Bar2", "1", "1", "Coord 0" , "Coord 0", @ i_num_nodes, i_num_elems, sv_nodes_created, sv_elems_created ) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 23., -34., 0. ) dump i_return_value node_label( TRUE ) mpc_label( TRUE ) #--------------------------------------------------------------------# Calling function to create a mpc between two nodes. i_mpc_id = 1 s_mpc_type = "Explicit" r_constant = 1.11 i_num_terms = 3 la_dependancy_state = [TRUE, FALSE, FALSE] ra_term_coefficients = [0., 2., 2.] saa_node_select(1) = "Node 4"

Main Index

Chapter 4: Finite Element Functions 715 Create Action

saa_node_select(2) = "Node 37" saa_node_select(3) = "Node 35" saa_freedom_select(1)= "UX" saa_freedom_select(2)= "UX" saa_freedom_select(3)= "UX" # i_return_value = fem_create_mpc_nodal ( i_mpc_id, s_mpc_type, r_constant, i_num_terms, la_dependancy_state, ra_term_coefficients, saa_node_select, saa_freedom_select ) dump i_return_value

@ @ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_nodes_created) sys_free_string(sv_elems_created) #---------------------------------------------------------------------

fem_create_mpc_sliding_surface

()

# # Purpose : This file provides an example of a call to the # function fem_create_mpc_sliding_surface() # # This session file will create a new database by # name new.db. A surface and a solid will be # created and meshed. The above mentioned # function will be called to create mpc between # the surface and 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 fem_create_mpc_sliding_surface() # has the following arguments: # # fem_create_mpc_sliding_surface # ( mpc_id, # tolerance, # coord_option, # coord_frame, # normal_axis, # dependent_region, # independent_region ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_mpc_id REAL r_tolerance STRING s_coord_option[32] STRING s_coord_frame[32] STRING s_normal_axis[32] STRING s_dependent_region[32] STRING s_independent_region[32] INTEGER i_return_value STRING sv_created_ids[VIRTUAL] INTEGER i_num_nodes INTEGER i_num_elems

Main Index

716 PCL Reference Manual Examples Create Action

STRING sv_nodes_created[VIRTUAL] STRING sv_elems_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a patch and meshing it with Quad elements. i_return_value = @ asm_const_patch_xyz( "1", "<1 0 01>", @ "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = @ fem_create_mesh_surf_2( "IsoMesh", 0, @ "Surface 1 ", 1, [0.2], "Quad4", "1", "1", @ "Coord 0", "Coord 0", i_num_nodes, @ i_num_elems, sv_nodes_created, sv_elems_created ) dump i_return_value #--------------------------------------------------------------------# Creating a hpat and meshing it with Hex elements. i_return_value = @ asm_const_hpat_xyz( "1", "<1 1 1>", @ "[0 0.1 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = @ fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1"@ , 1, [0.2], "Hex8", "37", "26", "Coord 0", @ "Coord 0", i_num_nodes, i_num_elems, @ sv_nodes_created, sv_elems_created ) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 23., -34., 0. ) dump i_return_value mpc_label( TRUE ) surface_label( TRUE ) solid_label( TRUE ) #--------------------------------------------------------------------# Calling function to create sliding surface mpc between the surface # and one face of the solid. i_mpc_id = 1 r_tolerance = 0.15 s_coord_option = "User Specified" s_coord_frame = "Coord 0" s_normal_axis = "Axis 2" s_dependent_region = "Surface 1" s_independent_region = "Solid 1.3" # i_return_value = @ fem_create_mpc_sliding_surface @ ( i_mpc_id, @ r_tolerance, @ s_coord_option, @ s_coord_frame, @ s_normal_axis, @ s_dependent_region, @ s_independent_region ) dump i_return_value sys_free_string(sv_created_ids) sys_free_string(sv_nodes_created) sys_free_string(sv_elems_created) #--------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 717 Create Action

fem_create_mesh_2curve_1

()

# # Purpose : This file provides an example of a call to the # function fem_create_mesh_2curve_1() # # This session file will create a new database by # name new.db and create two 2D circles. The # above mentioned function will be called to mesh # the space between the 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 fem_create_mesh_2curve_1() # has the following arguments: # # i_return_value = # fem_create_mesh_2curve_1( # s_curve1_select, # s_curve2_select, # i_size_method, # i_flag, # r_global_edge_length, # i_num_along_curve, # i_num_across_curve, # s_element_topology, # s_node_select, # s_element_select, # s_anly_coord_frame, # s_ref_coord_frame, # i_num_fem_nodes, # i_num_fem_elements, # sv_fem_nodes_created, # sv_fem_elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve1_select[32] STRING s_curve2_select[32] INTEGER i_size_method INTEGER i_flag REAL r_global_edge_length INTEGER i_num_along_curve INTEGER i_num_across_curve STRING s_element_topology[32] STRING s_node_select[32] STRING s_element_select[32] STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] INTEGER i_return_value STRING sv_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating two circles. i_return_value = @

Main Index

718 PCL Reference Manual Examples Create Action

sgm_const_curve_2d_circle_v1( "1", 1, 1., @ "Coord 0.3", "", "[0 0 0][0 0 0.5]", FALSE, sv_created_ids ) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 23., -34., 0. ) dump i_return_value node_label( TRUE ) surface_label( TRUE ) quad_elem_label( TRUE ) #--------------------------------------------------------------------# Meshing the space between the two curves with Quad elements. s_curve1_select = "Curve 1" s_curve2_select = "Curve 2" i_size_method = 1 r_global_edge_length = 0.0 i_num_along_curve = 20 i_num_across_curve = 4 s_element_topology = "Quad4" s_node_select = "" s_element_select = "" s_anly_coord_frame = "Coord 0" s_ref_coord_frame = "Coord 0" # i_return_value = @ fem_create_mesh_2curve_1( @ s_curve1_select, @ s_curve2_select, @ i_size_method, @ i_flag, @ r_global_edge_length, @ i_num_along_curve, @ i_num_across_curve, @ s_element_topology, @ s_node_select, @ s_element_select, @ s_anly_coord_frame, @ s_ref_coord_frame, @ i_num_fem_nodes, @ i_num_fem_elements, @ sv_fem_nodes_created, @ sv_fem_elements_created ) dump i_return_value dump i_num_fem_nodes dump i_num_fem_elements dump sv_fem_nodes_created dump sv_fem_elements_created sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) #--------------------------------------------------------------------

()

fem_create_mesh_curv_1 # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_create_mesh_curv_1() This session file will create a new database by name new.db and create two 2D circles. The above mentioned function will be called to mesh the curves.

Chapter 4: Finite Element Functions 719 Create Action

# This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_create_mesh_curv_1() # has the following arguments: # # fem_create_mesh_curv_1( # s_curve_select, # i_flag, # r_global_edge_length, # s_element_topology, # s_node_select, # s_element_select, # s_anly_coord_frame, # s_ref_coord_frame, # i_num_fem_nodes, # i_num_fem_element, # sv_fem_nodes_created, # sv_fem_elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_select[32] INTEGERi_flag REAL r_global_edge_length STRING s_element_topology[32] STRING s_node_select[32] STRING s_element_select[32] STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] INTEGER i_num_fem_nodes INTEGER i_num_fem_element STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] INTEGER i_return_value STRING sv_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating two circles. i_return_value = @ sgm_const_curve_2d_circle_v1( "1", 1, 1., @ "Coord 0.3", "", "[0 0 0][0 0 0.5]", FALSE, sv_created_ids ) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 23., -34., 0. ) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Meshing the two curves with Bar elements. s_curve_select = "Curve 1 2" r_global_edge_length = 0.5 s_element_topology = "Bar4" s_node_select = "3" s_element_select = "10" s_anly_coord_frame = "Coord 0" s_ref_coord_frame = "Coord 0" # fem_create_mesh_curv_1( @ s_curve_select, @ i_flag, @

Main Index

720 PCL Reference Manual Examples Create Action

r_global_edge_length, @ s_element_topology, @ s_node_select, @ s_element_select, @ s_anly_coord_frame, @ s_ref_coord_frame, @ i_num_fem_nodes, @ i_num_fem_element, @ sv_fem_nodes_created, @ sv_fem_elements_created ) dump i_num_fem_nodes dump i_num_fem_element dump sv_fem_nodes_created dump sv_fem_elements_created sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) #--------------------------------------------------------------------

fem_create_mesh_sol_3

()

# # Purpose : This file provides an example of a call to the # function fem_create_mesh_sol_3() # # This session file will create a new database by # name new.db and create a hpat solid. This solid # will be meshed using 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 fem_create_mesh_sol_3() # has the following arguments: # # fem_create_mesh_sol_3( # s_mesher, # i_options_control, # s_solid_select, # i_num_values, # ra_value_array, # s_element_topology, # s_node_select, # s_element_select, # s_anly_coord_frame, # s_ref_coord_frame, # i_num_fem_nodes, # i_num_fem_element, # sv_fem_nodes_created, # sv_fem_elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_mesher[32] INTEGER i_options_control STRING s_solid_select[32] INTEGER i_num_values REAL ra_value_array(32) STRING s_element_topology[32] STRING s_node_select[32] STRING s_element_select[32] STRING s_anly_coord_frame[32]

Main Index

Chapter 4: Finite Element Functions 721 Create Action

STRING s_ref_coord_frame[32] INTEGER i_num_fem_nodes INTEGER i_num_fem_element STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] INTEGER i_return_value STRING sv_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a hpat solid. i_return_value = @ asm_const_hpat_xyz( "1", "<1 1 1>", @ "[0 0.1 0]", "Coord 0", sv_created_ids ) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 23., -34., 0. ) dump i_return_value solid_label( TRUE ) node_label( TRUE ) hex_elem_label( TRUE ) #--------------------------------------------------------------------# Meshing the solid with Hex elements. s_mesher = "IsoMesh" i_options_control = 16384 s_solid_select = "Solid 1" i_num_values = 1 ra_value_array(1) = 0.25 s_element_topology = "Hex8" s_node_select = "" s_element_select = "" s_anly_coord_frame = "Coord 0" s_ref_coord_frame = "Coord 0" # fem_create_mesh_sol_3( @ s_mesher, @ i_options_control, @ s_solid_select, @ i_num_values, @ ra_value_array, @ s_element_topology, @ s_node_select, @ s_element_select, @ s_anly_coord_frame, @ s_ref_coord_frame, @ i_num_fem_nodes, @ i_num_fem_element, @ sv_fem_nodes_created, @ sv_fem_elements_created ) dump i_num_fem_nodes dump i_num_fem_element dump sv_fem_nodes_created dump sv_fem_elements_created sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

fem_create_mesh_sol_5

()

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

Main Index

722 PCL Reference Manual Examples Create Action

# Purpose : This file provides an example of a call to the # function fem_create_mesh_sol_5() # # This session file will create a new database by # name new.db and create a hpat solid. This solid # will be meshed using 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 fem_create_mesh_sol_5() # has the following arguments: # # fem_create_mesh_sol_5( # s_solid_list, # s_mesher_pick, # s_elem_topo, # i_mesher_val_qtt, # sa_mesher_val, # i_flags, # i_FMF_perform, # i_FMF_make_dup_node, # i_FMF_stop_when_interf_meshed, # i_FMF_use_prox_tol, # r_FMF_prox_tol, # s_FMF_solid_neighbors, # s_node_list, # s_elem_list, # s_a_coord_frame, # s_r_coord_frame, # i_num_nodes, # i_num_elems, # sv_nodes_created, # sv_elems_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_solid_list[1001] STRING s_mesher_pick[32] STRING s_elem_topo[32] INTEGER i_mesher_val_qtt STRING sa_mesher_val[32](4) INTEGER i_flags INTEGER i_FMF_perform INTEGER i_FMF_make_dup_node INTEGER i_FMF_stop_when_interf_meshed INTEGER i_FMF_use_prox_tol REAL r_FMF_prox_tol STRING s_FMF_solid_neighbors[1001] STRING s_node_list[32] STRING s_elem_list[32] STRING s_a_coord_frame[32] STRING s_r_coord_frame[32] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_nodes_created[VIRTUAL] STRING sv_elems_created[VIRTUAL] INTEGER i_return_value STRING sv_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a hpat solid. i_return_value = @

Main Index

Chapter 4: Finite Element Functions 723 Create Action

asm_const_hpat_xyz( "1", "<1 1 1>", @ "[0 0.1 0]", "Coord 0", sv_created_ids ) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 23., -34., 0. ) dump i_return_value solid_label( TRUE ) node_label( TRUE ) hex_elem_label( TRUE ) #--------------------------------------------------------------------# Meshing the solid with Hex elements. s_solid_list = "Solid 1" s_mesher_pick = "IsoMesh" s_elem_topo = "Hex8" i_mesher_val_qtt = 4 sa_mesher_val(1) = "0.25" sa_mesher_val(2) = "0.05" sa_mesher_val(3) = "0.1" sa_mesher_val(4) = "0.0" i_flags = 16384 /* FEM_MF_USE_NEW_NUMBERING_CONTROL_F */ 1048576 /* FEM_MF_GRADE_MESH_F */ 16 /* FEM_MF_CURVATURE_CHECK_F */ $ Developer's note: /src/fem/mesh/free/NEW6/include/fem_publ_mf_defs.h i_FMF_perform = 0 i_FMF_make_dup_node = 0 i_FMF_stop_when_interf_meshed = 0 i_FMF_use_prox_tol = 0 r_FMF_prox_tol = 0.1 s_FMF_solid_neighbors= "" s_node_list = "" s_elem_list = "" s_a_coord_frame = "Coord 0" s_r_coord_frame = "Coord 0" # fem_create_mesh_sol_5( @ s_solid_list, @ s_mesher_pick, @ s_elem_topo, @ i_mesher_val_qtt, @ sa_mesher_val, @ i_flags, @ i_FMF_perform, @ i_FMF_make_dup_node, @ i_FMF_stop_when_interf_meshed, @ i_FMF_use_prox_tol, @ r_FMF_prox_tol, @ s_FMF_solid_neighbors, @ s_node_list, @ s_elem_list, @ s_a_coord_frame, @ s_r_coord_frame, @ i_num_nodes, @ i_num_elems, @ sv_nodes_created, @ sv_elems_created ) dump i_num_nodes dump i_num_elems dump sv_nodes_created dump sv_elems_created sys_free_string(sv_nodes_created) sys_free_string(sv_elems_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

Main Index

+ @ + @

724 PCL Reference Manual Examples Create Action

fem_create_mesh_surf_3

()

# # Purpose : This file provides an example of a call to the # function fem_create_mesh_surf_3() # # This session file will create a new database by # name new.db and create a curved surface. This # surface will be meshed by calling 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 fem_create_mesh_surf_3() # has the following arguments: # # fem_create_mesh_surf_3( # s_mesher, # i_options_control, # s_surface_select, # i_num_values, # sa_value_array, # s_element_topology, # s_node_select, # s_element_select, # s_anly_coord_frame, # s_ref_coord_frame, # i_num_fem_nodes, # i_num_fem_element, # sv_fem_nodes_created, # sv_fem_elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_mesher[32] INTEGER i_options_control STRING s_surface_select[32] INTEGER i_num_values STRING sa_value_array[32](32) STRING s_element_topology[32] STRING s_node_select[32] STRING s_element_select[32] STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] INTEGER i_num_fem_nodes INTEGER i_num_fem_element STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] INTEGER i_return_value STRING sv_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a curved surface by extruding a curve. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[0.5 -1 0]", "[1 0 0]", 1, 0.5, sv_created_ids ) dump i_return_value i_return_value =

Main Index

@

Chapter 4: Finite Element Functions 725 Create Action

sgm_const_surface_extrude( "3", "<0 0 1>", 1.,@ 0., "[0 0 0]", "Coord 0", "Curve 1 ", sv_created_ids ) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 23., -34., 0. ) dump i_return_value surface_label( TRUE ) node_label( TRUE ) quad_elem_label( TRUE ) #--------------------------------------------------------------------# Meshing the two surfaces using Paver with Quad elements. Only the # check about the 'global space' is not performed on the mesh. s_mesher = "Paver" i_options_control = 8724 s_surface_select = "Surface 3" i_num_values = 4 sa_value_array(1) = "0.5" sa_value_array(2) = "0.1" sa_value_array(3) = "0.11" sa_value_array(4) = "0.13" s_element_topology = "Quad4" s_node_select = "" s_element_select = "" s_anly_coord_frame = "Coord 0" s_ref_coord_frame = "Coord 0" # fem_create_mesh_surf_3( @ s_mesher, @ i_options_control, @ s_surface_select, @ i_num_values, @ sa_value_array, @ s_element_topology, @ s_node_select, @ s_element_select, @ s_anly_coord_frame, @ s_ref_coord_frame, @ i_num_fem_nodes, @ i_num_fem_element, @ sv_fem_nodes_created, @ sv_fem_elements_created ) dump i_num_fem_nodes dump i_num_fem_element dump sv_fem_nodes_created dump sv_fem_elements_created sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) #---------------------------------------------------------------------

fem_create_mesh_surf_4 # # # # # # # # # # #

Main Index

Purpose

:

()

This file provides an example of a call to the function fem_create_mesh_surf_4() This session file will create a new database by name new.db and create a curved surface. This surface will be meshed by calling above function. This file can be run by starting a session of Patran, and running this session file

726 PCL Reference Manual Examples Create Action

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_create_mesh_surf_4() # has the following arguments: # # fem_create_mesh_surf_4( # s_mesher_pick, # i_flag, # s_surface_list, # i_num_val, # sa_val_array_str, # s_elem_topo, # s_node_list, # s_elem_list, # s_a_coord_frame, # s_r_coord_frame, # i_num_nodes, # i_num_elems, # sv_nodes_created, # sv_elems_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_mesher_pick[32] INTEGER i_flag STRING s_surface_list[32] INTEGER i_num_val STRING sa_val_array_str[32](4) STRING s_elem_topo[32] STRING s_node_list[32] STRING s_elem_list[32] STRING s_a_coord_frame[32] STRING s_r_coord_frame[32] INTEGER i_num_nodes INTEGER i_num_elems STRING sv_nodes_created[VIRTUAL] STRING sv_elems_created[VIRTUAL] INTEGER i_return_value STRING sv_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a curved surface by extruding a curve. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[0.5 -1 0]", "[1 0 0]", 1, 0.5, sv_created_ids ) dump i_return_value i_return_value = @ sgm_const_surface_extrude( "3", "<0 0 1>", 1.,@ 0., "[0 0 0]", "Coord 0", "Curve 1 ", sv_created_ids ) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 23., -34., 0. ) dump i_return_value surface_label( TRUE ) node_label( TRUE ) quad_elem_label( TRUE ) #--------------------------------------------------------------------# Meshing the two surfaces using Paver with Quad elements. Only the # check about the 'global space' is not performed on the mesh. s_mesher_pick = "Paver" i_flag = 4 + 16 + 512 + 8192

Main Index

Chapter 4: Finite Element Functions 727 Create Action

s_surface_list = "Surface 3" i_num_val = 4 sa_val_array_str(1) = "0.5" sa_val_array_str(2) = "0.1" sa_val_array_str(3) = "0.11" sa_val_array_str(4) = "0.13" s_elem_topo = "Quad4" s_node_list = "" s_elem_list = "" s_a_coord_frame = "Coord 0" s_r_coord_frame = "Coord 0" # fem_create_mesh_surf_4( @ s_mesher_pick, @ i_flag, @ s_surface_list, @ i_num_val, @ sa_val_array_str, @ s_elem_topo, @ s_node_list, @ s_elem_list, @ s_a_coord_frame, @ s_r_coord_frame, @ i_num_nodes, @ i_num_elems, @ sv_nodes_created, @ sv_elems_created ) dump i_num_nodes dump i_num_elems dump sv_nodes_created dump sv_elems_created sys_free_string(sv_created_ids) sys_free_string(sv_nodes_created) sys_free_string(sv_elems_created) #---------------------------------------------------------------------

fem_create_surface_mesh_control

()

# # Purpose : This file provides an example of a call to the # function fem_create_surface_mesh_control() # # This session file will create a new database by # name new.db and create a curved surface. This # surface will be meshed using Paver. The above # mentioned function will be called to change the # mesh parameters. The surface will be remeshed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_create_surface_mesh_control() # has the following arguments: # # fem_create_surface_mesh_control # ( surface_list, # num_int_arg, # num_float_arg, # float_arg_list ) # #--------------------------------------------------------------------# Variable Declarations STRING sv_surface_list[VIRTUAL]

Main Index

728 PCL Reference Manual Examples Create Action

INTEGER i_num_int_arg INTEGER ia_int_arg_list(4) INTEGER i_num_float_arg REAL ra_float_arg_list(3) INTEGER i_return_value INTEGER i_num_fem_nodes INTEGER i_num_fem_element STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] STRING sv_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a curved surface by extruding a curve. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[0.5 -1 0]", "[1 0 0]", 1, 0.5, sv_created_ids ) dump i_return_value i_return_value = @ sgm_const_surface_extrude( "3", "<0 0 1>", 1.,@ 0., "[0 0 0]", "Coord 0", "Curve 1 ", sv_created_ids ) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Meshing the surface using Paver with Quad elements. i_return_value = @ fem_create_mesh_surf_2("Paver", 8724, @ "Surface 3", 4, [0.5, 0.1, 0.11, 0.13], @ "Quad4", "", "", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_element, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Calling function to set mesh control parameters. sv_surface_list = "surface 3" i_num_int_arg = 0 ia_int_arg_list = [0, 0, 0, 0] i_num_float_arg = 1 ra_float_arg_list = [0.1, 0.0, 0.0] # i_return_value = @ fem_create_surface_mesh_control @ ( sv_surface_list, @ i_num_int_arg, @ ia_int_arg_list, @ i_num_float_arg, @ ra_float_arg_list ) $? YES 2001026 # Delete the originally existing mesh seed. dump i_return_value #--------------------------------------------------------------------# Remeshing the surface with same arguments. i_return_value = @ fem_create_mesh_surf_2("Paver", 8724, @ "Surface 3", 4, [0.5, 0.1, 0.11, 0.13], @ "Quad4", "", "", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_element, @ sv_fem_nodes_created, sv_fem_elements_created ) $? YESFORALL 2001103 # Delete the existing mesh. dump i_return_value

Main Index

Chapter 4: Finite Element Functions 729 Create Action

sys_free_string(sv_surface_list) sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) #---------------------------------------------------------------------

fem_prj_nod_surf_norm

()

# # Purpose : This file provides an example of a call to the # function fem_prj_nod_surf_norm() # # This session file will create a new database by # name new.db and create a curved surface. By # calling the above mentioned function after a # pause the nodes will be moved to 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 fem_prj_nod_surf_norm() # has the following arguments: # # fem_prj_nod_surf_norm # ( node_select, # surface_select ) # #--------------------------------------------------------------------# Variable Declarations STRING s_node_select[32] STRING s_surface_select[32] INTEGER i_return_value STRING sv_created_ids[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a curved surface by extruding a curve. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[0.5 -1 0]", "[1 0 0]", 1, 0.5, sv_created_ids ) dump i_return_value i_return_value = @ sgm_const_surface_extrude( "1", "<0 0 1>", 1.,@ 0., "[0 0 0]", "Coord 0", "Curve 1 ", sv_created_ids ) dump i_return_value #--------------------------------------------------------------------# Calling function to create nodes. i_return_value = @ fem_create_nodes( "Coord 0", "Coord 0", @ FALSE, "1", "[3 1 0][-2 0 0.5][0 -1 1]", sv_fem_nodes_created ) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 23., -34., 0. ) dump i_return_value i_return_value = ga_display_lines_set( "general", 4 ) dump i_return_value node_label( TRUE )

Main Index

@

730 PCL Reference Manual Examples Create Action

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to move nodes to the surface. s_node_select = "Node 1:3" s_surface_select = "Surface 1" # i_return_value = @ fem_prj_nod_surf_norm @ ( s_node_select, @ s_surface_select ) dump i_return_value sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 731 Create Action

fem_prj_nod_surf_vect

()

# # Purpose : This file provides an example of a call to the # function fem_prj_nod_surf_vect() # # This session file will create a new database by # name new.db and create a curved surface. # These nodes will be moved onto the surface # by calling the above mentioned function after # a pause. The nodes will be moved to the surface # by using the vector projection method. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_prj_nod_surf_vect() # has the following arguments: # # fem_prj_nod_surf_vect # ( node_select, # surface_select, # projection_option, # projection_vector, # coord_frame ) # #--------------------------------------------------------------------# Variable Declarations STRING s_node_select[32] STRING s_surface_select[32] INTEGER i_projection_option STRING s_projection_vector[32] STRING s_coord_frame[32] INTEGER i_return_value STRING sv_created_ids[VIRTUAL] STRING sv_nodes_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Creating a curved surface by extruding a curve. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[0.5 -1 0]", "[1 0 0]", 1, 0.5, sv_created_ids ) dump i_return_value i_return_value = @ sgm_const_surface_extrude( "1", "<0 0 1>", 1.,@ 0., "[0 0 0]", "Coord 0", "Curve 1 ", sv_created_ids ) dump i_return_value #--------------------------------------------------------------------# Calling function to create nodes. i_return_value = @ fem_create_nodes( "Coord 0", "Coord 0", @ FALSE, "1", "[0.3 0.1 0][2 0.5 0.5][0 -1 1]", sv_nodes_created ) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 23., -34., 0. ) dump i_return_value i_return_value =

Main Index

@

732 PCL Reference Manual Examples Create Action

ga_display_lines_set( "general", 4 ) dump i_return_value node_label( TRUE ) #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to move the nodes to the surface by specifying a # vector. s_node_select = "Node 1:3" s_surface_select = "Surface 1" i_projection_option = 2 s_projection_vector = "<1 1 0>" s_coord_frame = "Coord 0" # i_return_value = @ fem_prj_nod_surf_vect @ ( s_node_select, @ s_surface_select, @ i_projection_option, @ s_projection_vector, @ s_coord_frame ) dump i_return_value sys_free_string(sv_created_ids) sys_free_string(sv_nodes_created) #---------------------------------------------------------------------

fem_prj_nod_curve_norm

()

# # Purpose : This file provides an example of a call to the # function fem_prj_nod_curve_norm() # # This session file will create a new database by # name new.db and create nodes and curve. After # resuming from the pause the above mentioned # function will be called to move the nodes to # 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. # # The function fem_prj_nod_curve_norm() # has the following arguments: # # fem_prj_nod_curve_norm # ( node_select, # curve_select ) # #--------------------------------------------------------------------# Variable Declarations STRING s_node_select[32] STRING s_curve_select[32] INTEGER i_return_value STRING sv_created_ids[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Calling function to create nodes. i_return_value = @

Main Index

Chapter 4: Finite Element Functions 733 Create Action

fem_create_nodes( "Coord 0", "Coord 0", @ FALSE, "1", "[3 1 0][-2 0 0][0 -1 0]", sv_fem_nodes_created ) dump i_return_value #--------------------------------------------------------------------# Creating a curve. i_return_value = @ asm_const_line_3point( "1", "[0 0 0]", @ "[0.5 -1 0]", "[1 0 0]", 1, 0.5, sv_created_ids ) dump i_return_value #--------------------------------------------------------------------i_return_value = @ ga_view_aa_set( 23., -34., 0. ) dump i_return_value node_label( TRUE ) #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to move nodes to the curve. s_node_select = "Node 1:3" s_curve_select = "Curve 1" # i_return_value = @ fem_prj_nod_curve_norm @ ( s_node_select, @ s_curve_select ) dump i_return_value sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

fem_prj_nod_cplane

()

# # Purpose : This file provides an example of a call to the # function fem_prj_nod_cplane() # # This session file will create a new database by # name new.db and create nodes. After resuming # from pause the above mentioned function will be # called to move the nodes to X=1.0 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 fem_prj_nod_cplane() # has the following arguments: # # fem_prj_nod_cplane # ( node_select, # direction, # constant_value, # coord_frame ) # #--------------------------------------------------------------------# Variable Declarations STRING s_node_select[32] INTEGER i_direction REAL r_constant_value STRING s_coord_frame[32] INTEGER i_return_value STRING sv_fem_nodes_created[VIRTUAL]

Main Index

734 PCL Reference Manual Examples Create Action

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------node_label( TRUE ) #--------------------------------------------------------------------# Calling function to create nodes. i_return_value = @ fem_create_nodes( "Coord 0", "Coord 0", @ FALSE, "1", "[3 1 0][-2 0 0][0 -1 0]", sv_fem_nodes_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Calling function to move nodes to plane X=1.0 s_node_select = "Node 1:3" i_direction = 1 r_constant_value = 1.0 s_coord_frame = "Coord 0" # i_return_value = @ fem_prj_nod_cplane @ ( s_node_select, @ i_direction, @ r_constant_value, @ s_coord_frame ) dump i_return_value sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

mesh_seed_create

()

# # Purpose : This file provides an example of a call to the # function mesh_seed_create() # # This session file will create a new database by # name new.db and create a circular arc. The # above mentioned function will be called to # create and display a mesh seed on the curve # based on a one-way bias mesh seed spacing. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function mesh_seed_create() # has the following arguments: # # mesh_seed_create # ( curve_select, # seed_option, # num_seeds, # ratio, # length_1, # length_2 ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_select[32] INTEGER i_seed_option INTEGER i_num_seeds

Main Index

Chapter 4: Finite Element Functions 735 Create Action

REAL REAL REAL STRING INTEGER

r_ratio r_length_1 r_length_2 sv_created_ids[VIRTUAL] i_return_value

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a circular curve i_return_value = sgm_const_curve_2d_arcangles ( "1", 3., 70., 100., "Coord 0.3", "[0 0 0]", sv_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create a mesh seed on the curve # s_curve_select = "Curve 1 " i_seed_option = 3 i_num_seeds = 6 r_ratio = 2. r_length_1 = 0. r_length_2 = 0. i_return_value = mesh_seed_create ( s_curve_select, i_seed_option, i_num_seeds, r_ratio, r_length_1, r_length_2 ) dump i_return_value

@ @ @ @ @ @ @

sys_free_string(sv_created_ids) #---------------------------------------------------------------------

()

mesh_seed_create_curv_based # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function mesh_seed_create_curv_based() This session file will create a new database by name new.db and create a circular arc.The above mentioned function will be called to create and display a mesh seed on the curve based on the allowable curve error and length of an 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 mesh_seed_create_curv_based() has the following arguments: mesh_seed_create_curv_based ( curve_select,

736 PCL Reference Manual Examples Create Action

# element_length_type, # allow_curve_error, # constraint_option, # minimum_id_length, # maximum_id_length, # minimum_number, # maximum_number ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_select[32] STRING s_element_length_type[32] REAL r_allow_curve_error STRING s_constraint_option[32] REAL r_minimum_id_length REAL r_maximum_id_length INTEGER i_minimum_number INTEGER i_maximum_number 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 circular curve i_return_value = sgm_const_curve_2d_arcangles ( "1", 3., 70., 100., "Coord 0.3", "[0 0 0]", sv_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create a mesh seed on the curve # s_curve_select = "Curve 1 " s_element_length_type = "Uniform" r_allow_curve_error = 0.01 s_constraint_option = "Length" r_minimum_id_length = 0.1 r_maximum_id_length = 0.2 i_minimum_number = 0 i_maximum_number = 0 mesh_seed_create_curv_based ( s_curve_select, s_element_length_type, r_allow_curve_error, s_constraint_option, r_minimum_id_length, r_maximum_id_length, i_minimum_number, i_maximum_number )

@ @ @ @ @ @ @ @

sys_free_string(sv_created_ids) #---------------------------------------------------------------------

()

mesh_seed_create_tabular # # #

Main Index

Purpose

:

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

Chapter 4: Finite Element Functions 737 Create Action

# # This session file will create a new database by # name new.db and create a circular arc.The above # mentioned function will be called to create and # display a mesh seed at specific points on the # curve using a table of arc length percentages. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function mesh_seed_create_tabular() # has the following arguments: # # mesh_seed_create_tabular # ( curve_select, # coord_type, # num_entries, # table_of_values ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_select[32] STRING s_coord_type[32] INTEGER i_num_entries REAL ra_table_of_values(7) INTEGER i_return_value 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 circular curve i_return_value = sgm_const_curve_2d_arcangles ( "1", 3., 70., 100., "Coord 0.3", "[0 0 0]", sv_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create a mesh seed on the curve # s_curve_select = "Curve 1 " s_coord_type = "Arc_Length" i_num_entries = 5 ra_table_of_values = [ .2, .3, .6, .7, .9, 0., 0. ] i_return_value = mesh_seed_create_tabular ( s_curve_select, s_coord_type, i_num_entries, ra_table_of_values ) dump i_return_value

@ @ @ @ @

sys_free_string(sv_created_ids) #---------------------------------------------------------------------

Main Index

738 PCL Reference Manual Examples Create Action

mesh_seed_create_tabular_points

()

# # Purpose : This file provides an example of a call to the # function mesh_seed_create_tabular_points() # # This session file will create a new database by # name new.db and create a circular arc. The # above mentioned function will be called to # create and display a mesh seed at the specified # points and locations on 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. # # The function mesh_seed_create_tabular_points() # has the following arguments: # # mesh_seed_create_tabular_points # ( curve_list, # point_list, # tolerance ) # #--------------------------------------------------------------------# Variable Declarations STRING sv_curve_list[VIRTUAL] STRING sv_point_list[VIRTUAL] STRING sv_created_ids[VIRTUAL] REAL r_tolerance INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a circular curve i_return_value = sgm_const_curve_2d_arcangles ( "1", 3., 70., 100., "Coord 0.3", "[0 0 0]", sv_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create a mesh seed on the curve # sv_curve_list = "Curve 1" sv_point_list = " Point 1:2, [ 0., 3., 0.], @ [ 0.450, 2.95, 0.], @ [ 0.755, 2.90, 0.], @ [ 0.210, 2.99, 0.], @ [ -0.27, 2.99, 0.] " r_tolerance = .03 i_return_value = mesh_seed_create_tabular_points ( sv_curve_list, sv_point_list, r_tolerance ) dump i_return_value

Main Index

@ @ @ @

Chapter 4: Finite Element Functions 739 Create Action

sys_free_string(sv_curve_list) sys_free_string(sv_point_list) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

mesh_seed_display_mgr.init

()

# # Purpose : This file provides an example of a call to the # function mesh_seed_display_mgr.init() # # This session file creates a new database # "new.db", creates an arc and a mesh seed on it. # The above mentioned function is called to # initialize the mesh seed display manager. The # mesh seed is then erased to verify. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function mesh_seed_display_mgr.init() has no arguments. # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_select[32] INTEGER i_seed_option INTEGER i_num_seeds REAL r_ratio REAL r_length_1 REAL r_length_2 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 circular curve i_return_value = sgm_const_curve_2d_arcangles ( "1", 3., 70., 100., "Coord 0.3", "[0 0 0]", sv_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create a mesh seed on the curve # s_curve_select = "Curve 1 " i_seed_option = 3 i_num_seeds = 6 r_ratio = 2. r_length_1 = 0. r_length_2 = 0. i_return_value = mesh_seed_create ( s_curve_select, i_seed_option, i_num_seeds, r_ratio,

Main Index

@ @ @ @ @ @

740 PCL Reference Manual Examples Create Action

r_length_1, r_length_2 ) dump i_return_value

@

sys_free_string(sv_created_ids) #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Initialize the mesh seed display manager mesh_seed_display_mgr.init() #--------------------------------------------------------------------# Erase the mesh seed from the viewport mesh_seed_display_mgr.erase() #---------------------------------------------------------------------

mesh_seed_display_mgr.plot

()

# # Purpose : This file provides an example of a call to the # function mesh_seed_display_mgr.plot() # # This session file creates a new database # "new.db", creates an arc and a mesh seed on it. # The mesh seed display manager is initialized & # mesh seed is erased. Above mentioned function # is called to display the mesh seed 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 mesh_seed_display_mgr.plot() has no arguments. # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_select[32] INTEGER i_seed_option INTEGER i_num_seeds REAL r_ratio REAL r_length_1 REAL r_length_2 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 circular curve i_return_value = sgm_const_curve_2d_arcangles ( "1", 3., 70., 100., "Coord 0.3", "[0 0 0]", sv_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create a mesh seed on the curve

Main Index

Chapter 4: Finite Element Functions 741 Create Action

# s_curve_select i_seed_option i_num_seeds r_ratio r_length_1 r_length_2

= = = = = =

"Curve 1 " 3 6 2. 0. 0.

i_return_value = mesh_seed_create ( s_curve_select, i_seed_option, i_num_seeds, r_ratio, r_length_1, r_length_2 ) dump i_return_value

@ @ @ @ @ @ @

sys_free_string(sv_created_ids) #--------------------------------------------------------------------# Initialize the mesh seed display manager & erase the mesh seed mesh_seed_display_mgr.init() mesh_seed_display_mgr.erase() #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Plot the mesh seed in the viewport mesh_seed_display_mgr.plot() #---------------------------------------------------------------------

mesh_seed_display_mgr_erase

()

# # Purpose : This file provides an example of a call to the # function mesh_seed_display_mgr.erase() # # This session file creates a new database # "new.db", creates an arc and a mesh seed on it. # The mesh seed display manager is initialized. # The above mentioned function is called to erase # the mesh seed from 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 mesh_seed_display_mgr.erase() has no arguments. # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_select[32] INTEGER i_seed_option INTEGER i_num_seeds REAL r_ratio REAL r_length_1 REAL r_length_2 STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #---------------------------------------------------------------------

Main Index

742 PCL Reference Manual Examples Create Action

# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a circular curve i_return_value = sgm_const_curve_2d_arcangles ( "1", 3., 70., 100., "Coord 0.3", "[0 0 0]", sv_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create a mesh seed on the curve # s_curve_select = "Curve 1 " i_seed_option = 3 i_num_seeds = 6 r_ratio = 2. r_length_1 = 0. r_length_2 = 0. i_return_value = mesh_seed_create ( s_curve_select, i_seed_option, i_num_seeds, r_ratio, r_length_1, r_length_2 ) dump i_return_value

@ @ @ @ @ @ @

sys_free_string(sv_created_ids) #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Initialize the mesh seed display manager mesh_seed_display_mgr.init() #--------------------------------------------------------------------# Erase the mesh seed from the viewport mesh_seed_display_mgr.erase() #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 743 Create Action

mesh_seed_display_mgr.refresh

()

# # Purpose : This file provides an example of a call to the # function mesh_seed_display_mgr.refresh() # # This session file creates a new database # "new.db", creates a solid and a mesh seed on # one of its edge. The solid is then shaded. The # above mentioned function is called to refresh # the mesh seed shown in 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 mesh_seed_display_mgr.refresh() has no arguments. # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_select[32] INTEGER i_seed_option INTEGER i_num_seeds REAL r_ratio REAL r_length_1 REAL r_length_2 STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Construct a solid i_return_value = asm_const_hpat_xyz ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value dump sv_created_ids

@ @ @

i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create a mesh seed on one edge of the solid # s_curve_select = "Solid 1.5.4" i_seed_option = 1 i_num_seeds = 4 r_ratio = 0. r_length_1 = 0. r_length_2 = 0. i_return_value = mesh_seed_create ( s_curve_select, i_seed_option, i_num_seeds, r_ratio,

Main Index

@ @ @ @ @ @

744 PCL Reference Manual Examples Create Action

r_length_1, r_length_2 ) dump i_return_value

@

sys_free_string(sv_created_ids) #--------------------------------------------------------------------# Plot the mesh seed mesh_seed_display_mgr.plot() #--------------------------------------------------------------------# Shade the solid renderstyle( "Shaded/Smooth" ) #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Refresh the mesh seed shown in the viewport mesh_seed_display_mgr.refresh() #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 745 Transform Action

Transform Action This section contains examples of some of the functions used to mirror, rotate, and translate finite element model nodes, elements, multi-point constraints (MPCs), meshes, and mesh seeds. fem_transform_elems_mirror_1

()

# # Purpose : This file provides an example of a call to the # function fem_transform_elems_mirror_1() # # This session file creates a new database by # name new.db. Two nodes and a bar element using # the nodes are created. This function is then # called to mirror translate the bar 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 fem_transform_elems_mirror() # has the following arguments: # # fem_transform_elems_mirror_1 # ( mirror_elem_select, # plane_select, # offset, # reverse_elements, # flag, # element_select, # nodes_created, # elements_created, # nodes_deleted, # elements_deleted ) # #--------------------------------------------------------------------# Variable Declarations STRING s_mirror_elem_select[32] STRING s_plane_select[32] REAL r_offset LOGICAL l_reverse_elements INTEGER i_flag STRING s_element_select[32] STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_nodes_deleted[VIRTUAL] STRING sv_elements_deleted[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] STRING s_fem_elements_created[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create 2 nodes without associating with any geometry i_return_value = fem_create_nodes ( "Coord 0", "Coord 0", FALSE, "1",

Main Index

@ @ @

746 PCL Reference Manual Examples Transform Action

"[2 2 0][3 5 0]", sv_fem_nodes_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Create a bar element using the 2 nodes # i_return_value = @ fem_create_elems @ ( "Bar", "Bar2", "1", "Standard", @ TRUE, "Node 1", "Node 2", "", "", @ "", "", "", "", s_fem_elements_created) dump i_return_value dump s_fem_elements_created #--------------------------------------------------------------------# Mirror translate the bar element # s_mirror_elem_select = "2" s_plane_select = "Coord 0.2" r_offset = 3. l_reverse_elements = TRUE i_flag = TRUE s_element_select = "Elm 1" i_return_value = fem_transform_elems_mirror_1 ( s_mirror_elem_select, s_plane_select, r_offset, l_reverse_elements, i_flag , s_element_select, sv_nodes_created, sv_elements_created, sv_nodes_deleted, sv_elements_deleted ) dump i_return_value dump sv_nodes_created dump sv_elements_created dump sv_nodes_deleted dump sv_elements_deleted

@ @ @ @ @ @ @ @ @ @ @

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_nodes_deleted) sys_free_string(sv_elements_deleted) sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

fem_transform_elems_rotate_1 # # # # # # # # # # #

Main Index

Purpose

:

()

This file provides an example of a call to the function fem_transform_elems_rotate_1() This session file creates a new database by name new.db. Two nodes and a bar element using the nodes are created. This function is then called to rotate the bar element twice. This file can be run by starting a session of Patran, and running this session file

Chapter 4: Finite Element Functions 747 Transform Action

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_transform_elems_rotate() # has the following arguments: # # fem_transform_elems_rotate_1 # ( rotate_elem_select, # axis_select, # rotation_angle, # offset_angle, # ref_coord_frame, # repeat_number, #flag # element_select, # nodes_created, # elements_created, # nodes_deleted, # elements_deleted ) # #--------------------------------------------------------------------# Variable Declarations STRING s_rotate_elem_select[32] STRING s_axis_select[32] REAL r_rotation_angle REAL r_offset_angle STRING s_ref_coord_frame[32] INTEGER i_repeat_number INTEGERi_flag STRING s_element_select[32] STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_nodes_deleted[VIRTUAL] STRING sv_elements_deleted[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] STRING s_fem_elements_created[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create 2 nodes without associating with any geometry i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[2 2 0][3 5 0]", sv_fem_nodes_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Create a bar element using the 2 nodes # i_return_value = @ fem_create_elems @ ( "Bar", "Bar2", "1", "Standard", @ TRUE, "Node 1", "Node 2", "", "", @ "", "", "", "", s_fem_elements_created) dump i_return_value dump s_fem_elements_created #--------------------------------------------------------------------# Rotate the bar element twice

Main Index

748 PCL Reference Manual Examples Transform Action

# s_rotate_elem_select s_axis_select r_rotation_angle r_offset_angle s_ref_coord_frame i_repeat_number i_flag = TRUE s_element_select

= = = = = =

"2" "Coord 0.3" 40. 10. "Coord 0" 2

= "Elm 1"

i_return_value = fem_transform_elems_rotate_1 ( s_rotate_elem_select, s_axis_select, r_rotation_angle, r_offset_angle, s_ref_coord_frame, i_repeat_number, i_flag, @ s_element_select, sv_nodes_created, sv_elements_created, sv_nodes_deleted, sv_elements_deleted ) dump i_return_value dump sv_nodes_created dump sv_elements_created dump sv_nodes_deleted dump sv_elements_deleted

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

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_nodes_deleted) sys_free_string(sv_elements_deleted) sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

()

fem_transform_nodes_rotate_1 # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_transform_nodes_rotate_1() This session file creates a new database by the name new.db. A node is created. This function is then called to rotate the node. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fem_transform_nodes_rotate() has the following arguments: fem_transform_nodes_rotate_1 ( rotate_node_select, axis_select, rotation_angle, offset_angle, ref_coord_frame, repeat_number, flag, node_select, nodes_created,

Chapter 4: Finite Element Functions 749 Transform Action

# nodes_deleted ) # #--------------------------------------------------------------------# Variable Declarations STRING s_rotate_node_select[32] STRING s_axis_select[32] REAL r_rotation_angle REAL r_offset_angle STRING s_ref_coord_frame[32] INTEGER i_repeat_number INTEGERi_flag STRING s_node_select[32] STRING sv_nodes_created[VIRTUAL] STRING sv_nodes_deleted[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a node # i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ " [ 5 6 0 ]", sv_fem_nodes_created ) dump i_return_value dump sv_fem_nodes_created node_label( TRUE ) #--------------------------------------------------------------------# Rotate the node twice # s_rotate_node_select = "2" s_axis_select = "Coord 0.3" r_rotation_angle = 30. r_offset_angle = 10. s_ref_coord_frame = "Coord 0" i_repeat_number = 2 i_flag = TRUE s_node_select = "Node 1" i_return_value = fem_transform_nodes_rotate_1 ( s_rotate_node_select, s_axis_select, r_rotation_angle, r_offset_angle, s_ref_coord_frame, i_repeat_number, i_flag, s_node_select, sv_nodes_created, sv_nodes_deleted ) dump i_return_value dump sv_nodes_created dump sv_nodes_deleted

@ @ @ @ @ @ @ @ @ @ @

sys_free_string(sv_fem_nodes_created) sys_free_string(sv_nodes_created) sys_free_string(sv_nodes_deleted) #---------------------------------------------------------------------

Main Index

750 PCL Reference Manual Examples Transform Action

fem_translate_nodes_1

()

# # Purpose : This file provides an example of a call to the # function fem_translate_nodes_1() # # This session file creates a new database by the # name new.db. A node is created. This function # is then called to translate the node. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_translate_nodes() # has the following arguments: # # fem_translate_nodes # ( trans_node_select, # vector_select, # ref_coord_frame, # repeat_number, # transform_type, # delete_parents, # node_select, # nodes_created, # nodes_deleted ) # #--------------------------------------------------------------------# Variable Declarations STRING s_trans_node_select[32] STRING s_vector_select[32] STRING s_ref_coord_frame[32] INTEGER i_repeat_number LOGICAL l_transform_type LOGICAL l_delete_parents STRING s_node_select[32] STRING sv_nodes_created[VIRTUAL] STRING sv_nodes_deleted[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a node # i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ " [ 5 6 0 ]", sv_fem_nodes_created ) dump i_return_value dump sv_fem_nodes_created node_label( TRUE ) #--------------------------------------------------------------------# Translate the node twice # s_trans_node_select = "2" s_vector_select = "<1 0 0>"

Main Index

Chapter 4: Finite Element Functions 751 Transform Action

s_ref_coord_frame i_repeat_number l_transform_type l_delete_parents s_node_select

= = = = =

"Coord 0" 2 FALSE FALSE "Node 1"

i_return_value = fem_translate_nodes ( s_trans_node_select, s_vector_select, s_ref_coord_frame, i_repeat_number, l_transform_type, l_delete_parents, s_node_select, sv_nodes_created, sv_nodes_deleted ) dump i_return_value dump sv_nodes_created dump sv_nodes_deleted

@ @ @ @ @ @ @ @ @ @

sys_free_string(sv_fem_nodes_created) sys_free_string(sv_nodes_created) sys_free_string(sv_nodes_deleted) #---------------------------------------------------------------------

fem_translate_elems_1

()

# # Purpose : This file provides an example of a call to the # function fem_translate_elems_1() # # This session file creates a new database by # name new.db. Two nodes and a bar element using # the nodes are created. This function is then # called to translate the bar 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 fem_translate_elems() # has the following arguments: # # fem_translate_elems # ( trans_elem_select, # vector_select, # ref_coord_frame, # repeat_number, # transform_type, # flag, # element_select, # nodes_created, # elements_created, # nodes_deleted, # elements_deleted ) # #--------------------------------------------------------------------# Variable Declarations STRING s_trans_elem_select[32] STRING s_vector_select[32] STRING s_ref_coord_frame[32] INTEGER i_repeat_number LOGICAL l_transform_type

Main Index

752 PCL Reference Manual Examples Transform Action

INTEGER i_flag STRING s_element_select[32] STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_nodes_deleted[VIRTUAL] STRING sv_elements_deleted[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] STRING s_fem_elements_created[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create 2 nodes without associating with any geometry i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[2 2 0][3 5 0]", sv_fem_nodes_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Create a bar element using the 2 nodes # i_return_value = @ fem_create_elems @ ( "Bar", "Bar2", "1", "Standard", @ TRUE, "Node 1", "Node 2", "", "", @ "", "", "", "", s_fem_elements_created) dump i_return_value dump s_fem_elements_created #--------------------------------------------------------------------# Translate the bar element # s_trans_elem_select = "2" s_vector_select = "<2 1 0>" s_ref_coord_frame = "Coord 0" i_repeat_number = 1 l_transform_type = FALSE l_delete_parents = FALSE s_element_select = "Elm 1" i_return_value = fem_translate_elems_1 @ ( s_trans_elem_select, s_vector_select, s_ref_coord_frame, i_repeat_number, l_transform_type, i_flag, s_element_select, sv_nodes_created, sv_elements_created, sv_nodes_deleted, sv_elements_deleted ) dump i_return_value dump sv_nodes_created dump sv_elements_created dump sv_nodes_deleted dump sv_elements_deleted

Main Index

@ @ @ @ @ @ @ @ @ @ @

Chapter 4: Finite Element Functions 753 Transform Action

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_nodes_deleted) sys_free_string(sv_elements_deleted) sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

Main Index

754 PCL Reference Manual Examples Sweep Action

Sweep Action This section contains examples of some of the functions used to duplicate and/or translate finite element model nodes, elements, multi-point constraints (MPCs), meshes, and mesh seeds through the use of sweep operations. fem_sweep_arc_1

()

# # Purpose : This file provides an example of a call to the # function fem_sweep_arc_1() # # This session file creates a new database by # name new.db. Two nodes and a bar element using # the nodes are created. This function is then # called to sweep the bar element through an 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 fem_sweep_arc() # has the following arguments: # # fem_sweep_arc_1 # ( sweep_elem_select, # sweep_node_select, # arc_angle, # arc_coord_frame, # axis_rotation, # offset_angle, # flag, # entity_select, # num_topologies, # sweep_topologies, # anly_coord_frame, # ref_coord_frame, # mesh_control_type, # mesh_control, # num_nodes, # num_elements, # nodes_created, # elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_sweep_elem_select[32] STRING s_sweep_node_select[32] STRING s_arc_angle[32] STRING s_arc_coord_frame[32] STRING s_axis_rotation[32] STRING s_offset_angle[32] INTEGER i_flag STRING s_entity_select[32] INTEGER i_num_topologies STRING sa_sweep_topologies[32](10) STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] STRING s_mesh_control_type[32] STRING sa_mesh_control[32](6) INTEGER i_num_nodes INTEGER i_num_elements

Main Index

Chapter 4: Finite Element Functions 755 Sweep Action

STRING STRING STRING STRING INTEGER

sv_nodes_created[VIRTUAL] sv_elements_created[VIRTUAL] sv_fem_nodes_created[VIRTUAL] s_fem_elements_created[32] i_return_value

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create 2 nodes without associating with any geometry i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[2 2 0][5 3 0]", sv_fem_nodes_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Create a bar element using the 2 nodes # i_return_value = @ fem_create_elems @ ( "Bar", "Bar2", "1", "Standard", @ TRUE, "Node 1", "Node 2", "", "", @ "", "", "", "", s_fem_elements_created) dump i_return_value dump s_fem_elements_created #--------------------------------------------------------------------# Sweep the bar element through an arc # s_sweep_elem_select = "2" s_sweep_node_select = "3" s_arc_angle = "45." s_arc_coord_frame = "Coord 0" s_axis_rotation = "Coord 0.3" s_offset_angle = "0.0" i_flag = TRUE s_entity_select = "Elem 1" i_num_topologies = 10 sa_sweep_topologies(1) = "Bar2" sa_sweep_topologies(2) = "Quad4" sa_sweep_topologies(3) = "Quad8" sa_sweep_topologies(4) = "Quad12" sa_sweep_topologies(5) = "Wedge6" sa_sweep_topologies(6) = "Wedge15" sa_sweep_topologies(7) = "Wedge24" sa_sweep_topologies(8) = "Hex8" sa_sweep_topologies(9) = "Hex20" sa_sweep_topologies(10) = "Hex32" s_anly_coord_frame = "Coord 0" s_ref_coord_frame = "Coord 0" s_mesh_control_type = "Uniform: Number of Elements" sa_mesh_control(6) = "2" i_return_value = fem_sweep_arc_1 ( s_sweep_elem_select, s_sweep_node_select, s_arc_angle, s_arc_coord_frame, s_axis_rotation,

Main Index

@ @ @ @ @ @ @

756 PCL Reference Manual Examples Sweep Action

dump dump dump dump dump

s_offset_angle, i_flag , s_entity_select, i_num_topologies, sa_sweep_topologies, s_anly_coord_frame, s_ref_coord_frame, s_mesh_control_type, sa_mesh_control, i_num_nodes, i_num_elements, sv_nodes_created, sv_elements_created ) i_return_value i_num_nodes i_num_elements sv_nodes_created sv_elements_created

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

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

fem_sweep_cylinder_radial_1

()

# # Purpose : This file provides an example of a call to the # function fem_sweep_cylinder_radial_1() # # This session file creates a new database by # name new.db. Three nodes and a triangular # element using the nodes are created. This # function is then called to sweep the element # along a cylindrical radius. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_sweep_cylinder_radial() # has the following arguments: # # fem_sweep_cylinder_radial_1 # ( sweep_elem_select, # sweep_node_select, # cyl_coord_frame, # axis_cylinder, # radial_distance, # offset_distance, # flag, # entity_select, # num_topologies, # sweep_topologies, # anly_coord_frame, # ref_coord_frame, # mesh_control_type, # mesh_control, # num_nodes, # num_elements, # nodes_created, # elements_created ) # #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 757 Sweep Action

#

Variable Declarations

STRING s_sweep_elem_select[32] STRING s_sweep_node_select[32] STRING s_cyl_coord_frame[32] STRING s_axis_cylinder[32] STRING s_radial_distance[32] STRING s_offset_distance[32] INTEGER i_flag STRING s_entity_select[32] INTEGER i_num_topologies STRING sa_sweep_topologies[32](10) STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] STRING s_mesh_control_type[32] STRING sa_mesh_control[32](6) INTEGER i_num_nodes INTEGER i_num_elements STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] STRING s_fem_elements_created[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create 3 nodes without associating with any geometry i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[2 2 0][1 3 0][5 3 0]", sv_fem_nodes_created) dump i_return_value dump sv_fem_nodes_created node_label( TRUE ) tri_elem_label( TRUE ) #--------------------------------------------------------------------# Create a triangular element using the 2 nodes # i_return_value = @ fem_create_elems @ ( "Tri", "Tria3", "1", "Standard", TRUE, @ "Node 1", "Node 2", "Node 3", "", "", @ "", "", "", s_fem_elements_created) dump i_return_value dump s_fem_elements_created #--------------------------------------------------------------------# Sweep the element along a cylindrical radius # s_sweep_elem_select = "2" s_sweep_node_select = "4" s_cyl_coord_frame = "Coord 0" s_axis_cylinder = "{[0 0 1][1 0 1]}" s_radial_distance = "2." s_offset_distance = "1." i_flag = TRUE s_entity_select = "Elem 1" i_num_topologies = 10 sa_sweep_topologies(1) = "Bar2" sa_sweep_topologies(2) = "Quad4" sa_sweep_topologies(3) = "Quad8"

Main Index

758 PCL Reference Manual Examples Sweep Action

sa_sweep_topologies(4) sa_sweep_topologies(5) sa_sweep_topologies(6) sa_sweep_topologies(7) sa_sweep_topologies(8) sa_sweep_topologies(9) sa_sweep_topologies(10) s_anly_coord_frame s_ref_coord_frame s_mesh_control_type sa_mesh_control(6)

= = = = = = = = = = =

"Quad12" "Wedge6" "Wedge15" "Wedge24" "Hex8" "Hex20" "Hex32" "Coord 0" "Coord 0" "Uniform: Number of Elements" "2"

i_return_value = fem_sweep_cylinder_radial_1 ( s_sweep_elem_select, s_sweep_node_select, s_cyl_coord_frame, s_axis_cylinder, s_radial_distance, s_offset_distance, i_flag, @ s_entity_select, i_num_topologies, sa_sweep_topologies, s_anly_coord_frame, s_ref_coord_frame, s_mesh_control_type, sa_mesh_control, i_num_nodes, i_num_elements, sv_nodes_created, sv_elements_created ) dump i_return_value dump i_num_nodes dump i_num_elements dump sv_nodes_created dump sv_elements_created

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

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

()

fem_sweep_extrude_1 # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_sweep_extrude_1() This session file creates a new database by name new.db. Two nodes and a bar element using the nodes are created. This function is then called to sweep the element by extrude method. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fem_sweep_extrude() has the following arguments: fem_sweep_extrude_1 ( sweep_elem_select, sweep_node_select,

Chapter 4: Finite Element Functions 759 Sweep Action

# vector_coord_frame, # vector_direction, # extrusion_distance, # offset_distance, # flag, # entity_select, # num_topologies, # sweep_topologies, # anly_coord_frame, # ref_coord_frame, # mesh_control_type, # mesh_control, # num_nodes, # num_elements, # nodes_created, # elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_sweep_elem_select[32] STRING s_sweep_node_select[32] STRING s_vector_coord_frame[32] STRING s_vector_direction[32] STRING s_extrusion_distance[32] STRING s_cyl_coord_frame[32] STRING s_axis_cylinder[32] STRING s_radial_distance[32] STRING s_offset_distance[32] INTEGER i_flag STRING s_entity_select[32] INTEGER i_num_topologies STRING sa_sweep_topologies[32](10) STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] STRING s_mesh_control_type[32] STRING sa_mesh_control[32](6) INTEGER i_num_nodes INTEGER i_num_elements STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] STRING s_fem_elements_created[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create 2 nodes without associating with any geometry i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[2 2 0][5 3 0]", sv_fem_nodes_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Create a bar element using the 2 nodes # i_return_value = @ fem_create_elems @ ( "Bar", "Bar2", "1", "Standard", @ TRUE, "Node 1", "Node 2", "", "", @

Main Index

760 PCL Reference Manual Examples Sweep Action

"", "", "", "", s_fem_elements_created) dump i_return_value dump s_fem_elements_created #--------------------------------------------------------------------# Sweep the element by extrude method # s_sweep_elem_select = "2" s_sweep_node_select = "3" s_vector_coord_frame = "Coord 0" s_vector_direction = "<1 2 0>" s_extrusion_distance = "2.5" s_offset_distance = "1." i_flag = TRUE s_entity_select = "Elem 1" i_num_topologies = 10 sa_sweep_topologies(1) = "Bar2" sa_sweep_topologies(2) = "Quad4" sa_sweep_topologies(3) = "Quad8" sa_sweep_topologies(4) = "Quad12" sa_sweep_topologies(5) = "Wedge6" sa_sweep_topologies(6) = "Wedge15" sa_sweep_topologies(7) = "Wedge24" sa_sweep_topologies(8) = "Hex8" sa_sweep_topologies(9) = "Hex20" sa_sweep_topologies(10) = "Hex32" s_anly_coord_frame = "Coord 0" s_ref_coord_frame = "Coord 0" s_mesh_control_type = "Uniform: Number of Elements" sa_mesh_control(6) = "2" i_return_value = fem_sweep_extrude_1 ( s_sweep_elem_select, s_sweep_node_select, s_vector_coord_frame, s_vector_direction, s_extrusion_distance, s_offset_distance, i_true, @ s_entity_select, i_num_topologies, sa_sweep_topologies, s_anly_coord_frame, s_ref_coord_frame, s_mesh_control_type, sa_mesh_control, i_num_nodes, i_num_elements, sv_nodes_created, sv_elements_created ) dump i_return_value dump i_num_nodes dump i_num_elements dump sv_nodes_created dump sv_elements_created

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

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

fem_sweep_glide_1 #

Main Index

()

Chapter 4: Finite Element Functions 761 Sweep Action

# Purpose : This file provides an example of a call to the # function fem_sweep_glide_1() # # This session file creates a new database by # name new.db. Two nodes and a bar element using # the nodes are created. This function is then # called to sweep the bar element by gliding # along 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 fem_sweep_glide() # has the following arguments: # # fem_sweep_glide_1 # ( sweep_elem_select, # sweep_node_select, # glide_coord_frame, # glide_type, # glide_curve, # glide_beginning, # glide_end, # reverse_glide, # offset_glide, # glide_parameter, # glide_pnts_parametric, # flag, # entity_select, # num_topologies, # sweep_topologies, # anly_coord_frame, # ref_coord_frame, # mesh_control_type, # mesh_control, # num_nodes, # num_elements, # nodes_created, # elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_sweep_elem_select[32] STRING s_sweep_node_select[32] STRING s_glide_coord_frame[32] STRING s_glide_type[32] STRING s_glide_curve[32] STRING s_glide_beginning[32] STRING s_glide_end[32] LOGICAL l_reverse_glide LOGICAL l_offset_glide LOGICAL l_glide_parameter LOGICAL l_glide_pnts_parametric INTEGER i_flag STRING s_entity_select[32] INTEGER i_num_topologies STRING sa_sweep_topologies[32](10) STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] STRING s_mesh_control_type[32] STRING sa_mesh_control[32](6) INTEGER i_num_nodes INTEGER i_num_elements STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL]

Main Index

762 PCL Reference Manual Examples Sweep Action

STRING STRING INTEGER

sv_created_ids[VIRTUAL] s_fem_elements_created[32] i_return_value

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a curve for gliding the element i_return_value = @ sgm_const_curve_bspline @ ( "1", "[2 2 0], [2 5 0], [0 3 0], @ [-2 5 0]", 4, TRUE, 1, FALSE, sv_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create 2 nodes without associating with any geometry i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[2 2 0][4 7 0]", sv_fem_nodes_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Create a bar element using the 2 nodes # i_return_value = @ fem_create_elems @ ( "Bar", "Bar2", "1", "Standard", @ TRUE, "Node 1", "Node 2", "", "", @ "", "", "", "", s_fem_elements_created) dump i_return_value dump s_fem_elements_created #--------------------------------------------------------------------# Sweep the bar element by gliding along a curve # s_sweep_elem_select = "2" s_sweep_node_select = "3" s_glide_coord_frame = "Coord 0" s_glide_type = "fixed" s_glide_curve = "Curve 1" s_glide_beginning = "[2 2 0]" s_glide_end = "[-2 5 0]" l_reverse_glide = FALSE l_offset_glide = FALSE l_glide_parameter = FALSE l_glide_pnts_parametric = FALSE i_flag = TRUE s_entity_select = "Elem 1" i_num_topologies = 10 sa_sweep_topologies(1) = "Bar2" sa_sweep_topologies(2) = "Quad4" sa_sweep_topologies(3) = "Quad8" sa_sweep_topologies(4) = "Quad12" sa_sweep_topologies(5) = "Wedge6" sa_sweep_topologies(6) = "Wedge15" sa_sweep_topologies(7) = "Wedge24" sa_sweep_topologies(8) = "Hex8" sa_sweep_topologies(9) = "Hex20" sa_sweep_topologies(10) = "Hex32"

Main Index

Chapter 4: Finite Element Functions 763 Sweep Action

s_anly_coord_frame s_ref_coord_frame s_mesh_control_type sa_mesh_control(6)

= = = =

"Coord 0" "Coord 0" "Uniform: Number of Elements" "3"

i_return_value = fem_sweep_glide_1 @ ( s_sweep_elem_select, s_sweep_node_select, s_glide_coord_frame, s_glide_type, s_glide_curve, s_glide_beginning, s_glide_end, l_reverse_glide, l_offset_glide, l_glide_parameter, l_glide_pnts_parametric, flag, @ s_entity_select, i_num_topologies, sa_sweep_topologies, s_anly_coord_frame, s_ref_coord_frame, s_mesh_control_type, sa_mesh_control, i_num_nodes, i_num_elements, sv_nodes_created, sv_elements_created ) dump i_return_value dump i_num_nodes dump i_num_elements dump sv_nodes_created dump sv_elements_created

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

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

()

fem_sweep_glide_guide_1 # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_sweep_glide_guide_1() This session file creates a new database by name new.db. Two nodes and a bar element using the nodes are created. This function is then called to sweep the bar element by glide-guide method. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fem_sweep_glide_guide() has the following arguments: fem_sweep_glide_guide_1 ( sweep_elem_select, sweep_node_select,

764 PCL Reference Manual Examples Sweep Action

# glide_coord_frame, # glide_curve, # glide_beginning, # glide_end, # reverse_glide, # offset_glide, # glide_parameter, # glide_pnts_parametric, # flag, # entity_select, # guide_curve, # guide_beginning, # guide_end, # reverse_guide, # offset_guide, # guide_parameter, # guide_pnts_parameter, # preserve_guide_axis, # num_topologies, # sweep_topologies, # anly_coord_frame, # ref_coord_frame, # mesh_control_type, # mesh_control, # num_nodes, # num_elements, # nodes_created, # elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_sweep_elem_select[32] STRING s_sweep_node_select[32] STRING s_glide_coord_frame[32] STRING s_glide_curve[32] STRING s_glide_beginning[32] STRING s_glide_end[32] LOGICAL l_reverse_glide LOGICAL l_offset_glide LOGICAL l_glide_parameter LOGICAL l_glide_pnts_parametric INTEGER i_flag STRING s_entity_select[32] STRING s_guide_curve[32] STRING s_guide_beginning[32] STRING s_guide_end[32] LOGICAL l_reverse_guide LOGICAL l_offset_guide LOGICAL l_guide_parameter LOGICAL l_guide_pnts_parameter LOGICAL l_preserve_guide_axis INTEGER i_num_topologies STRING sa_sweep_topologies[32](10) STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] STRING s_mesh_control_type[32] STRING sa_mesh_control[32](6) INTEGER i_num_nodes INTEGER i_num_elements STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] STRING sv_created_ids[VIRTUAL] STRING s_fem_elements_created[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db"

Main Index

Chapter 4: Finite Element Functions 765 Sweep Action

uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a circular arc for gliding the element i_return_value = sgm_const_curve_2d_arcangles_v1 ( "1", 3., 0., 90., "Coord 0.3", "[0 0 0]", TRUE, sv_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create another circular arc for guiding the element i_return_value = sgm_const_curve_2d_arcangles_v1 ( "2", 5., 0., 90., "Coord 0.3", "[0 2 0]", TRUE, sv_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create 2 nodes without associating with any geometry i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[3 0 0][5 2 0]", sv_fem_nodes_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Create a bar element using the 2 nodes # i_return_value = @ fem_create_elems @ ( "Bar", "Bar2", "1", "Standard", @ TRUE, "Node 1", "Node 2", "", "", @ "", "", "", "", s_fem_elements_created) dump i_return_value dump s_fem_elements_created #--------------------------------------------------------------------# Sweep the bar element by glide-guide method # s_sweep_elem_select = "2" s_sweep_node_select = "3" s_glide_coord_frame = "Coord 0" s_glide_curve = "Curve 1" s_glide_beginning = "[3 0 0]" s_glide_end = "[0 3 0]" l_reverse_glide = FALSE l_offset_glide = FALSE l_glide_parameter = FALSE l_glide_pnts_parametric = FALSE l_delete_parents = FALSE s_entity_select = "Elem 1" s_guide_curve = "Curve 2" s_guide_beginning = "[5 2 0]" s_guide_end = "[7 0 0]" l_reverse_guide = FALSE l_offset_guide = FALSE l_guide_parameter = FALSE l_guide_pnts_parameter = FALSE l_preserve_guide_axis = FALSE i_num_topologies = 10

Main Index

766 PCL Reference Manual Examples Sweep Action

sa_sweep_topologies(1) sa_sweep_topologies(2) sa_sweep_topologies(3) sa_sweep_topologies(4) sa_sweep_topologies(5) sa_sweep_topologies(6) sa_sweep_topologies(7) sa_sweep_topologies(8) sa_sweep_topologies(9) sa_sweep_topologies(10) s_anly_coord_frame s_ref_coord_frame s_mesh_control_type sa_mesh_control(6)

= = = = = = = = = = = = = =

"Bar2" "Quad4" "Quad8" "Quad12" "Wedge6" "Wedge15" "Wedge24" "Hex8" "Hex20" "Hex32" "Coord 0" "Coord 0" "Uniform: Number of Elements" "3"

i_return_value = fem_sweep_glide_guide_1 ( s_sweep_elem_select, s_sweep_node_select, s_glide_coord_frame, s_glide_curve, s_glide_beginning, s_glide_end, l_reverse_glide, l_offset_glide, l_glide_parameter, l_glide_pnts_parametric, i_flag, @ s_entity_select, s_guide_curve, s_guide_beginning, s_guide_end, l_reverse_guide, l_offset_guide, l_guide_parameter, l_guide_pnts_parameter, l_preserve_guide_axis, i_num_topologies, sa_sweep_topologies, s_anly_coord_frame, s_ref_coord_frame, s_mesh_control_type, sa_mesh_control, i_num_nodes, i_num_elements, sv_nodes_created, sv_elements_created ) dump i_return_value dump i_num_nodes dump i_num_elements dump sv_nodes_created dump sv_elements_created

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

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 767 Sweep Action

fem_sweep_loft_1

()

# # Purpose : This file provides an example of a call to the # function fem_sweep_loft_1() # # This session file creates a new database by # name new.db. Six nodes and two triangular # elements using the nodes are created. This # function is then called to sweep the element # by using the loft method. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_sweep_loft() # has the following arguments: # # fem_sweep_loft_1 # ( sweep_elem_select, # sweep_node_select, # entity_select, # top_elements, # start_element, # start_element_top, # flag, # auto_align, # num_topologies, # sweep_topologies, # anly_coord_frame, # ref_coord_frame, # mesh_control_type, # mesh_control, # num_nodes, # num_elements, # nodes_created, # elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_sweep_elem_select[32] STRING s_sweep_node_select[32] STRING s_entity_select[32] STRING s_top_elements[32] STRING s_start_element[32] STRING s_start_element_top[32] INTEGER i_flag LOGICAL l_auto_align INTEGER i_num_topologies STRING sa_sweep_topologies[32](10) STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] STRING s_mesh_control_type[32] STRING sa_mesh_control[32](6) INTEGER i_num_nodes INTEGER i_num_elements STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] STRING s_fem_elements_created[32] INTEGER i_return_value #---------------------------------------------------------------------

Main Index

768 PCL Reference Manual Examples Sweep Action

# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create 6 nodes without associating with any geometry i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[2 4 0][8 4 0][2 8 0]", sv_fem_nodes_created) dump i_return_value dump sv_fem_nodes_created i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "4", @ "[2 0 6][8 0 6][2 0 10]", sv_fem_nodes_created) dump i_return_value dump sv_fem_nodes_created node_label( TRUE ) tri_elem_label( TRUE ) i_return_value = ga_view_aa_set( -70., 75., 80.) dump i_return_value

@

#--------------------------------------------------------------------# Create two triangular elements using the nodes # i_return_value = @ fem_create_elems @ ( "Tri", "Tria3", "1", "Standard", TRUE, @ "Node 1", "Node 2", "Node 3", "", "", @ "", "", "", s_fem_elements_created) dump i_return_value dump s_fem_elements_created i_return_value = fem_create_elems ( "Tri", "Tria3", "2", "Standard", TRUE, "Node 4", "Node 5", "Node 6", "", "", "", "", "", s_fem_elements_created) dump i_return_value dump s_fem_elements_created

@ @ @ @

#--------------------------------------------------------------------# Sweep the element by using the loft method # s_sweep_elem_select = "3" s_sweep_node_select = "7" s_entity_select = "Elem 1" s_top_elements = "Elem 2" s_start_element = "" s_start_element_top = "" l_delete_parents = FALSE l_auto_align = TRUE i_num_topologies = 10 sa_sweep_topologies(1) = "Bar2" sa_sweep_topologies(2) = "Quad4" sa_sweep_topologies(3) = "Quad8" sa_sweep_topologies(4) = "Quad12" sa_sweep_topologies(5) = "Wedge6" sa_sweep_topologies(6) = "Wedge15" sa_sweep_topologies(7) = "Wedge24" sa_sweep_topologies(8) = "Hex8" sa_sweep_topologies(9) = "Hex20"

Main Index

Chapter 4: Finite Element Functions 769 Sweep Action

sa_sweep_topologies(10) s_anly_coord_frame s_ref_coord_frame s_mesh_control_type sa_mesh_control(6)

= = = = =

"Hex32" "Coord 0" "Coord 0" "Uniform: Number of Elements" "3"

i_return_value = fem_sweep_loft_1 ( s_sweep_elem_select, s_sweep_node_select, s_entity_select, s_top_elements, s_start_element, s_start_element_top, i_flag, @ l_auto_align, i_num_topologies, sa_sweep_topologies, s_anly_coord_frame, s_ref_coord_frame, s_mesh_control_type, sa_mesh_control, i_num_nodes, i_num_elements, sv_nodes_created, sv_elements_created ) dump i_return_value dump i_num_nodes dump i_num_elements dump sv_nodes_created dump sv_elements_created

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

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

()

fem_sweep_normal_1 # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_sweep_normal_1() This session file creates a new database by name new.db. Three nodes and a triangular element using the nodes are created. This function is then called to sweep the element along the normal direction. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fem_sweep_normal() has the following arguments: fem_sweep_normal_1 ( sweep_elem_select, sweep_node_select, normal_distance, offset_distance, reverse_normal, flag, entity_select,

770 PCL Reference Manual Examples Sweep Action

# num_topologies, # sweep_topologies, # anly_coord_frame, # ref_coord_frame, # mesh_control_type, # mesh_control, # num_nodes, # num_elements, # nodes_created, # elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_sweep_elem_select[32] STRING s_sweep_node_select[32] STRING s_normal_distance[32] STRING s_offset_distance[32] LOGICAL l_reverse_normal INTEGERi_flag STRING s_entity_select[32] INTEGER i_num_topologies STRING sa_sweep_topologies[32](10) STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] STRING s_mesh_control_type[32] STRING sa_mesh_control[32](6) INTEGER i_num_nodes INTEGER i_num_elements STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] STRING s_fem_elements_created[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create 3 nodes without associating with any geometry i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[2 2 0][1 3 0][5 3 0]", sv_fem_nodes_created) dump i_return_value dump sv_fem_nodes_created node_label( TRUE ) tri_elem_label( TRUE ) i_return_value = ga_view_aa_set( -67., 0., -34.) dump i_return_value

@

#--------------------------------------------------------------------# Create a triangular element using the 2 nodes # i_return_value = @ fem_create_elems @ ( "Tri", "Tria3", "1", "Standard", TRUE, @ "Node 1", "Node 2", "Node 3", "", "", @ "", "", "", s_fem_elements_created) dump i_return_value dump s_fem_elements_created #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 771 Sweep Action

# Sweep the bar element along the normal # s_sweep_elem_select = "2" s_sweep_node_select = "4" s_normal_distance = "2." s_offset_distance = "1." l_reverse_normal = TRUE i_flag = TRUE s_entity_select = "Elem 1" i_num_topologies = 10 sa_sweep_topologies(1) = "Bar2" sa_sweep_topologies(2) = "Quad4" sa_sweep_topologies(3) = "Quad8" sa_sweep_topologies(4) = "Quad12" sa_sweep_topologies(5) = "Wedge6" sa_sweep_topologies(6) = "Wedge15" sa_sweep_topologies(7) = "Wedge24" sa_sweep_topologies(8) = "Hex8" sa_sweep_topologies(9) = "Hex20" sa_sweep_topologies(10) = "Hex32" s_anly_coord_frame = "Coord 0" s_ref_coord_frame = "Coord 0" s_mesh_control_type = "Uniform: Number of Elements" sa_mesh_control(6) = "3" i_return_value = fem_sweep_normal ( s_sweep_elem_select, s_sweep_node_select, s_normal_distance, s_offset_distance, l_reverse_normal, i_flag, @ s_entity_select, i_num_topologies, sa_sweep_topologies, s_anly_coord_frame, s_ref_coord_frame, s_mesh_control_type, sa_mesh_control, i_num_nodes, i_num_elements, sv_nodes_created, sv_elements_created ) dump i_return_value dump i_num_nodes dump i_num_elements dump sv_nodes_created dump sv_elements_created

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

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

()

fem_sweep_sphere_angle_1 # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_sweep_sphere_angle_1() This session file creates a new database by name new.db. A triangular element is created. This function is then called to sweep the element along the spherical theta direction.

772 PCL Reference Manual Examples Sweep Action

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_sweep_sphere_angle() # has the following arguments: # # fem_sweep_sphere_angle_1 # ( sweep_elem_select, # sweep_node_select, # sphere_coord_frame, # axis_spherical, # sweep_angle, # angle_offset, # flag, # entity_select, # num_topologies, # sweep_topologies, # anly_coord_frame, # ref_coord_frame, # mesh_control_type, # mesh_control, # num_nodes, # num_elements, # nodes_created, # elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_sweep_elem_select[32] STRING s_sweep_node_select[32] STRING s_sphere_coord_frame[32] STRING s_axis_spherical[32] STRING s_sweep_angle[32] STRING s_angle_offset[32] INTEGER i_flag STRING s_entity_select[32] INTEGER i_num_topologies STRING sa_sweep_topologies[32](10) STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] STRING s_mesh_control_type[32] STRING sa_mesh_control[32](6) INTEGER i_num_nodes INTEGER i_num_elements STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING s_fem_elements_created[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a triangular element # i_return_value = @ fem_create_elems @ ( "Tri", "Tria3", "1", "Standard", TRUE, @ "[2 2 0]", "[1 3 0]", "[5 3 0]", "", @ "", "", "", "", s_fem_elements_created) dump i_return_value node_label( TRUE )

Main Index

Chapter 4: Finite Element Functions 773 Sweep Action

tri_elem_label( TRUE ) i_return_value = ga_view_aa_set( -67., 0., -34.) dump i_return_value

@

#--------------------------------------------------------------------# Sweep the element along a spherical theta direction # s_sweep_elem_select = "2" s_sweep_node_select = "4" s_sphere_coord_frame = "Coord 0" s_axis_spherical = "Coord 0.3" s_sweep_angle = "45." s_angle_offset = "15." i_flag = TRUE s_entity_select = "Elem 1" i_num_topologies = 10 sa_sweep_topologies(1) = "Bar2" sa_sweep_topologies(2) = "Quad4" sa_sweep_topologies(3) = "Quad8" sa_sweep_topologies(4) = "Quad12" sa_sweep_topologies(5) = "Wedge6" sa_sweep_topologies(6) = "Wedge15" sa_sweep_topologies(7) = "Wedge24" sa_sweep_topologies(8) = "Hex8" sa_sweep_topologies(9) = "Hex20" sa_sweep_topologies(10) = "Hex32" s_anly_coord_frame = "Coord 0" s_ref_coord_frame = "Coord 0" s_mesh_control_type = "Uniform: Number of Elements" sa_mesh_control(6) = "2" i_return_value = fem_sweep_sphere_angle_1 @ ( s_sweep_elem_select, s_sweep_node_select, s_sphere_coord_frame, s_axis_spherical, s_sweep_angle, s_angle_offset, i_flag, @ s_entity_select, i_num_topologies, sa_sweep_topologies, s_anly_coord_frame, s_ref_coord_frame, s_mesh_control_type, sa_mesh_control, i_num_nodes, i_num_elements, sv_nodes_created, sv_elements_created ) dump i_return_value dump i_num_nodes dump i_num_elements dump sv_nodes_created dump sv_elements_created

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

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) #---------------------------------------------------------------------

Main Index

774 PCL Reference Manual Examples Sweep Action

fem_sweep_sphere_radial_1

()

# # Purpose : This file provides an example of a call to the # function fem_sweep_sphere_radial_1() # # This session file creates a new database by # name new.db. A triangular element is created. # This function is then called to sweep the # element along a spherical radius. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_sweep_sphere_radial() # has the following arguments: # # fem_sweep_sphere_radial_1 # ( sweep_elem_select, # sweep_node_select, # sphere_coord_frame, # sphere_center, # radial_distance, # offset_distance, # flag, # entity_select, # num_topologies, # sweep_topologies, # anly_coord_frame, # ref_coord_frame, # mesh_control_type, # mesh_control, # num_nodes, # num_elements, # nodes_created, # elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_sweep_elem_select[32] STRING s_sweep_node_select[32] STRING s_sphere_coord_frame[32] STRING s_sphere_center[32] STRING s_radial_distance[32] STRING s_offset_distance[32] INTEGER i_flag STRING s_entity_select[32] INTEGER i_num_topologies STRING sa_sweep_topologies[32](10) STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] STRING s_mesh_control_type[32] STRING sa_mesh_control[32](6) INTEGER i_num_nodes INTEGER i_num_elements STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING s_fem_elements_created[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db")

Main Index

Chapter 4: Finite Element Functions 775 Sweep Action

$? YES 36000002 #--------------------------------------------------------------------# Create a triangular element # i_return_value = @ fem_create_elems @ ( "Tri", "Tria3", "1", "Standard", TRUE, @ "[2 2 0]", "[1 3 0]", "[5 3 0]", "", @ "", "", "", "", s_fem_elements_created) dump i_return_value node_label( TRUE ) tri_elem_label( TRUE ) #--------------------------------------------------------------------# Sweep the element along a spherical radius # s_sweep_elem_select = "2" s_sweep_node_select = "4" s_sphere_coord_frame = "Coord 0" s_sphere_center = "[2 5 2]" s_radial_distance = "5." s_offset_distance = "1." i_flag = TRUE s_entity_select = "Elem 1" i_num_topologies = 10 sa_sweep_topologies(1) = "Bar2" sa_sweep_topologies(2) = "Quad4" sa_sweep_topologies(3) = "Quad8" sa_sweep_topologies(4) = "Quad12" sa_sweep_topologies(5) = "Wedge6" sa_sweep_topologies(6) = "Wedge15" sa_sweep_topologies(7) = "Wedge24" sa_sweep_topologies(8) = "Hex8" sa_sweep_topologies(9) = "Hex20" sa_sweep_topologies(10) = "Hex32" s_anly_coord_frame = "Coord 0" s_ref_coord_frame = "Coord 0" s_mesh_control_type = "Uniform: Number of Elements" sa_mesh_control(6) = "2" i_return_value = fem_sweep_sphere_radial_1 ( s_sweep_elem_select, s_sweep_node_select, s_sphere_coord_frame, s_sphere_center, s_radial_distance, s_offset_distance, i_flag, @ s_entity_select, i_num_topologies, sa_sweep_topologies, s_anly_coord_frame, s_ref_coord_frame, s_mesh_control_type, sa_mesh_control, i_num_nodes, i_num_elements, sv_nodes_created, sv_elements_created ) dump i_return_value dump i_num_nodes dump i_num_elements dump sv_nodes_created dump sv_elements_created

Main Index

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

776 PCL Reference Manual Examples Sweep Action

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) #---------------------------------------------------------------------

fem_sweep_vector_field_1

()

# # Purpose : This file provides an example of a call to the # function fem_sweep_vector_field_1() # # This session file creates a new database by # name new.db. A vector field and a triangular # element is created. This function is then # called to sweep the element using the vector # field sweep method. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_sweep_vector_field() # has the following arguments: # # fem_sweep_vector_field_1 # ( sweep_elem_select, # sweep_node_select, # vector_field, # field_scale_factor, # offset_distance, # reverse_field, # normalize_field, # flag, # entity_select, # num_topologies, # sweep_topologies, # anly_coord_frame, # ref_coord_frame, # mesh_control_type, # mesh_control, # num_nodes, # num_elements, # nodes_created, # elements_created ) # #--------------------------------------------------------------------# Variable Declarations STRING s_sweep_elem_select[32] STRING s_sweep_node_select[32] STRING s_vector_field[32] STRING s_field_scale_factor[32] STRING s_offset_distance[32] LOGICAL l_reverse_field LOGICAL l_normalize_field INTEGER i_flage STRING s_entity_select[32] INTEGER i_num_topologies STRING sa_sweep_topologies[32](10) STRING s_anly_coord_frame[32] STRING s_ref_coord_frame[32] STRING s_mesh_control_type[32] STRING sa_mesh_control[32](6) INTEGER i_num_nodes INTEGER i_num_elements STRING sv_nodes_created[VIRTUAL]

Main Index

Chapter 4: Finite Element Functions 777 Sweep Action

STRING STRING INTEGER

sv_elements_created[VIRTUAL] s_fem_elements_created[32] i_return_value

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a vector field i_return_value = @ fields_create @ ( "vector_field", "Spatial", 1, "Vector", @ "Real", "Coord 0", "", "Function", 3, @ "X", "Y", "Z", "’X*2.", "’Y*2.", @ "’Z+’X+’Y", FALSE, [0.], [0.], [0.], [[[0.]]] ) dump i_return_value #--------------------------------------------------------------------# Create a triangular element # i_return_value = @ fem_create_elems @ ( "Tri", "Tria3", "1", "Standard", TRUE, @ "[2 2 0]", "[1 3 0]", "[5 3 0]", "", @ "", "", "", "", s_fem_elements_created) dump i_return_value node_label( TRUE ) tri_elem_label( TRUE ) #--------------------------------------------------------------------# Sweep the element by using the vector field sweep method # s_sweep_elem_select = "2" s_sweep_node_select = "4" s_vector_field = "vector_field" s_field_scale_factor = "1.5" s_offset_distance = "0.5" l_reverse_field = FALSE l_normalize_field = FALSE i_flag = TRUE s_entity_select = "Elem 1" i_num_topologies = 10 sa_sweep_topologies(1) = "Bar2" sa_sweep_topologies(2) = "Quad4" sa_sweep_topologies(3) = "Quad8" sa_sweep_topologies(4) = "Quad12" sa_sweep_topologies(5) = "Wedge6" sa_sweep_topologies(6) = "Wedge15" sa_sweep_topologies(7) = "Wedge24" sa_sweep_topologies(8) = "Hex8" sa_sweep_topologies(9) = "Hex20" sa_sweep_topologies(10) = "Hex32" s_anly_coord_frame = "Coord 0" s_ref_coord_frame = "Coord 0" s_mesh_control_type = "Uniform: Number of Elements" sa_mesh_control(6) = "2" i_return_value = fem_sweep_vector_field_1 ( s_sweep_elem_select, s_sweep_node_select, s_vector_field, s_field_scale_factor, s_offset_distance,

Main Index

@ @ @ @ @ @ @

778 PCL Reference Manual Examples Sweep Action

dump dump dump dump dump

l_reverse_field, l_normalize_field, i_flag, @ s_entity_select, i_num_topologies, sa_sweep_topologies, s_anly_coord_frame, s_ref_coord_frame, s_mesh_control_type, sa_mesh_control, i_num_nodes, i_num_elements, sv_nodes_created, sv_elements_created ) i_return_value i_num_nodes i_num_elements sv_nodes_created sv_elements_created

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

sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 779 Renumber Action

Renumber Action This section contains examples of some of the functions used to renumber the identifiers used to reference a selection of finite element model (FEM) nodes or elements. fem_renum_elem_1

()

# # Purpose : This file provides an example of a call to the # function fem_renum_elem_1() # # This session file creates a new database by # name new.db. Four nodes and four bar elements # using the nodes are created. This function is # then called to renumber the element identifiers # to consecutive odd numbers. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_renum_elem() # has the following arguments: # # fem_renum_elem_1 # ( original_selection, # new_selection, #flag, # created_selection ) # #--------------------------------------------------------------------# Variable Declarations STRING s_original_selection[128] STRING s_new_selection[128] STRING sv_created_selection[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] STRING s_fem_elements_created[32] INTEGER i_return_value INTEGERi_flag #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create 4 nodes without associating with any geometry i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[2 2 0][1 7 0][9 6 0][8 1 0]", sv_fem_nodes_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Create 4 bar elements using the nodes # i_return_value = @ fem_create_elems @ ( "Bar ", "Bar2", "1", "Standard", TRUE, @

Main Index

780 PCL Reference Manual Examples Renumber Action

"Node 1 2 3 4", "Node 2 3 4 1", "", "", @ "", "", "", "", s_fem_elements_created) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Renumber the elements to consecutive odd numbers s_original_selection = "Elm 1:4" s_new_selection = "1 3 5 7" i_return_value = fem_renum_elem_1 ( s_original_selection, s_new_selection, sv_created_selection i_flag) dump i_return_value dump sv_created_selection

@ @ @ @

sys_free_string(sv_created_selection) sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

fem_renum_node_1

()

# # Purpose : This file provides an example of a call to the # function fem_renum_node_1() # # This session file creates a new database by # name new.db. Four nodes are created first. This # function is then called to renumber the node # identifiers to consecutive even numbers. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_renum_node() # has the following arguments: # # fem_renum_node_1 # ( original_selection, # new_selection, # created_selection, #flag) # #--------------------------------------------------------------------# Variable Declarations STRING s_original_selection[32] STRING s_new_selection[32] STRING sv_created_selection[VIRTUAL] STRING sv_fem_nodes_created[VIRTUAL] INTEGER i_return_value INTEGERi_flag #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

Chapter 4: Finite Element Functions 781 Renumber Action

#--------------------------------------------------------------------# Create 4 nodes without associating with any geometry i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[2 2 0][1 7 0][9 6 0][8 1 0]", sv_fem_nodes_created) dump i_return_value node_label( TRUE ) #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Renumber the nodes to consecutive even numbers s_original_selection = "Node 1:4" s_new_selection = "2 4 6 8" i_return_value = fem_renum_node_1 @ ( s_original_selection, s_new_selection, sv_created_selection i_flag) dump i_return_value dump sv_created_selection

@ @ @

sys_free_string(sv_created_selection) sys_free_string(sv_fem_nodes_created) #---------------------------------------------------------------------

Main Index

782 PCL Reference Manual Examples Disassociate Action

Disassociate Action This section contains examples of some of the functions used to disassociate the identifiers used to reference a selection of finite element model (FEM) nodes or elements. fem_disassoc_geo

()

# # Purpose : This file provides an example of a call to the # function fem_disassoc_geo() # # This session file creates a new database by # name new.db. A line is created and is meshed # to create FEM entities associated with the # geometry. This function is then called to # disassociate all the elements from the line. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_disassoc_geo() # has the following arguments: # # fem_disassoc_geo # ( nodes, # elements, # geo_list ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_nodes LOGICAL l_elements STRING sv_geo_list[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[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", "[2 2 0]", "[8 2 0]", 0, "", 50., 1, sv_created_ids) dump i_return_value #--------------------------------------------------------------------# Mesh the line to create associated FEM entities i_return_value = fem_create_mesh_curv ( "Curve 1 ", 1., "Bar2", "1", "1", "Coord 0", "Coord 0", i_num_fem_nodes, i_num_fem_elements,

Main Index

@ @ @ @ @

Chapter 4: Finite Element Functions 783 Disassociate Action

sv_fem_nodes_created, sv_fem_elements_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Disassociate all the elements associated with the line # l_nodes = FALSE l_elements = TRUE sv_geo_list = "Curve 1" i_return_value = fem_disassoc_geo ( l_nodes, l_elements, sv_geo_list ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# # For confirming that elements have been disassociated, access the # form given by "Finite Elements", set Action switch to "Show", # Object switch to "Element" and the Method switch to "Attributes". # Give Element List as "Elm 1:6". # #--------------------------------------------------------------------sys_free_string(sv_geo_list) sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) #---------------------------------------------------------------------

fem_disassoc_ids

()

# # Purpose : This file provides an example of a call to the # function fem_disassoc_ids() # # This session file creates a new database by # name new.db. A line is created and is meshed # to create FEM entities associated with the # geometry. This function is then called to # disassociate the specified 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 fem_disassoc_ids() # has the following arguments: # # fem_disassoc_ids # ( option, # fem_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_option STRING sv_fem_list[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements

Main Index

784 PCL Reference Manual Examples Disassociate Action

STRING STRING INTEGER

sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] 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", "[2 2 0]", "[8 2 0]", 0, "", 50., 1, sv_created_ids) dump i_return_value #--------------------------------------------------------------------# Mesh the line to create associated FEM entities i_return_value = @ fem_create_mesh_curv @ ( "Curve 1 ", 1., "Bar2", "1", @ "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Disassociate some elements from the line # i_option = 1 sv_fem_list = "Elem 1:4" i_return_value = fem_disassoc_ids ( i_option, sv_fem_list ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# # For confirming that elements have been disassociated, access the # form given by "Finite Elements", set Action switch to "Show", # Object switch to "Element" and the Method switch to "Attributes". # Give Element List as "Elm 1:6". # #--------------------------------------------------------------------sys_free_string(sv_fem_list) sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 785 Equivalence Action

Equivalence Action This section contains examples of some of the functions used to reduce all of the finite element model nodes that coexist at a point in the model space to a single node. fem_equiv_all_group

()

# # Purpose : This file provides an example of a call to the # function fem_equiv_all_group() # # This session file creates a new database by the # name new.db. Two curves are created and meshed. # This function is then called to reduce all the # nodes that coexist at single points to single # nodes. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_equiv_all_group() # has the following arguments: # # fem_equiv_all_group # ( group_id, # num_groups, # tolerance_type, # tolerance, # updated_tolerance, # segment_id ) # #--------------------------------------------------------------------# Variable Declarations INTEGER ia_group_id(1) INTEGER i_num_groups INTEGER i_tolerance_type REAL r_tolerance REAL r_updated_tolerance INTEGER i_segment_id INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create three points for creating curves i_return_value = asm_const_grid_xyz ( "1", "[0 4 0][5 4 0][3 5 0]", "Coord 0", sv_created_ids) dump i_return_value

@ @ @

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

Main Index

786 PCL Reference Manual Examples Equivalence Action

#

Create the two curves

i_return_value = asm_const_line_2point ( "1", "Point 2 ", "Point 1 ", 0, "", 50., 1, sv_created_ids) dump i_return_value

@ @ @

i_return_value = sgm_const_curve_arc3point ( "2", FALSE, "Point 1 ", "Point 3", "Point 2 ", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Mesh the two curves i_return_value = @ fem_create_mesh_curv @ ( "Curve 1 2", 1., "Bar2", "1", @ "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Equivalence all the nodes # ia_group_id = [0] i_num_groups = 0 i_tolerance_type = 1 r_tolerance = 0.005 i_return_value = fem_equiv_all_group ( ia_group_id, i_num_groups, i_tolerance_type, r_tolerance, r_updated_tolerance, i_segment_id ) dump i_return_value dump r_updated_tolerance dump i_segment_id

@ @ @ @ @ @ @

sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

()

fem_equiv_all_group2 # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_equiv_all_group2() This session file creates a new database by the name new.db. Two curves are created and meshed. This function is then called to reduce all the nodes that coexist at single points to single nodes.

Chapter 4: Finite Element Functions 787 Equivalence Action

# This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_equiv_all_group2() # has the following arguments: # # fem_equiv_all_group2 # ( group_id, # num_groups, # tolerance_type, # tolerance, # verify, # updated_tolerance, # segment_id ) # #--------------------------------------------------------------------# Variable Declarations INTEGER ia_group_id(1) INTEGER i_num_groups INTEGER i_tolerance_type REAL r_tolerance LOGICAL l_verify REAL r_updated_tolerance INTEGER i_segment_id INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create three points for creating curves i_return_value = asm_const_grid_xyz ( "1", "[0 4 0][5 4 0][3 5 0]", "Coord 0", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create the two curves i_return_value = asm_const_line_2point ( "1", "Point 2 ", "Point 1 ", 0, "", 50., 1, sv_created_ids) dump i_return_value

@ @ @

i_return_value = sgm_const_curve_arc3point ( "2", FALSE, "Point 1 ", "Point 3", "Point 2 ", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Mesh the two curves i_return_value = fem_create_mesh_curv ( "Curve 1 2", 1., "Bar2", "1",

Main Index

@ @ @

788 PCL Reference Manual Examples Equivalence Action

"1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Equivalence all the nodes # ia_group_id = [0] i_num_groups = 0 i_tolerance_type = 1 r_tolerance = 0.005 l_verify = TRUE i_return_value = fem_equiv_all_group2 ( ia_group_id, i_num_groups, i_tolerance_type, r_tolerance, l_verify, r_updated_tolerance, i_segment_id ) dump i_return_value dump r_updated_tolerance dump i_segment_id

@ @ @ @ @ @ @ @

sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

()

fem_equiv_all_group3 # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_equiv_all_group3() This session file creates a new database by the name new.db. Two curves are created and meshed. This function is then called to reduce all the nodes that coexist at single points to single nodes. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fem_equiv_all_group3() has the following arguments: fem_equiv_all_group3 ( group_names, num_groups, crg, tolerance_type, tolerance, verify, updated_tolerance, segment_id )

Chapter 4: Finite Element Functions 789 Equivalence Action

#--------------------------------------------------------------------# Variable Declarations STRING sa_group_names[32](0) INTEGER i_num_groups STRING sa_crg INTEGER i_tolerance_type REAL r_tolerance LOGICAL l_verify REAL r_updated_tolerance INTEGER i_segment_id INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create three points for creating curves i_return_value = asm_const_grid_xyz ( "1", "[0 4 0][5 4 0][3 5 0]", "Coord 0", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create the two curves i_return_value = asm_const_line_2point ( "1", "Point 2 ", "Point 1 ", 0, "", 50., 1, sv_created_ids) dump i_return_value

@ @ @

i_return_value = sgm_const_curve_arc3point ( "2", FALSE, "Point 1 ", "Point 3", "Point 2 ", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Mesh the two curves i_return_value = @ fem_create_mesh_curv @ ( "Curve 1 2", 1., "Bar2", "1", @ "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Equivalence all the nodes # sa_group_names = [""] i_num_groups = 0 s_exclude_select = "Node 6 7" i_tolerance_type = 1 r_tolerance = 0.005

Main Index

790 PCL Reference Manual Examples Equivalence Action

l_verify

= TRUE

i_return_value = fem_equiv_all_group3 ( sa_group_names, i_num_groups, s_exclude_select, i_tolerance_type, r_tolerance, l_verify, r_updated_tolerance, i_segment_id ) dump i_return_value dump r_updated_tolerance dump i_segment_id

@ @ @ @ @ @ @ @ @

sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

fem_equiv_list

()

# # Purpose : This file provides an example of a call to the # function fem_equiv_list() # # This session file creates a new database by the # name new.db. Two curves are created and meshed. # This function is then called to reduce all the # selected nodes that coexist at single point to # a single node. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_equiv_list() # has the following arguments: # # fem_equiv_list # ( node_select, # tolerance_type, # tolerance, # updated_tolerance, # segment_id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_node_select[32] INTEGER i_tolerance_type REAL r_tolerance REAL r_updated_tolerance INTEGER i_segment_id INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db")

Main Index

Chapter 4: Finite Element Functions 791 Equivalence Action

$? YES 36000002 #--------------------------------------------------------------------# Create three points for creating curves i_return_value = asm_const_grid_xyz ( "1", "[0 4 0][5 4 0][3 5 0]", "Coord 0", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create the two curves i_return_value = asm_const_line_2point ( "1", "Point 2 ", "Point 1 ", 0, "", 50., 1, sv_created_ids) dump i_return_value

@ @ @

i_return_value = sgm_const_curve_arc3point ( "2", FALSE, "Point 1 ", "Point 3", "Point 2 ", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Mesh the two curves i_return_value = @ fem_create_mesh_curv @ ( "Curve 1 2", 1., "Bar2", "1", @ "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Equivalence the selected nodes # s_node_select = "Node 1:13" i_tolerance_type = 1 r_tolerance = 0.005 i_return_value = fem_equiv_list ( s_node_select, i_tolerance_type, r_tolerance, r_updated_tolerance, i_segment_id ) dump i_return_value dump r_updated_tolerance dump i_segment_id

@ @ @ @ @ @

sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

Main Index

792 PCL Reference Manual Examples Equivalence Action

fem_equiv_list2

()

# # Purpose : This file provides an example of a call to the # function fem_equiv_list2() # # This session file creates a new database by the # name new.db. Two curves are created and meshed. # This function is then called to reduce all the # selected nodes that coexist at single point to # a single node. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_equiv_list2() # has the following arguments: # # fem_equiv_list2 # ( node_select, # tolerance_type, # tolerance, # verify, # updated_tolerance, # segment_id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_node_select[32] INTEGER i_tolerance_type REAL r_tolerance LOGICAL l_verify REAL r_updated_tolerance INTEGER i_segment_id INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create three points for creating curves i_return_value = asm_const_grid_xyz ( "1", "[0 4 0][5 4 0][3 5 0]", "Coord 0", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create the two curves i_return_value = asm_const_line_2point ( "1", "Point 2 ", "Point 1 ", 0, "", 50., 1, sv_created_ids) dump i_return_value

Main Index

@ @ @

Chapter 4: Finite Element Functions 793 Equivalence Action

i_return_value = sgm_const_curve_arc3point ( "2", FALSE, "Point 1 ", "Point 3", "Point 2 ", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Mesh the two curves i_return_value = @ fem_create_mesh_curv @ ( "Curve 1 2", 1., "Bar2", "1", @ "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Equivalence the selected nodes # s_node_select = "Node 1:13" i_tolerance_type = 1 r_tolerance = 0.005 l_verify = TRUE i_return_value = fem_equiv_list2 ( s_node_select, i_tolerance_type, r_tolerance, l_verify, r_updated_tolerance, i_segment_id ) dump i_return_value dump r_updated_tolerance dump i_segment_id

@ @ @ @ @ @ @

sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

()

fem_equiv_list3 # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_equiv_list3() This session file creates a new database by the name new.db. Two curves are created and meshed. This function is then called to reduce all the selected nodes that coexist at single point to a single node. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fem_equiv_list3() has the following arguments:

794 PCL Reference Manual Examples Equivalence Action

# # fem_equiv_list3 # ( node_select, # exclude_select, # tolerance_type, # tolerance, # verify, # updated_tolerance, # segment_id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_node_select[32] STRING s_exclude_select[32] INTEGER i_tolerance_type REAL r_tolerance LOGICAL l_verify REAL r_updated_tolerance INTEGER i_segment_id INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create three points for creating curves i_return_value = asm_const_grid_xyz ( "1", "[0 4 0][5 4 0][3 5 0]", "Coord 0", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create the two curves i_return_value = asm_const_line_2point ( "1", "Point 2 ", "Point 1 ", 0, "", 50., 1, sv_created_ids) dump i_return_value

@ @ @

i_return_value = sgm_const_curve_arc3point ( "2", FALSE, "Point 1 ", "Point 3", "Point 2 ", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Mesh the two curves i_return_value = @ fem_create_mesh_curv @ ( "Curve 1 2", 1., "Bar2", "1", @ "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE )

Main Index

Chapter 4: Finite Element Functions 795 Equivalence Action

#--------------------------------------------------------------------# Equivalence the selected nodes # s_node_select = "Node 1:13" s_exclude_select = "Node 1 13" i_tolerance_type = 1 r_tolerance = 0.005 l_verify = TRUE i_return_value = fem_equiv_list3 ( s_node_select, s_exclude_select, i_tolerance_type, r_tolerance, l_verify, r_updated_tolerance, i_segment_id ) dump i_return_value dump r_updated_tolerance dump i_segment_id

@ @ @ @ @ @ @ @

sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

fem_equiv_list_display.plot

()

# # Purpose : This file provides an example of 2 calls to the # function fem_equiv_list_display.plot() # # This session file creates a new database by the # name new.db. Two curves are created and meshed. # This function is called to save the display and # erase all FEM entities. The function is then # called again to plot only the nodes associated # to free 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 fem_equiv_list_display.plot() # has the following arguments: # # fem_equiv_list_display.plot # ( plot_option, # entity_type, # entity_selection ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_option[9] INTEGER i_entity_type STRING sv_entity_selection[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_return_value

Main Index

796 PCL Reference Manual Examples Equivalence Action

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create three points for creating curves i_return_value = asm_const_grid_xyz ( "1", "[0 4 0][5 4 0][3 5 0]", "Coord 0", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create the two curves i_return_value = asm_const_line_2point ( "1", "Point 2 ", "Point 1 ", 0, "", 50., 1, sv_created_ids) dump i_return_value

@ @ @

i_return_value = sgm_const_curve_arc3point ( "2", FALSE, "Point 1 ", "Point 3", "Point 2 ", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Mesh the two curves i_return_value = @ fem_create_mesh_curv @ ( "Curve 1 2", 1., "Bar2", "1", @ "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Save the display and erase all FEM entities # s_plot_option = "init" i_entity_type = 0 i_return_value = fem_equiv_list_display.plot ( s_plot_option, i_entity_type, sv_entity_selection ) dump i_return_value dump sv_entity_selection

@ @ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Plot nodes associated to free edges

Main Index

Chapter 4: Finite Element Functions 797 Equivalence Action

# s_plot_option = "free_edge" i_entity_type = 1 i_return_value = fem_equiv_list_display.plot ( s_plot_option, i_entity_type, sv_entity_selection ) dump i_return_value dump sv_entity_selection

@ @ @ @

sys_free_string(sv_entity_selection) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

fem_equiv_preview

()

# # Purpose : This file provides an example of a call to the # function fem_equiv_preview() # # This session file creates a new database by the # name new.db. Two curves are created and meshed. # This function is called to preview the effect # of equivalencing the nodes. Nodes are counted # before and after preview to demonstrate that # no actual reduction has taken place. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_equiv_preview() # has the following arguments: # # fem_equiv_preview # ( node_select, # exclude_select, # tolerance_type, # tolerance, # entity_type, # updated_tolerance, # segment_id, # nodes_previewed, # elements_previewed, # nodes_reduced, # elements_reduced ) # #--------------------------------------------------------------------# Variable Declarations STRING s_node_select[32] STRING s_exclude_select[32] INTEGER i_tolerance_type REAL r_tolerance INTEGER i_entity_type REAL r_updated_tolerance INTEGER i_segment_id STRING sv_nodes_previewed[VIRTUAL] STRING sv_elements_previewed[VIRTUAL] STRING sv_nodes_reduced[VIRTUAL] STRING sv_elements_reduced[VIRTUAL]

Main Index

798 PCL Reference Manual Examples Equivalence Action

INTEGER INTEGER INTEGER STRING STRING STRING STRING INTEGER

i_num_nodes i_num_fem_nodes i_num_fem_elements sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] sv_created_ids[VIRTUAL] sv_entity_selection[VIRTUAL] i_return_value

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create three points for creating curves i_return_value = asm_const_grid_xyz ( "1", "[0 4 0][5 4 0][3 5 0]", "Coord 0", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create the two curves i_return_value = asm_const_line_2point ( "1", "Point 2 ", "Point 1 ", 0, "", 50., 1, sv_created_ids) dump i_return_value

@ @ @

i_return_value = sgm_const_curve_arc3point ( "2", FALSE, "Point 1 ", "Point 3", "Point 2 ", sv_created_ids) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Mesh the two curves i_return_value = @ fem_create_mesh_curv @ ( "Curve 1 2", 1., "Bar2", "1", @ "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created) dump i_return_value node_label( TRUE ) bar_elem_label( TRUE ) #--------------------------------------------------------------------# Count the nodes # i_return_value = @ db_count_nodes ( i_num_nodes ) dump i_return_value dump i_num_nodes #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Erase all FEM entities from the viewport # i_return_value = @

Main Index

Chapter 4: Finite Element Functions 799 Equivalence Action

fem_equiv_list_display.plot ( "init", 0, sv_entity_selection ) dump i_return_value

@

#--------------------------------------------------------------------# Preview the effect of equivalencing # s_node_select = "Node 1:13" s_exclude_select = "Node 1 13" i_tolerance_type = 1 r_tolerance = 0.005 i_entity_type = 1 i_return_value = fem_equiv_preview ( s_node_select, s_exclude_select, i_tolerance_type, r_tolerance, i_entity_type, r_updated_tolerance, i_segment_id, sv_nodes_previewed, sv_elements_previewed, sv_nodes_reduced, sv_elements_reduced ) dump i_return_value dump r_updated_tolerance dump i_segment_id dump sv_nodes_previewed dump sv_elements_previewed dump sv_nodes_reduced dump sv_elements_reduced

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

sys_free_string(sv_nodes_previewed) sys_free_string(sv_elements_previewed) sys_free_string(sv_nodes_reduced) sys_free_string(sv_elements_reduced) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) sys_free_string(sv_created_ids) sys_free_string(sv_entity_selection) #--------------------------------------------------------------------# Count the nodes again # i_return_value = @ db_count_nodes ( i_num_nodes ) dump i_return_value dump i_num_nodes #---------------------------------------------------------------------

Main Index

800 PCL Reference Manual Examples Optimize Action

Optimize Action This section contains examples of some of the functions used to optimize entities in a finite element model. fem_optimize

()

# # Purpose : This file provides an example of a call to the # function fem_optimize() # # This session file creates a new database by the # name new.db. A surface is created and meshed. # This function is then called to renumber the # nodes so as to minimize the time required to # find a finite element solution. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_optimize() # has the following arguments: # # fem_optimize # ( object, # method, # criterion, # starting_id, # bandwidth, # profile, # maximum_wavefront, # average_wavefront, # rms_wavefront ) # #--------------------------------------------------------------------# Variable Declarations STRING s_object[8] STRING s_method[32] STRING s_criterion[32] INTEGER i_starting_id INTEGER ia_bandwidth(4) INTEGER ia_profile(4) INTEGER ia_maximum_wavefront(4) REAL ra_average_wavefront(4) REAL ra_rms_wavefront(4) INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] 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 i_return_value =

Main Index

@

Chapter 4: Finite Element Functions 801 Optimize Action

asm_const_patch_xyz ( "1", "<1 1 0>", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the surface i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1", 1, [0.2], @ "Quad4", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created) dump i_return_value node_label( TRUE ) #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Optimize nodes in the model # s_object = "Nodes" s_method = "Both" s_criterion = "RMS Wavefront" i_starting_id = 1 i_return_value = fem_optimize ( s_object, s_method, s_criterion, i_starting_id, ia_bandwidth, ia_profile, ia_maximum_wavefront, ra_average_wavefront, ra_rms_wavefront ) dump i_return_value dump ia_bandwidth dump ia_profile dump ia_maximum_wavefront dump ra_average_wavefront dump ra_rms_wavefront

@ @ @ @ @ @ @ @ @ @

sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

Main Index

802 PCL Reference Manual Examples Verify Action

Verify Action This section contains examples of some of the functions used to verify entities in a finite element model. fem_verify_display

()

# # Purpose : This file provides an example of a call to the # function fem_verify_display() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # A graphic table with Jacobian ratio values is # created. This function is then called to # display the graphic table using a threshold # value to identify failed elements. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_display() # has the following arguments: # # fem_verify_display # ( group_name, # table_id, # best_value, # worst_value, # threshold, # render_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] INTEGER i_table_id REAL r_best_value REAL r_worst_value REAL r_threshold STRING s_render_style[32] REAL r_threshold REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids )

Main Index

Chapter 4: Finite Element Functions 803 Verify Action

dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Create a graphic table having Jacobian ratio values of all elements # i_return_value = @ fem_verify_elem_jacobratio @ ( s_group_name, r_minimum_value, @ i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value #--------------------------------------------------------------------# Display graphic table using a threshold to identify failed elements # r_best_value = r_minimum_value r_worst_value = r_maximum_value r_threshold = 1.12 s_render_style = "ELEMFILL" fem_verify_display ( s_group_name, i_table_id, r_best_value, r_worst_value, r_threshold, s_render_style )

@ @ @ @ @ @

sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

Main Index

804 PCL Reference Manual Examples Verify Action

fem_verify_ids_display

()

# # Purpose : This file provides an example of a call to the # function fem_verify_ids_display() # # This session file creates a new database by the # name new.db. A solid is created and meshed. # A graphic display table with the id values of # all the elements is created. This function is # then called to display the graphic table. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_ids_display() # has the following arguments: # # fem_verify_ids_display # ( group_name, # table_id, # minimum_value, # maximum_value, # render_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] INTEGER i_table_id REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id STRING s_render_style[32] STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol @

Main Index

Chapter 4: Finite Element Functions 805 Verify Action

(

"solid 1", 0.25, "Hex8", @ "", "", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Create a graphic display table with ids of the elements # i_return_value = @ fem_verify_el_ids @ ( s_group_name, r_minimum_value, @ i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value #--------------------------------------------------------------------# Display the graphic table # s_render_style = "ELEMFILL" fem_verify_ids_display ( s_group_name, i_table_id, r_minimum_value, r_maximum_value, s_render_style )

@ @ @ @ @

sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_display.plot

()

# # Purpose : This file provides an example of a call to the # function fem_verify_display.plot() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # A graphic table with aspect ratio values is # created. This function is then called to # display entities that have failed the above # verification procedure. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_display.plot() # has the following arguments: # # fem_verify_display.plot # ( option, # table_id, # threshold, # entities_failed ) # #--------------------------------------------------------------------# Variable Declarations

Main Index

806 PCL Reference Manual Examples Verify Action

STRING INTEGER REAL STRING LOGICAL STRING REAL INTEGER REAL INTEGER STRING INTEGER INTEGER STRING STRING INTEGER

s_option[32] i_table_id r_threshold sv_entities_failed[VIRTUAL] l_normalize s_group_name[32] r_minimum_value i_minimum_id r_maximum_value i_maximum_id sv_created_ids[VIRTUAL] i_num_fem_nodes i_num_fem_elements sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] 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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with aspect ratio values of hexagonal elements # l_normalize = FALSE r_threshold = 1.7

Main Index

Chapter 4: Finite Element Functions 807 Verify Action

i_return_value = @ fem_verify_hex_aspect @ ( l_normalize, r_threshold, s_group_name, @ r_minimum_value, i_minimum_id, @ r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value #--------------------------------------------------------------------# Display entities that have failed the above verification procedure # s_option = "plot_failed" i_return_value = fem_verify_display.plot ( s_option, i_table_id, r_threshold, sv_entities_failed ) dump i_return_value dump sv_entities_failed sys_free_string( sys_free_string( sys_free_string( sys_free_string(

@ @ @ @ @

sv_created_ids) sv_fem_nodes_created) sv_fem_elements_created) sv_entities_failed)

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

fem_verify_draw_normal_vectors

()

# # Purpose : This file provides an example of a call to the # function fem_verify_draw_normal_vectors() # # This session file creates a new database by the # name new.db. A solid is created and one of its # surfaces is meshed. This function is then # called to draw normal vectors for all elements. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_draw_normal_vectors() # has the following arguments: # # fem_verify_draw_normal_vectors # ( segment_id ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_segment_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #---------------------------------------------------------------------

Main Index

808 PCL Reference Manual Examples Verify Action

# Create a solid # i_return_value = @ asm_const_hpat_xyz @ ( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Mesh one surface of the solid # i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Solid 1.3 ", 1, [0.25], @ "Quad4", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Draw normal vectors on all surface elements # i_return_value = @ gm_segment_create @ ( i_segment_id ) dump i_return_value i_return_value = fem_verify_draw_normal_vectors ( i_segment_id ) dump i_return_value

@ @

sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) #---------------------------------------------------------------------

()

fem_verify_el_ids # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_verify_el_ids() This session file creates a new database by the name new.db. A solid is created and meshed. This function is called to create a graphic display table with the id values of all the elements. Graphic table is finally displayed. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fem_verify_el_ids() has the following arguments: fem_verify_el_ids ( group_name, minimum_value, minimum_id, maximum_value, maximum_id,

Chapter 4: Finite Element Functions 809 Verify Action

# table_id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] INTEGER i_table_id REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id STRING s_render_style[32] STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol @ ( "solid 1", 0.25, "Hex8", @ "", "", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Create a graphic display table with ids of the elements # i_return_value = @ fem_verify_el_ids @ ( s_group_name, @ r_minimum_value, @ i_minimum_id, @ r_maximum_value, @ i_maximum_id, @ i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

Main Index

810 PCL Reference Manual Examples Verify Action

#--------------------------------------------------------------------# Display the graphic table # fem_verify_ids_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, "ELEMFILL" ) sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_elem_conect

()

# # Purpose : This file provides an example of a call to the # function fem_verify_elem_conect() # # This session file creates a new database by the # name new.db. A solid is created and meshed. # Connectivity of two elements is reversed. This # function is then called to test all the solid # elements for proper connectivity. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_elem_conect() # has the following arguments: # # fem_verify_elem_conect # ( reverse, # entities_failed ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_reverse STRING sv_entities_failed[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] STRING sv_elements_reversed[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_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( -67., 0., -34.) dump i_return_value

Main Index

@

Chapter 4: Finite Element Functions 811 Verify Action

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol @ ( "solid 1", 0.5, "Hex8", @ "", "", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value hex_elem_label( TRUE) #--------------------------------------------------------------------# Reverse the connectivity of two elements # i_return_value = @ fem_mod_elem_reverse @ ( "Elm 1 2", sv_elements_reversed ) dump i_return_value dump sv_elements_reversed #--------------------------------------------------------------------# Test solid elements for connectivity # l_reverse = FALSE i_return_value = fem_verify_elem_conect ( l_reverse, sv_entities_failed ) dump i_return_value dump sv_entities_failed

@ @ @

sys_free_string(sv_entities_failed) sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) sys_free_string(sv_elements_reversed) #---------------------------------------------------------------------

()

fem_verify_elem_jacobratio # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_verify_elem_jacobratio() This session file creates a new database by the name new.db. A solid is created and is meshed after creating mesh seeds on two of its edges. This function is then called to create graphic table with Jacobian ratio values for all elements. Created graphic table is displayed. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fem_verify_elem_jacobratio() has the following arguments: fem_verify_elem_jacobratio ( group_name,

812 PCL Reference Manual Examples Verify Action

# minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Create a graphic table having Jacobian ratio values of all elements

Main Index

Chapter 4: Finite Element Functions 813 Verify Action

# i_return_value = fem_verify_elem_jacobratio ( s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the created graphic table # fem_verify_ids_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

Main Index

814 PCL Reference Manual Examples Verify Action

fem_verify_elem_jacobzero

()

# # Purpose : This file provides an example of a call to the # function fem_verify_elem_jacobzero() # # This session file creates a new database by the # name new.db. A solid is created and is meshed # after creating mesh seeds on two of its edges. # This function is then called to create graphic # table with Jacobian zero values for all the # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_elem_jacobzero() # has the following arguments: # # fem_verify_elem_jacobzero # ( group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @

Main Index

Chapter 4: Finite Element Functions 815 Verify Action

mesh_seed_create ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value

@

i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Create a graphic table having Jacobian zero values of all elements # i_return_value = @ fem_verify_elem_jacobzero @ ( s_group_name, @ r_minimum_value, @ i_minimum_id, @ r_maximum_value, @ i_maximum_id, @ i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id #--------------------------------------------------------------------# Display the created graphic table # fem_verify_ids_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_element_duplicates # # # # # # # #

Main Index

Purpose

:

()

This file provides an example of a call to the function fem_verify_element_duplicates() This session file creates a new database by the name new.db. A surface is created and meshed. Two duplicate elements are created. This function is then called to check for duplicate

816 PCL Reference Manual Examples Verify Action

# elements in the entire 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 fem_verify_element_duplicates() # has the following arguments: # # fem_verify_element_duplicates # ( delete_elements, # delete_high, # num_duplicates, # kept_elements, # deleted_elements ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_delete_elements LOGICAL l_delete_high INTEGER i_num_duplicates STRING sv_kept_elements[VIRTUAL] STRING sv_deleted_elements[VIRTUAL] STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] STRING s_fem_elements_created[32] 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_created_ids ) dump i_return_value #--------------------------------------------------------------------# Mesh the surface # i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1", 1, [0.25], @ "Quad4", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value node_label( TRUE ) quad_elem_label( TRUE ) #--------------------------------------------------------------------# Create two duplicate elements # i_return_value = @ fem_create_elems @ ( "Quad", "Quad4", "17", "Standard", TRUE,@ "Node 1 12", "Node 2 13", "Node 7 18", @ "Node 6 17", "", "", "", "", s_fem_elements_created ) dump i_return_value

Main Index

Chapter 4: Finite Element Functions 817 Verify Action

dump s_fem_elements_created #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Display all duplicate elements without deleting them # l_delete_elements = FALSE l_delete_high = TRUE i_return_value = fem_verify_element_duplicates ( l_delete_elements, l_delete_high, i_num_duplicates, sv_kept_elements, sv_deleted_elements ) dump i_return_value dump i_num_duplicates dump sv_kept_elements dump sv_deleted_elements

@ @ @ @ @ @

sys_free_string(sv_kept_elements) sys_free_string(sv_deleted_elements) sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_element_normals

()

# # Purpose : This file provides an example of a call to the # function fem_verify_element_normals() # # This session file creates a new database by the # name new.db. A solid is created and three of # its surfaces are meshed. Nodes are equivalenced # and normal vectors are drawn for all elements. # This function is then called to flip direction # of the normal vectors to match that of guiding # elements. Normal vectors are then drawn 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 fem_verify_element_normals() # has the following arguments: # # fem_verify_element_normals # ( reverse_elements, # color_code, # guide_element, # group_name, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_reverse_elements LOGICAL l_color_code STRING s_guide_element[32]

Main Index

818 PCL Reference Manual Examples Verify Action

STRING INTEGER STRING INTEGER INTEGER STRING STRING REAL INTEGER INTEGER

s_group_name[32] i_table_id sv_created_ids[VIRTUAL] i_num_fem_nodes i_num_fem_elements sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] r_updated_tolerance i_segment_id 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_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Mesh three surfaces of the solid # i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Solid 1.1 1.2 1.3", @ 1, [0.25], "Quad4", "1", "1", @ "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Equivalence all the nodes # i_return_value = @ fem_equiv_all_group @ ( [0], 0, 1, 0.005, r_updated_tolerance, i_segment_id ) dump i_return_value #--------------------------------------------------------------------# Draw normal vectors on all surface elements # i_return_value = @ gm_segment_create @ ( i_segment_id ) dump i_return_value i_return_value = fem_verify_draw_normal_vectors ( i_segment_id ) dump i_return_value

@ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Verify direction of the normal vectors for all shell elements #

Main Index

Chapter 4: Finite Element Functions 819 Verify Action

l_reverse_elements = TRUE l_color_code = TRUE s_guide_element = "Elem 20" i_return_value = fem_verify_element_normals ( l_reverse_elements, l_color_code, s_guide_element, s_group_name, i_table_id ) dump i_return_value dump s_group_name dump i_table_id

@ @ @ @ @ @

#--------------------------------------------------------------------# Reset the graphics and draw normal vectors again # i_return_value = @ gm_segment_delete @ ( i_segment_id ) dump i_return_value i_return_value = gm_segment_create ( i_segment_id ) dump i_return_value

@ @

i_return_value = fem_verify_draw_normal_vectors ( i_segment_id ) dump i_return_value

@ @

sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

()

fem_verify_get_graphset # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_verify_get_graphset() This session file creates a new database by the name new.db. A solid is created and is meshed. An element verification procedure is carried out and created graphic table is displayed. This function is called before displaying to retrieve graphic display settings. Graphic parameters are reset after display using the retrieved graphic display settings. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fem_verify_get_graphset() has the following arguments: fem_verify_get_graphset ( display_method, group_name, render_style,

820 PCL Reference Manual Examples Verify Action

# viewport_name, # spectrum_setting ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_display_method INTEGER i_spectrum_setting STRING s_render_style[32] STRING s_group_name[32] STRING s_viewport_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Retrieve the graphics display settings for restoring later # i_return_value = @ fem_verify_get_graphset @

Main Index

Chapter 4: Finite Element Functions 821 Verify Action

(

dump dump dump dump dump dump

i_display_method, s_group_name, s_render_style, s_viewport_name, i_spectrum_setting ) i_return_value i_display_method s_group_name s_render_style s_viewport_name i_spectrum_setting

@ @ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Create a graphic table having Jacobian ratio values of all elements # i_return_value = @ fem_verify_elem_jacobratio @ ( s_group_name, r_minimum_value, @ i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value #--------------------------------------------------------------------# Display the created graphic table # fem_verify_ids_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, "ELEMFILL") #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Reset graphic parameters using retrieved graphics display settings # i_return_value = @ fem_verify_reset_graphics @ ( s_render_style, s_group_name, @ i_spectrum_setting, s_viewport_name ) dump i_return_value sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

()

fem_verify_hex_all # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_verify_hex_all() This session file creates a new database by the name new.db. A solid is created and is meshed. This function is then called to run all the verification tests for all hexagonal elements. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

822 PCL Reference Manual Examples Verify Action

# # The function fem_verify_hex_all() # has the following arguments: # # fem_verify_hex_all # ( threshold, # num_failures, # worst_value, # worst_id ) # #--------------------------------------------------------------------# Variable Declarations REAL ra_threshold(10) INTEGER ia_num_failures(10) REAL ra_worst_value(10) INTEGER ia_worst_id(10) STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause()

Main Index

Chapter 4: Finite Element Functions 823 Verify Action

#--------------------------------------------------------------------# Run all the verification tests for all hexagonal elements # ra_threshold = [ 1.5, 30., 30., 5., 5., 0.8, 0.2, 0.2, 0., 0.] i_return_value = fem_verify_hex_all ( ra_threshold, ia_num_failures, ra_worst_value, ia_worst_id ) dump i_return_value dump ia_num_failures dump ra_worst_value dump ia_worst_id

@ @ @ @ @

sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_hex_aspect

()

# # Purpose : This file provides an example of a call to the # function fem_verify_hex_aspect() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to load a graphic # table with aspect ratio values of all hexagonal # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_hex_aspect() # has the following arguments: # # fem_verify_hex_aspect # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL]

Main Index

824 PCL Reference Manual Examples Verify Action

STRING INTEGER

sv_fem_elements_created[VIRTUAL] 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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with aspect ratio values of hexagonal elements # l_normalize = FALSE r_threshold = 1.5 i_return_value = fem_verify_hex_aspect ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id

Main Index

@ @ @ @ @ @ @ @ @

Chapter 4: Finite Element Functions 825 Verify Action

dump r_maximum_value dump i_maximum_id dump i_table_id #--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_hex_edangle

()

# # Purpose : This file provides an example of a call to the # function fem_verify_hex_edangle() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to load a graphic # table with edge angle values of all hexagonal # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_hex_edangle() # has the following arguments: # # fem_verify_hex_edangle # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] INTEGER i_return_value #---------------------------------------------------------------------

Main Index

826 PCL Reference Manual Examples Verify Action

# 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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with edge angle values of hexagonal elements # l_normalize = FALSE r_threshold = 30. i_return_value = fem_verify_hex_edangle ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

Main Index

@ @ @ @ @ @ @ @ @

Chapter 4: Finite Element Functions 827 Verify Action

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_hex_fskew

()

# # Purpose : This file provides an example of a call to the # function fem_verify_hex_fskew() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to load a graphic # table with face skew values of all hexagonal # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_hex_fskew() # has the following arguments: # # fem_verify_hex_fskew # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #---------------------------------------------------------------------

Main Index

828 PCL Reference Manual Examples Verify Action

# Create a solid # i_return_value = @ asm_const_hpat_xyz @ ( "1", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with face skew values of hexagonal elements # l_normalize = FALSE r_threshold = 30. i_return_value = fem_verify_hex_fskew ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @

Main Index

Chapter 4: Finite Element Functions 829 Verify Action

r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_hex_ftaper

()

# # Purpose : This file provides an example of a call to the # function fem_verify_hex_ftaper() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to load a graphic # table with face taper values of all hexagonal # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_hex_ftaper() # has the following arguments: # # fem_verify_hex_ftaper # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids )

Main Index

830 PCL Reference Manual Examples Verify Action

dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with face taper values of hexagonal elements # l_normalize = FALSE r_threshold = 0.8 i_return_value = fem_verify_hex_ftaper ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_maximum_value, @ r_minimum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created)

Main Index

Chapter 4: Finite Element Functions 831 Verify Action

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

fem_verify_hex_fwarp

()

# # Purpose : This file provides an example of a call to the # function fem_verify_hex_fwarp() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to load a graphic # table with face warp values of all hexagonal # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_hex_fwarp() # has the following arguments: # # fem_verify_hex_fwarp # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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_created_ids) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

Main Index

@

832 PCL Reference Manual Examples Verify Action

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.2.2", 3, 4, 2., 0., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.2.4", 3, 4, 0.5, 0., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [0.2], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with face warp values of hexagonal elements # l_normalize = FALSE r_threshold = 1.2 i_return_value = fem_verify_hex_fwarp ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 833 Verify Action

fem_verify_hex_twist

()

# # Purpose : This file provides an example of a call to the # function fem_verify_hex_twist() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to load a graphic # table with the twist values of all hexagonal # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_hex_twist() # has the following arguments: # # fem_verify_hex_twist # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

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

Main Index

834 PCL Reference Manual Examples Verify Action

# Create mesh seeds on two edges of the solid # i_return_value = mesh_seed_create ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with the twist values of hexagonal elements # l_normalize = FALSE r_threshold = 5. i_return_value = fem_verify_hex_twist ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 835 Verify Action

fem_verify_midnode_normoff

()

# # Purpose : This file provides an example of a call to the # function fem_verify_midnode_normoff() # # This session file creates a new database by the # name new.db. Two curves and a mesh between the # two curves is created. This function is then # called to load a graphic table with the midnode # normal offset values of all the elements. # Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_midnode_normoff() # has the following arguments: # # fem_verify_midnode_normoff # ( threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create two curves # i_return_value = @ sgm_const_curve_arc3point @ ( "1", FALSE, "[0 0 0]", "[4 10 0]", @ "[0 20 0]", sv_created_ids ) dump i_return_value i_return_value = asm_const_line_2point ( "2", "[-20 0 0]", "[-5 20 0]", 0, "", 50., 1, sv_created_ids ) dump i_return_value

Main Index

@ @ @

836 PCL Reference Manual Examples Verify Action

#--------------------------------------------------------------------# Create a mesh between the two curves # i_return_value = @ fem_create_mesh_2curve @ ( "Curve 1", "Curve 2", 2, 3., 2, 2, @ "Quad8", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load graphic table with midnode normal offset values of elements # r_threshold = 0.05 i_return_value = fem_verify_midnode_normoff ( r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

()

fem_verify_midnode_tanoff # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_verify_midnode_tanoff() This session file creates a new database by the name new.db. Two curves and a mesh between the two curves is created. This function is then called to load a graphic table with the midnode tangent offset values of all the elements. Created graphic table is displayed. This file can be run by starting a session of Patran, and running this session file

Chapter 4: Finite Element Functions 837 Verify Action

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_midnode_tanoff() # has the following arguments: # # fem_verify_midnode_tanoff # ( threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create two curves # i_return_value = @ sgm_const_curve_arc3point @ ( "1", FALSE, "[0 0 0]", "[4 10 0]", @ "[0 20 0]", sv_created_ids ) dump i_return_value i_return_value = asm_const_line_2point ( "2", "[-30 0 0]", "[-5 20 0]", 0, "", 50., 1, sv_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create a mesh between the two curves # i_return_value = @ fem_create_mesh_2curve @ ( "Curve 1", "Curve 2", 2, 3., 2, 2, @ "Quad8", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load graphic table with midnode tangent offset values of elements

Main Index

838 PCL Reference Manual Examples Verify Action

# r_threshold

= 0.002

i_return_value = fem_verify_midnode_tanoff ( r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_node_ids

()

# # Purpose : This file provides an example of a call to the # function fem_verify_node_ids() # # This session file creates a new database by the # name new.db. A surface is created and meshed. # This function is then called to load a graphic # table with values of all nodes as scalar result # values. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_node_ids() # has the following arguments: # # fem_verify_node_ids # ( group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id

Main Index

Chapter 4: Finite Element Functions 839 Verify Action

REAL INTEGER INTEGER STRING INTEGER INTEGER STRING STRING INTEGER

r_maximum_value i_maximum_id i_table_id sv_created_ids[VIRTUAL] i_num_fem_nodes i_num_fem_elements sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] 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_created_ids) dump i_return_value #--------------------------------------------------------------------# Mesh the surface # i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.2], @ "Quad4", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load the graphic table with the id values of all the nodes # i_return_value = @ fem_verify_node_ids @ ( s_group_name, @ r_minimum_value, @ i_minimum_id, @ r_maximum_value, @ i_maximum_id, @ i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id #--------------------------------------------------------------------# Display the graphic table # fem_verify_ids_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, "FRINGE" ) sys_free_string(sv_created_ids) sys_free_string(sv_fem_nodes_created) sys_free_string(sv_fem_elements_created)

Main Index

840 PCL Reference Manual Examples Verify Action

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

fem_verify_quad_all

()

# # Purpose : This file provides an example of a call to the # function fem_verify_quad_all() # # This session file creates a new database by the # name new.db. A surface is created and meshed. # This function is then called to run all the # verification tests for all quadrilateral # elements. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_quad_all() # has the following arguments: # # fem_verify_quad_all # ( threshold, # num_failures, # worst_value, # worst_id ) # #--------------------------------------------------------------------# Variable Declarations REAL ra_threshold(8) INTEGER ia_num_failures(8) REAL ra_worst_value(8) INTEGER ia_worst_id(8) STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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 = @ sgm_const_surface_vertex @ ( "1", "[0 0 2]", "[0 5 2]", "[5 0 0]", @ "[5 2 5]", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( -140., -30., 25. ) dump i_return_value

@

#--------------------------------------------------------------------# Mesh the surface # i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.8], @ "Quad4", "1", "1", "Coord 0", "Coord 0",@

Main Index

Chapter 4: Finite Element Functions 841 Verify Action

i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Run all the verification tests for all quadrilateral elements # ra_threshold = [ 1.5, 7., 30., 0.92, 0.2, 0.2, 0., 0.] i_return_value = fem_verify_quad_all ( ra_threshold, ia_num_failures, ra_worst_value, ia_worst_id ) dump i_return_value dump ia_num_failures dump ra_worst_value dump ia_worst_id

@ @ @ @ @

sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_quad_aspect

()

# # Purpose : This file provides an example of a call to the # function fem_verify_quad_aspect() # # This session file creates a new database by the # name new.db. A surface is created and meshed. # This function is then called to load a graphic # table with aspect ratio values of quadrilateral # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_quad_aspect() # has the following arguments: # # fem_verify_quad_aspect # ( normalize, # threshold, # split, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # created_elements, # created_nodes, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize

Main Index

842 PCL Reference Manual Examples Verify Action

REAL LOGICAL STRING REAL INTEGER REAL INTEGER STRING STRING INTEGER STRING INTEGER INTEGER STRING STRING INTEGER

r_threshold l_split s_group_name[32] r_minimum_value i_minimum_id r_maximum_value i_maximum_id sv_created_elements[VIRTUAL] sv_created_nodes[VIRTUAL] i_table_id sv_created_ids[VIRTUAL] i_num_fem_nodes i_num_fem_elements sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] 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_surface_vertex @ ( "1", "[0 0 2]", "[0 5 2]", "[5 0 0]", @ "[5 2 5]", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( -140., -30., 25. ) dump i_return_value

@

#--------------------------------------------------------------------# Mesh the surface # i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.8], @ "Quad4", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with aspect ratios of quadrilateral elements # l_normalize = FALSE r_threshold = 1.75 l_split = TRUE i_return_value = fem_verify_quad_aspect ( l_normalize, r_threshold, l_split, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, sv_created_elements,

Main Index

@ @ @ @ @ @ @ @ @ @ @

Chapter 4: Finite Element Functions 843 Verify Action

dump dump dump dump dump dump dump dump dump

sv_created_nodes, i_table_id ) i_return_value s_group_name r_minimum_value i_minimum_id r_maximum_value i_maximum_id sv_created_elements sv_created_nodes i_table_id

@

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string(sv_created_elements) sys_free_string(sv_created_nodes) sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_quad_skew

()

# # Purpose : This file provides an example of a call to the # function fem_verify_quad_skew() # # This session file creates a new database by the # name new.db. A surface is created and meshed. # This function is then called to load a graphic # table with skew angle values of quadrilateral # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_quad_skew() # has the following arguments: # # fem_verify_quad_skew # ( normalize, # threshold, # split, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # created_elements, # created_nodes, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold LOGICAL l_split STRING s_group_name[32]

Main Index

844 PCL Reference Manual Examples Verify Action

REAL INTEGER REAL INTEGER STRING STRING INTEGER STRING INTEGER INTEGER STRING STRING INTEGER

r_minimum_value i_minimum_id r_maximum_value i_maximum_id sv_created_elements[VIRTUAL] sv_created_nodes[VIRTUAL] i_table_id sv_created_ids[VIRTUAL] i_num_fem_nodes i_num_fem_elements sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] 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_surface_vertex @ ( "1", "[0 0 2]", "[0 5 2]", "[5 0 0]", @ "[5 2 5]", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( -140., -30., 25. ) dump i_return_value

@

#--------------------------------------------------------------------# Mesh the surface # i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.8], @ "Quad4", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load graphic table with skew angle values of quadrilateral elements # l_normalize = FALSE r_threshold = 35. l_split = TRUE i_return_value = fem_verify_quad_skew ( l_normalize, r_threshold, l_split, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, sv_created_elements, sv_created_nodes, i_table_id ) dump i_return_value

Main Index

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

Chapter 4: Finite Element Functions 845 Verify Action

dump dump dump dump dump dump dump dump

s_group_name r_minimum_value i_minimum_id r_maximum_value i_maximum_id sv_created_elements sv_created_nodes i_table_id

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string(sv_created_elements) sys_free_string(sv_created_nodes) sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_quad_taper

()

# # Purpose : This file provides an example of a call to the # function fem_verify_quad_taper() # # This session file creates a new database by the # name new.db. A surface is created and meshed. # This function is then called to load a graphic # table with taper angle values of quadrilateral # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_quad_taper() # has the following arguments: # # fem_verify_quad_taper # ( normalize, # threshold, # split, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # created_elements, # created_nodes, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold LOGICAL l_split STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value

Main Index

846 PCL Reference Manual Examples Verify Action

INTEGER STRING STRING INTEGER STRING INTEGER INTEGER STRING STRING INTEGER

i_maximum_id sv_created_elements[VIRTUAL] sv_created_nodes[VIRTUAL] i_table_id sv_created_ids[VIRTUAL] i_num_fem_nodes i_num_fem_elements sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] 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_surface_vertex @ ( "1", "[0 0 2]", "[0 5 2]", "[5 0 0]", @ "[5 2 5]", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( -140., -30., 25. ) dump i_return_value

@

#--------------------------------------------------------------------# Mesh the surface # i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.8], @ "Quad4", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load graphic table with taper angle value of quadrilateral elements # l_normalize = FALSE r_threshold = 0.917 l_split = TRUE i_return_value = fem_verify_quad_taper ( l_normalize, r_threshold, l_split, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, sv_created_elements, sv_created_nodes, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id

Main Index

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

Chapter 4: Finite Element Functions 847 Verify Action

dump dump dump dump dump

r_maximum_value i_maximum_id sv_created_elements sv_created_nodes i_table_id

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_maximum_value, @ r_minimum_value, r_threshold, "ELEMFILL") sys_free_string(sv_created_elements) sys_free_string(sv_created_nodes) sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_quad_warp

()

# # Purpose : This file provides an example of a call to the # function fem_verify_quad_warp() # # This session file creates a new database by the # name new.db. A surface is created and meshed. # This function is then called to load a graphic # table with warp angle values of quadrilateral # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_quad_warp() # has the following arguments: # # fem_verify_quad_warp # ( normalize, # threshold, # split, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # created_elements, # created_nodes, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold LOGICAL l_split STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id STRING sv_created_elements[VIRTUAL] STRING sv_created_nodes[VIRTUAL]

Main Index

848 PCL Reference Manual Examples Verify Action

INTEGER STRING INTEGER INTEGER STRING STRING INTEGER

i_table_id sv_created_ids[VIRTUAL] i_num_fem_nodes i_num_fem_elements sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] 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_surface_vertex @ ( "1", "[0 0 2]", "[0 5 2]", "[5 0 0]", @ "[5 2 5]", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( -140., -30., 25. ) dump i_return_value

@

#--------------------------------------------------------------------# Mesh the surface # i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.8], @ "Quad4", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load graphic table with warp angle values of quadrilateral elements # l_normalize = FALSE r_threshold = 9.2 l_split = TRUE i_return_value = fem_verify_quad_warp ( l_normalize, r_threshold, l_split, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, sv_created_elements, sv_created_nodes, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump sv_created_elements

Main Index

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

Chapter 4: Finite Element Functions 849 Verify Action

dump sv_created_nodes dump i_table_id #--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string(sv_created_elements) sys_free_string(sv_created_nodes) sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_reset_graphics

()

# # Purpose : This file provides an example of a call to the # function fem_verify_reset_graphics() # # This session file creates a new database by the # name new.db. A solid is created and is meshed # An element verification procedure is carried # out and created graphic table is displayed. # Graphic display settings are retrieved before # displaying. This function is then called to # reset graphic parameters in the viewport using # the retrieved settings. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_reset_graphics() # has the following arguments: # # fem_verify_reset_graphics # ( render_style, # group_name, # spectrum_set, # viewport_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_render_style[32] STRING s_group_name[32] INTEGER i_spectrum_set STRING s_viewport_name[32] INTEGER i_display_method REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] INTEGER i_return_value

Main Index

850 PCL Reference Manual Examples Verify Action

#--------------------------------------------------------------------# 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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Retrieve the graphics display settings for restoring later # i_return_value = @ fem_verify_get_graphset @ ( i_display_method, s_group_name, @ s_render_style, s_viewport_name, i_spectrum_set ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Create a graphic table having Jacobian ratio values of all elements # i_return_value = @ fem_verify_elem_jacobratio @ ( s_group_name, r_minimum_value, @ i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value #--------------------------------------------------------------------# Display the created graphic table # fem_verify_ids_display @ ( s_group_name, i_table_id, r_minimum_value, @

Main Index

Chapter 4: Finite Element Functions 851 Verify Action

r_maximum_value, "ELEMFILL") #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Reset graphic parameters using retrieved graphics display settings # i_return_value = @ fem_verify_reset_graphics @ ( s_render_style, @ s_group_name, @ i_spectrum_set, @ s_viewport_name ) dump i_return_value sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_tet_all

()

# # Purpose : This file provides an example of a call to the # function fem_verify_tet_all() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to run all the # verification tests for all tetrahedral elements # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_tet_all() # has the following arguments: # # fem_verify_tet_all # ( threshold, # num_failures, # worst_value, # worst_id ) # #--------------------------------------------------------------------# Variable Declarations REAL ra_threshold(8) INTEGER ia_num_failures(8) REAL ra_worst_value(8) INTEGER ia_worst_id(8) STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

852 PCL Reference Manual Examples Verify Action

#--------------------------------------------------------------------# Create a solid # i_return_value = @ asm_const_hpat_xyz @ ( "1", "<3 3 3>", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 1, 2, 0., 0., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 1, 4, 0., 0., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [1.], @ "Tet4", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Run all the verification tests for all tetrahedral elements # ra_threshold = [ 1.8, 60., 60., 0.3, 0.2, 0.2, 0., 0.] i_return_value = fem_verify_tet_all ( ra_threshold, ia_num_failures, ra_worst_value, ia_worst_id ) dump i_return_value dump ia_num_failures dump ra_worst_value dump ia_worst_id

@ @ @ @ @

sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

()

fem_verify_tet_aspect # #

Main Index

Purpose

:

This file provides an example of a call to the

Chapter 4: Finite Element Functions 853 Verify Action

# function fem_verify_tet_aspect() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to load a graphic # table with aspect ratio values of tetrahedral # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_tet_aspect() # has the following arguments: # # fem_verify_tet_aspect # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<3 3 3>", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 1, 2, 0., 0., 0.) dump i_return_value

Main Index

854 PCL Reference Manual Examples Verify Action

i_return_value = mesh_seed_create ( "Solid 1.4.4", 1, 4, 0., 0., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [1.], @ "Tet4", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load graphic table with aspect ratio values of tetrahedral elements # l_normalize = FALSE r_threshold = 1.8 i_return_value = fem_verify_tet_aspect ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

()

fem_verify_tet_collapse # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_verify_tet_collapse() This session file creates a new database by the name new.db. A solid is created and is meshed. This function is then called to load a graphic

Chapter 4: Finite Element Functions 855 Verify Action

# table with collapse values of all tetrahedral # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_tet_collapse() # has the following arguments: # # fem_verify_tet_collapse # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<3 3 3>", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value i_return_value = ga_view_aa_set( -67., 0., -34.) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 1, 2, 0., 0., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 1, 4, 0., 0., 0.) dump i_return_value

Main Index

@ @

856 PCL Reference Manual Examples Verify Action

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [1.], @ "Tet4", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load graphic table with collapse values of all tetrahedral elements # l_normalize = FALSE r_threshold = 0.3 i_return_value = fem_verify_tet_collapse ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_maximum_value, @ r_minimum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

()

fem_verify_tet_edangle # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_verify_tet_edangle() This session file creates a new name new.db. A solid is created This function is then called to table with edge angle values of elements. Created graphic table

database by the and is meshed. load a graphic all tetrahedral is displayed.

This file can be run by starting a session of Patran, and running this session file

Chapter 4: Finite Element Functions 857 Verify Action

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_tet_edangle() # has the following arguments: # # fem_verify_tet_edangle # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<3 3 3>", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value i_return_value = ga_view_aa_set( -150., -50., 0.) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 1, 2, 0., 0., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 1, 4, 0., 0., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @

Main Index

858 PCL Reference Manual Examples Verify Action

(

"IsoMesh", 0, "Solid 1 ", 1, [1.], @ "Tet4", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with edge angle values of tetrahedral elements # l_normalize = FALSE r_threshold = 60. i_return_value = fem_verify_tet_edangle ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

()

fem_verify_tet_fskew # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_verify_tet_fskew() This session file creates a new database by the name new.db. A solid is created and is meshed. This function is then called to load a graphic table with face skew values of all tetrahedral elements. Created graphic table is displayed. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fem_verify_tet_fskew() has the following arguments:

Chapter 4: Finite Element Functions 859 Verify Action

# # fem_verify_tet_fskew # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<3 3 3>", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value i_return_value = ga_view_aa_set( -67., 0., -34.) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 1, 2, 0., 0., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 1, 4, 0., 0., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [1.], @ "Tet4", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value

Main Index

860 PCL Reference Manual Examples Verify Action

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with face skew values of tetrahedral elements # l_normalize = FALSE r_threshold = 60. i_return_value = fem_verify_tet_fskew ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

()

fem_verify_tria_all # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_verify_tria_all() This session file creates a new database by the name new.db. A surface is created and meshed. This function is then called to run all the verification tests for all triangular elements This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fem_verify_tria_all() has the following arguments: fem_verify_tria_all ( threshold, num_failures, worst_value, worst_id )

Chapter 4: Finite Element Functions 861 Verify Action

# #--------------------------------------------------------------------# Variable Declarations REAL ra_threshold(6) INTEGER ia_num_failures(6) REAL ra_worst_value(6) INTEGER ia_worst_id(6) INTEGER i_return_value STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<3 3 0>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create mesh seeds on two edges of the surface # i_return_value = @ mesh_seed_create @ ( "Surface 1.1", 1, 5, 0., 0., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Surface 1.3", 1, 7, 0., 0., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the surface # i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Tria3", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Run all the verification tests for all triangular elements # ra_threshold = [ 2.5, 42.88, 0.2, 0.2, 0., 0.] i_return_value = fem_verify_tria_all ( ra_threshold, ia_num_failures, ra_worst_value, ia_worst_id ) dump i_return_value

Main Index

@ @ @ @ @

862 PCL Reference Manual Examples Verify Action

dump ia_num_failures dump ra_worst_value dump ia_worst_id sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_tria_aspect

()

# # Purpose : This file provides an example of a call to the # function fem_verify_tria_aspect() # # This session file creates a new database by the # name new.db. A surface is created and meshed. # This function is then called to load a graphic # table with aspect ratio values of triangular # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_tria_aspect() # has the following arguments: # # fem_verify_tria_aspect # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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 = @

Main Index

Chapter 4: Finite Element Functions 863 Verify Action

asm_const_patch_xyz @ ( "1", "<3 3 0>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create mesh seeds on two edges of the surface # i_return_value = @ mesh_seed_create @ ( "Surface 1.1", 1, 5, 0., 0., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Surface 1.3", 1, 7, 0., 0., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the surface # i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Tria3", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with aspect ratios of all triangular elements # l_normalize = FALSE r_threshold = 2.5 i_return_value = fem_verify_tria_aspect ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

Main Index

864 PCL Reference Manual Examples Verify Action

fem_verify_tria_skew

()

# # Purpose : This file provides an example of a call to the # function fem_verify_tria_skew() # # This session file creates a new database by the # name new.db. A surface is created and meshed. # This function is then called to load a graphic # table with skew angle values of all triangular # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_tria_skew() # has the following arguments: # # fem_verify_tria_skew # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<3 3 0>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create mesh seeds on two edges of the surface # i_return_value = @ mesh_seed_create @

Main Index

Chapter 4: Finite Element Functions 865 Verify Action

( "Surface 1.1", 1, 5, 0., 0., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Surface 1.3", 1, 7, 0., 0., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the surface # i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Tria3", "1", "1", "Coord 0", "Coord 0",@ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with skew angle values of triangular elements # l_normalize = FALSE r_threshold = 42.88 i_return_value = fem_verify_tria_skew ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

()

fem_verify_wedge_all # # # #

Main Index

Purpose

:

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

866 PCL Reference Manual Examples Verify Action

# This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to run all the # verification tests for all wedge elements. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_wedge_all() # has the following arguments: # # fem_verify_wedge_all # ( threshold, # num_failures, # worst_value, # worst_id ) # #--------------------------------------------------------------------# Variable Declarations REAL ra_threshold(10) INTEGER ia_num_failures(10) REAL ra_worst_value(10) INTEGER ia_worst_id(10) STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<3 3 3>", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 1, 2, 0., 0., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 1, 4, 0., 0., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1", 1, @

Main Index

Chapter 4: Finite Element Functions 867 Verify Action

[1.], "Wedge6", "1", "1", @ "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Run all the verification tests for all wedge elements # ra_threshold = [ 2., 35., 35., 5., 5., 1., 0.2, 0.2, 0., 0.] i_return_value = fem_verify_wedge_all ( ra_threshold, ia_num_failures, ra_worst_value, ia_worst_id ) dump i_return_value dump ia_num_failures dump ra_worst_value dump ia_worst_id

@ @ @ @ @

sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_wedge_aspect

()

# # Purpose : This file provides an example of a call to the # function fem_verify_wedge_aspect() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to load a graphic # table with aspect ratio values of all wedge # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_wedge_aspect() # has the following arguments: # # fem_verify_wedge_aspect # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold

Main Index

868 PCL Reference Manual Examples Verify Action

STRING REAL INTEGER REAL INTEGER INTEGER STRING INTEGER INTEGER STRING STRING INTEGER

s_group_name[32] r_minimum_value i_minimum_id r_maximum_value i_maximum_id i_table_id sv_created_ids[VIRTUAL] i_num_fem_nodes i_num_fem_elements sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] 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", "<3 3 3>", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value i_return_value = ga_view_aa_set( 23., 56., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 1, 2, 0., 0., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 1, 4, 0., 0., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1", 1, @ [1.], "Wedge6", "1", "1", @ "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with aspect ratio values of wedge elements # l_normalize = FALSE r_threshold = 2. i_return_value = fem_verify_wedge_aspect ( l_normalize,

Main Index

@ @ @

Chapter 4: Finite Element Functions 869 Verify Action

dump dump dump dump dump dump dump

r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) i_return_value s_group_name r_minimum_value i_minimum_id r_maximum_value i_maximum_id i_table_id

@ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_wedge_edangle

()

# # Purpose : This file provides an example of a call to the # function fem_verify_wedge_edangle() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to load a graphic # table with edge angle values of all wedge # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_wedge_edangle() # has the following arguments: # # fem_verify_wedge_edangle # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value

Main Index

870 PCL Reference Manual Examples Verify Action

INTEGER INTEGER STRING INTEGER INTEGER STRING STRING INTEGER

i_maximum_id i_table_id sv_created_ids[VIRTUAL] i_num_fem_nodes i_num_fem_elements sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] 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", "<3 3 3>", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value i_return_value = ga_view_aa_set( 23., 56., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 1, 2, 0., 0., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 1, 4, 0., 0., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1", 1, @ [1.], "Wedge6", "1", "1", @ "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with edge angle values of wedge elements # l_normalize = FALSE r_threshold = 35. i_return_value = fem_verify_wedge_edangle ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id,

Main Index

@ @ @ @ @ @ @

Chapter 4: Finite Element Functions 871 Verify Action

dump dump dump dump dump dump dump

r_maximum_value, i_maximum_id, i_table_id ) i_return_value s_group_name r_minimum_value i_minimum_id r_maximum_value i_maximum_id i_table_id

@ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_wedge_fskew

()

# # Purpose : This file provides an example of a call to the # function fem_verify_wedge_fskew() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to load a graphic # table with face skew values of all wedge # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_wedge_fskew() # has the following arguments: # # fem_verify_wedge_fskew # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes

Main Index

872 PCL Reference Manual Examples Verify Action

INTEGER STRING STRING INTEGER

i_num_fem_elements sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] 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", "<3 3 3>", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value i_return_value = ga_view_aa_set( 23., 56., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 1, 2, 0., 0., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 1, 4, 0., 0., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1", 1, @ [1.], "Wedge6", "1", "1", @ "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with face skew values of wedge elements # l_normalize = FALSE r_threshold = 35. i_return_value = fem_verify_wedge_fskew ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value

Main Index

@ @ @ @ @ @ @ @ @

Chapter 4: Finite Element Functions 873 Verify Action

dump dump dump dump dump dump

s_group_name r_minimum_value i_minimum_id r_maximum_value i_maximum_id i_table_id

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_wedge_ftaper

()

# # Purpose : This file provides an example of a call to the # function fem_verify_wedge_ftaper() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to load a graphic # table with face taper values of all wedge # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_wedge_ftaper() # has the following arguments: # # fem_verify_wedge_ftaper # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_created[VIRTUAL] INTEGER i_return_value

Main Index

874 PCL Reference Manual Examples Verify Action

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a solid # i_return_value = @ asm_const_hpat_vertex @ ( "1", "[0 0 0]", "[10 0 0]", "[10 10 0]",@ "[0 10 0]", "[0 0 10]", "[10 3 10]", @ "[9 11 10]", "[-3 10 10]", sv_created_ids) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1", 1, @ [5.], "Wedge6", "1", "1", @ "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with face taper values of wedge elements # l_normalize = FALSE r_threshold = 0.95 i_return_value = fem_verify_wedge_ftaper ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_maximum_value, @ r_minimum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids)

Main Index

Chapter 4: Finite Element Functions 875 Verify Action

sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

fem_verify_wedge_fwarp

()

# # Purpose : This file provides an example of a call to the # function fem_verify_wedge_fwarp() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # This function is then called to load a graphic # table with face warp values of all wedge # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_wedge_fwarp() # has the following arguments: # # fem_verify_wedge_fwarp # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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_vertex @ ( "1", "[0 0 0]", "[10 0 0]", "[10 10 0]",@ "[0 10 0]", "[0 0 10]", "[10 3 10]", @ "[9 11 10]", "[-3 10 10]", sv_created_ids) dump i_return_value

Main Index

876 PCL Reference Manual Examples Verify Action

i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1", 1, @ [5.], "Wedge6", "1", "1", @ "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with face warp values of wedge elements # l_normalize = FALSE r_threshold = 6. i_return_value = fem_verify_wedge_fwarp ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

()

fem_verify_wedge_twist # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_verify_wedge_twist() This session file creates a new database by the name new.db. A solid is created and is meshed.

Chapter 4: Finite Element Functions 877 Verify Action

# This function is then called to load a graphic # table with the twist values of all wedge # elements. Created graphic table is displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_verify_wedge_twist() # has the following arguments: # # fem_verify_wedge_twist # ( normalize, # threshold, # group_name, # minimum_value, # minimum_id, # maximum_value, # maximum_id, # table_id ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_normalize REAL r_threshold STRING s_group_name[32] REAL r_minimum_value INTEGER i_minimum_id REAL r_maximum_value INTEGER i_maximum_id INTEGER i_table_id STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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_vertex @ ( "1", "[0 0 0]", "[10 0 0]", "[10 10 0]",@ "[0 10 0]", "[0 0 10]", "[10 3 10]", @ "[9 11 10]", "[-3 10 10]", sv_created_ids) dump i_return_value i_return_value = ga_view_aa_set( -67., 0., -34. ) dump i_return_value

@

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1", 1, @ [5.], "Wedge6", "1", "1", @ "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created )

Main Index

878 PCL Reference Manual Examples Verify Action

dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Load a graphic table with the twist values of wedge elements # l_normalize = FALSE r_threshold = 6. i_return_value = fem_verify_wedge_twist ( l_normalize, r_threshold, s_group_name, r_minimum_value, i_minimum_id, r_maximum_value, i_maximum_id, i_table_id ) dump i_return_value dump s_group_name dump r_minimum_value dump i_minimum_id dump r_maximum_value dump i_maximum_id dump i_table_id

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Display the graphic table # fem_verify_display @ ( s_group_name, i_table_id, r_minimum_value, @ r_maximum_value, r_threshold, "ELEMFILL") sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

verify_boundaries_display_mgr.erase

()

# # Purpose : This file provides an example of a call to the # function verify_boundaries_display_mgr.erase() # # This session file creates a new database by the # name new.db. A solid is created and is meshed. # The free edges of all the elements are plotted. # This function is then called to erase the free # boundary display in 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 verify_boundaries_display_mgr.erase() has no arguments # #--------------------------------------------------------------------# Variable Declarations STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes

Main Index

Chapter 4: Finite Element Functions 879 Verify Action

INTEGER STRING STRING INTEGER

i_num_fem_elements sv_fem_nodes_created[VIRTUAL] sv_fem_elements_created[VIRTUAL] 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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Initialize the display manager and plot free edges of all elements # verify_boundaries_display_mgr.initialize( ) verify_boundaries_display_mgr.plot( "Free_Edges") #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Erase the free boundary display # verify_boundaries_display_mgr.erase( ) sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created)

Main Index

880 PCL Reference Manual Examples Verify Action

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

verify_boundaries_display_mgr.plot

()

# # Purpose : This file provides an example of a call to the # function verify_boundaries_display_mgr.plot() # # This session file creates a new database by the # name new.db. A solid is created and is meshed # after creating mesh seeds on two of its edges. # This function is then called to plot the free # edges of all the elements. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function verify_boundaries_display_mgr.plot() # has the following arguments: # # verify_boundaries_display_mgr.plot # ( display_type ) # #--------------------------------------------------------------------# Variable Declarations STRING s_display_type[10] STRING sv_created_ids[VIRTUAL] INTEGER i_num_fem_nodes INTEGER i_num_fem_elements STRING sv_fem_nodes_created[VIRTUAL] STRING sv_fem_elements_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", "<15 15 15>", "[0 0 0]", "Coord 0", sv_created_ids ) dump i_return_value i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value

@

#--------------------------------------------------------------------# Create mesh seeds on two edges of the solid # i_return_value = @ mesh_seed_create @ ( "Solid 1.4.2", 2, 0, 0., 3., 0.) dump i_return_value i_return_value = mesh_seed_create ( "Solid 1.4.4", 2, 0, 0., 5., 0.) dump i_return_value

Main Index

@ @

Chapter 4: Finite Element Functions 881 Verify Action

#--------------------------------------------------------------------# Mesh the solid # i_return_value = @ fem_create_mesh_sol_3 @ ( "IsoMesh", 0, "Solid 1 ", 1, [5.], @ "Hex8", "1", "1", "Coord 0", "Coord 0", @ i_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Initialize the display manager verify_boundaries_display_mgr.initialize( ) #--------------------------------------------------------------------# Plot free edges of all elements # s_display_type = "Free_Edges" verify_boundaries_display_mgr.plot( s_display_type) sys_free_string( sv_created_ids) sys_free_string( sv_fem_nodes_created) sys_free_string( sv_fem_elements_created) #---------------------------------------------------------------------

Main Index

882 PCL Reference Manual Examples Show Action

Show Action This section contains examples of some of the functions used to show elements and nodes in a finite element model. fem_show_element_cs_plot.plot_elem_cs

()

# ## Purpose : This file provides an example of a call to the # function fem_show_element_cs_plot.plot_elem_cs() # # This session file will create a new database by # name 'new.db' and call the above mentioned # function and create one hex elements and plot the # coordinate frame axis at the hex elements centroid. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # Note: Do not forget to call gm_segment_delete() to remove the element # coordinate system # # The function fem_show_element_cs_plot.plot_elem_cs() # has the following arguments: # # fem_show_element_cs_plot.plot_elem_cs # ( segment_id, @ # entity_list, @ # display_vector_int, @ # display_label_int, @ # display_color, @ # cs_def_type, @ # cs_origin_display_loc, @ # use_offset_1d_elem ) # #--------------------------------------------------------------------# Variable Declarations STRING s_shape[32] STRING s_element_type[32] STRING s_element_select[32] STRING s_connection_pattern[32] INTEGER i_flag STRING s_corner1_node_select[32] STRING s_corner2_node_select[32] STRING s_corner3_node_select[32] STRING s_corner4_node_select[32] STRING s_corner5_node_select[32] STRING s_corner6_node_select[32] STRING s_corner7_node_select[32] STRING s_corner8_node_select[32] STRING s_fem_elements_created[260] STRING sv_fem_nodes_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create 2 nodes without associating with any geometry i_return_value = fem_create_nodes_1( "Coord 0"@

Main Index

Chapter 4: Finite Element Functions 883 Show Action

, , , ,

"Coord 0"@ 2@ "#"@ "[0 0 0][0 1 0][1 0 0][0.5 1 0]"// @ "[1 0 1][0.5 1 1][0 0 1][0 1 1]"@ , sv_fem_nodes_created) dump i_return_value #--------------------------------------------------------------------i_return_value = ga_view_aa_set(23., -34., 0.) dump i_return_value node_label( TRUE ) hex_elem_label( TRUE ) #--------------------------------------------------------------------# Calling function to create 2 HEX27 elements. s_shape = "Hex" s_element_type = "Hex8" s_element_select = "1" s_connection_pattern = "Standard" i_flag = TRUE s_corner1_node_select = "Node 1" s_corner2_node_select = "Node 3" s_corner3_node_select = "Node 4" s_corner4_node_select = "Node 2" s_corner5_node_select = "Node 7" s_corner6_node_select = "Node 5" s_corner7_node_select = "Node 6" s_corner8_node_select = "Node 8" # i_return_value = fem_create_elems_1 ( s_shape, @ s_element_type, @ s_element_select, @ s_connection_pattern, @ i_flag, @ s_corner1_node_select, @ s_corner2_node_select, @ s_corner3_node_select, @ s_corner4_node_select, @ s_corner5_node_select, @ s_corner6_node_select, @ s_corner7_node_select, @ s_corner8_node_select, @ s_fem_elements_created ) dump i_return_value STRING entity_list[10] = "Elm 1" INTEGER i /* Intialize variables to display vector triad at centroid in color 1,2,3 */ INTEGER display_vector_int(3)=1,1,1 INTEGER display_label_int(3)=1,1,1 INTEGER display_color(3)= 1,2,3 INTEGER cs_def_type, cs_origin_display_loc INTEGER use_offset_1d_elem = 0 INTEGER segment_id /* Plot the patran coordinate system */ cs_def_type = 1 /* Plot at the element centroid */ cs_origin_display_loc = 1 gm_segment_create( segment_id ) dump segment_id fem_show_element_cs_plot.plot_elem_cs( @ segment_id, @ entity_list, @ display_vector_int, @ display_label_int, @ display_color, @

Main Index

884 PCL Reference Manual Examples Show Action

cs_def_type, @ cs_origin_display_loc, @ use_offset_1d_elem ) # # Call gm_segment_delete(segment_id) to remove the plot (usually when you exit the form) #

Main Index

Chapter 4: Finite Element Functions 885 Modify Action

Modify Action This section contains examples of some of the functions used to modify elements and nodes in a finite element model. fem_mod_elem_reverse

()

# # Purpose : This file provides an example of a call to the # function fem_mod_elem_reverse() # # This file creates a surface and meshes it. It # modifies the connectivity (reverses) of a # particular element. Before and after this # activity it gets the connectivity of that # element to show the effect. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_mod_elem_reverse() # has the following arguments: # # fem_mod_elem_reverse # ( element_select, # elements_reversed ) # #--------------------------------------------------------------------# Variable Declarations STRING s_element_select[32] STRING sv_elements_reversed[VIRTUAL] INTEGER i_return_value STRING sv_create_patch_xy_ids[VIRTUAL] INTEGER i_create_surfa_nodes INTEGER i_create_surfa_elems STRING sv_s_nodes_created[VIRTUAL] STRING sv_s_elems_created[VIRTUAL] INTEGER i_num_elems INTEGER i_max_connect INTEGER ia_elem_ids(1) = [23] INTEGER ia_connectivity(4) #--------------------------------------------------------------------# 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_create_patch_xy_ids ) dump i_return_value #--------------------------------------------------------------------# Mesh the surface i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.2], @ "Quad4", "1", "1", "Coord 0", "Coord 0", @ i_create_surfa_nodes, i_create_surfa_elems, @

Main Index

886 PCL Reference Manual Examples Modify Action

sv_s_nodes_created, sv_s_elems_created ) dump i_return_value #--------------------------------------------------------------------# Get the connectivity of elements i_num_elems = 1 i_max_connect = 4 i_return_value = @ db_get_nodes_for_elems @ ( i_num_elems, i_max_connect, ia_elem_ids, ia_connectivity) dump i_return_value dump ia_connectivity #--------------------------------------------------------------------# Modify the connectivity of the selected element s_element_select = "Elm 23" i_return_value = fem_mod_elem_reverse ( s_element_select, sv_elements_reversed ) dump i_return_value dump sv_elements_reversed

@ @ @

#--------------------------------------------------------------------# Get the connectivity of elements i_return_value = @ db_get_nodes_for_elems @ ( i_num_elems, i_max_connect, ia_elem_ids, ia_connectivity) dump i_return_value dump ia_connectivity sys_free_string(sv_create_patch_xy_ids) sys_free_string(sv_elements_reversed) sys_free_string(sv_s_nodes_created) sys_free_string(sv_s_elems_created) #---------------------------------------------------------------------

()

fem_mod_elem_separate # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_mod_elem_separate() This file creates a surface and meshes it. It separates a element at specified nodes. Before and after this activity it gets the connectivity of that element to show the effect This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fem_mod_elem_separate() has the following arguments: fem_mod_elem_separate ( element_select, node_select, separation, keep_association, num_nodes, nodes_created )

Chapter 4: Finite Element Functions 887 Modify Action

#--------------------------------------------------------------------# Variable Declarations STRING s_element_select[128] STRING s_node_select[128] INTEGER i_separation LOGICAL l_keep_association INTEGER i_num_nodes STRING sv_nodes_created[VIRTUAL] INTEGER i_return_value STRING sv_create_patch_xy_ids[VIRTUAL] INTEGER i_create_surfa_nodes INTEGER i_create_surfa_elems STRING sv_s_nodes_created[VIRTUAL] STRING sv_s_elems_created[VIRTUAL] INTEGER i_num_elems INTEGER i_max_connect INTEGER ia_elem_ids(1) = [23] INTEGER ia_connectivity(4) #--------------------------------------------------------------------# 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_create_patch_xy_ids ) dump i_return_value #--------------------------------------------------------------------# Mesh the surface i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.2], @ "Quad4", "1", "1", "Coord 0", "Coord 0", @ i_create_surfa_nodes, i_create_surfa_elems, @ sv_s_nodes_created, sv_s_elems_created ) dump i_return_value #--------------------------------------------------------------------# Get the element connectivity i_num_elems = 1 i_max_connect = 4 i_return_value = @ db_get_nodes_for_elems @ ( i_num_elems, i_max_connect, @ ia_elem_ids, ia_connectivity) dump i_return_value dump ia_connectivity #--------------------------------------------------------------------# Separate the element at specified nodes s_element_select = "Elm 23 " s_node_select = "Node 34 28 " i_separation = 1 l_keep_association = FALSE i_return_value = fem_mod_elem_separate ( s_element_select, s_node_select, i_separation, l_keep_association, i_num_nodes, sv_nodes_created ) dump i_return_value

Main Index

@ @ @ @ @ @ @

888 PCL Reference Manual Examples Modify Action

dump i_num_nodes dump sv_nodes_created #--------------------------------------------------------------------# Get the element connectivity i_return_value = @ db_get_nodes_for_elems @ ( i_num_elems, i_max_connect, @ ia_elem_ids, ia_connectivity) dump i_return_value dump ia_connectivity sys_free_string(sv_create_patch_xy_ids) sys_free_string(sv_nodes_created) sys_free_string(sv_s_nodes_created) sys_free_string(sv_s_elems_created) #---------------------------------------------------------------------

fem_mod_quad_split_nm

()

# # Purpose : This file provides an example of a call to the # function fem_mod_quad_split_nm() # # This file opens the new database "new.db" and # creates a "quad" element. Then splits this # quadrilateral element in a pattern (3 x 2). # Before and after split action it gets the count # of elements present in 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 fem_mod_quad_split_nm() # has the following arguments: # # fem_mod_quad_split_nm # ( pattern, # auto_manual, # element_select, # orientation_element, # num_selected, # num_orientation, # num_nodes_created, # num_elems_created, # num_nodes_deleted, # num_elems_deleted, # nodes_created, # elements_created, # nodes_deleted, # elements_deleted ) # #--------------------------------------------------------------------# Variable Declarations STRING s_pattern[128] STRING s_auto_manual[128] STRING s_element_select[128] STRING s_orientation_element[128] INTEGER i_num_selected INTEGER i_num_orientation INTEGER i_num_nodes_created INTEGER i_num_elems_created INTEGER i_num_nodes_deleted

Main Index

Chapter 4: Finite Element Functions 889 Modify Action

INTEGER i_num_elems_deleted STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_nodes_deleted[VIRTUAL] STRING sv_elements_deleted[VIRTUAL] INTEGER i_return_value STRING sv_create_patch_xy_ids[VIRTUAL] STRING sv_fem_elems_created[VIRTUAL] INTEGER i_num_elems #--------------------------------------------------------------------# 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_create_patch_xy_ids ) dump i_return_value #--------------------------------------------------------------------# Create a quadrilateral element using the points of the surface i_return_value = @ fem_create_elems @ ( "Quad", "Quad4", "1", "Standard", @ FALSE, "Point 1 ", "Point 2 ", "Point 3 ", @ "Point 4 ", "", "", "", "", @ sv_fem_elems_created ) dump i_return_value quad_elem_label ( TRUE ) #--------------------------------------------------------------------# Count the number of quadrilateral elements i_return_value = @ db_count_elems (i_num_elems ) dump i_num_elems dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Split the quadrilateral element s_pattern = "nm_quad" s_auto_manual = "Manual" s_element_select = "Elm 1 " s_orientation_element = "Elm 1.1.3 " i_num_selected = 3 i_num_orientation = 2 i_return_value = fem_mod_quad_split_nm ( s_pattern, s_auto_manual, s_element_select, s_orientation_element, i_num_selected, i_num_orientation, i_num_nodes_created, i_num_elems_created, i_num_nodes_deleted, i_num_elems_deleted, sv_nodes_created, sv_elements_created, sv_nodes_deleted,

Main Index

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

890 PCL Reference Manual Examples Modify Action

dump dump dump dump dump dump dump dump dump

sv_elements_deleted ) i_return_value i_num_nodes_created i_num_elems_created i_num_nodes_deleted i_num_elems_deleted sv_nodes_created sv_elements_created sv_nodes_deleted sv_elements_deleted

#--------------------------------------------------------------------# Count the number of quadrilateral elements i_return_value = @ db_count_elems (i_num_elems ) dump i_num_elems dump i_return_value sys_free_string(sv_create_patch_xy_ids) sys_free_string(sv_fem_elems_created) sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_nodes_deleted) sys_free_string(sv_elements_deleted) #---------------------------------------------------------------------

fem_modify_nodes

()

# # Purpose : This file provides an example of a call to the # function fem_modify_nodes() # # This file opens a new database "new.db" and # creates four nodes and modifies these four # nodes. Before and after modification it # gets their attributes using a 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 fem_modify_nodes() # has the following arguments: # # fem_modify_nodes # ( node_select, # new_node_id, # ref_coord_frame, # anly_coord_frame, # point_select, # modify_options, # nodes_modified ) # #--------------------------------------------------------------------# Variable Declarations STRING s_node_select[128] STRING s_new_node_id[128] STRING s_ref_coord_frame[128] STRING s_anly_coord_frame[128] STRING s_point_select[128] INTEGER ia_modify_options(10) = [1, 1, 1, 0, 1, 0, 0, 0, 0, 0] STRING sv_nodes_modified[VIRTUAL] INTEGER i_return_value STRING sv_cord_3po_created_ids[VIRTUAL] STRING sv_xyz_created_ids[VIRTUAL]

Main Index

Chapter 4: Finite Element Functions 891 Modify Action

STRING sv_nodes_created[VIRTUAL] INTEGER i_num_nodes = 4 INTEGER ia_node_ids(4) = [1, 2, 3, 4 ] INTEGER ia_ref_coords(4) INTEGER ia_analy_coords(4) REAL ra_glob_xyzs(12) #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a coordinate i_return_value = @ asm_const_coord_3point @ ( "1", "Coord 0", 2, "[0 0 0]", "[0 0 1]", @ "[1 0 0]", sv_cord_3po_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create 8 points i_return_value = @ asm_const_grid_xyz @ ( "1", "[0 0 0][1 0 0][1 1 0][0 1 0]", "Coord 0", @ sv_xyz_created_ids ) dump i_return_value i_return_value = asm_const_grid_xyz ( "5", "[2 0 0][1 2 0][2 1 0][0 2 0]", "Coord 0", sv_xyz_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create 4 nodes on points one to four i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", TRUE, "1", "Point 1:4 ", @ sv_nodes_created ) dump i_return_value node_label ( TRUE ) #--------------------------------------------------------------------# Get the node attributes i_return_value = @ db_get_nodes @ ( i_num_nodes, ia_node_ids, ia_ref_coords, @ ia_analy_coords, ra_glob_xyzs ) dump i_return_value dump ia_ref_coords dump ia_analy_coords dump ra_glob_xyzs #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Modify the attributes s_node_select = "Node 1:4" s_new_node_id = "1:4" s_ref_coord_frame = "Coord 1" s_anly_coord_frame = "Coord 1" s_point_select = "Point 5:8" i_return_value = fem_modify_nodes ( s_node_select,

Main Index

@ @ @

892 PCL Reference Manual Examples Modify Action

s_new_node_id, s_ref_coord_frame, s_anly_coord_frame, s_point_select, ia_modify_options, sv_nodes_modified ) dump i_return_value dump sv_nodes_modified

@ @ @ @ @

#--------------------------------------------------------------------# Get the modified node attributes i_return_value = @ db_get_nodes @ ( i_num_nodes, ia_node_ids, ia_ref_coords, @ ia_analy_coords, ra_glob_xyzs ) dump i_return_value dump ia_ref_coords dump ia_analy_coords dump ra_glob_xyzs sys_free_string(sv_xyz_created_ids) sys_free_string(sv_nodes_modified) sys_free_string(sv_cord_3po_created_ids) sys_free_string(sv_nodes_created) #---------------------------------------------------------------------

fem_modify_nodes_offset

()

# # Purpose : This file provides an example of a call to the # function fem_modify_nodes_offset() # # This file creates two nodes and offset them # through 1 unit along y axis. After this # action the new location is obtained. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_modify_nodes_offset() # has the following arguments: # # fem_modify_nodes_offset # ( transformation_type, # ref_coord_frame, # vector_direction, # magnitude, # reverse_direction, # node_select, # nodes_modified ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_transformation_type STRING s_ref_coord_frame[128] STRING s_vector_direction[128] STRING s_magnitude[128] LOGICAL l_reverse_direction STRING s_node_select[128] STRING sv_nodes_modified[VIRTUAL] INTEGER i_return_value STRING sv_grid_xyz_created_ids[VIRTUAL] STRING sv_nodes_created[VIRTUAL] INTEGER i_num_nodes = 2

Main Index

Chapter 4: Finite Element Functions 893 Modify Action

INTEGER INTEGER INTEGER REAL

ia_node_ids(2) = [1, 2 ] ia_ref_coords(2) ia_analy_coords(2) ra_glob_xyzs(6)

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create two nodes i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[0 0 0][1 0 0]", sv_nodes_created ) dump i_return_value node_label ( TRUE ) #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Offset one node l_transformation_type = FALSE s_ref_coord_frame = "Coord 0" s_vector_direction = "Coord 0.2" s_magnitude = "1." l_reverse_direction = FALSE s_node_select = "Node 1" i_return_value = fem_modify_nodes_offset ( l_transformation_type, s_ref_coord_frame, s_vector_direction, s_magnitude, l_reverse_direction, s_node_select, sv_nodes_modified ) dump i_return_value dump sv_nodes_modified

@ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Get the new location of the nodes i_return_value = @ db_get_nodes @ ( i_num_nodes, @ ia_node_ids, @ ia_ref_coords, @ ia_analy_coords, @ ra_glob_xyzs ) dump i_return_value dump ra_glob_xyzs sys_free_string(sv_grid_xyz_created_ids) sys_free_string(sv_nodes_created) sys_free_string(sv_nodes_modified) #---------------------------------------------------------------------

()

fem_modify_elems # #

Main Index

Purpose

:

This file provides an example of a call to the

894 PCL Reference Manual Examples Modify Action

# function fem_modify_elems() # # This file opens a new database "new.db" and # creates 25 elements and modifies their topology # Before and after modification it # gets their topology ID using a 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 fem_modify_elems() # has the following arguments: # # fem_modify_elems # ( new_element_id, # new_shape, # new_element_type, # current_node_select, # new_node_select, # element_select, # modify_options, # elements_modified ) # #--------------------------------------------------------------------# Variable Declarations STRING s_new_element_id[128] STRING s_new_shape[128] STRING s_new_element_type[128] STRING s_current_node_select[128] STRING s_new_node_select[128] STRING s_element_select[128] INTEGER ia_modify_options(10) STRING sv_elements_modified[VIRTUAL] INTEGER i_return_value STRING sv_patch_xy_created_ids[VIRTUAL] INTEGER i_surfa_num_nodes INTEGER i_surfa_num_elems STRING sv_s_nodes_created[VIRTUAL] STRING sv_s_elems_created[VIRTUAL] INTEGER i_num_elems = 25 INTEGER ia_elem_ids(25) = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, @ 11, 12, 13, 14, 15, 16, 17, 18, @ 19, 20, 21, 22, 23, 24, 25 ] INTEGER ia_topo_codes(25) #--------------------------------------------------------------------# 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_patch_xy_created_ids ) dump i_return_value #--------------------------------------------------------------------# Mesh the surface i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.2], @ "Quad4", "1", "1", "Coord 0", "Coord 0", @ i_surfa_num_nodes, i_surfa_num_elems, @ sv_s_nodes_created, sv_s_elems_created ) dump i_return_value

Main Index

Chapter 4: Finite Element Functions 895 Modify Action

node_label ( TRUE ) #--------------------------------------------------------------------# Get the topology of the elements i_return_value = @ db_get_elem_etop @ ( i_num_elems, @ ia_elem_ids, @ ia_topo_codes ) dump i_return_value dump ia_topo_codes #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Modify the element topology s_new_shape = "Quad" s_new_element_type = "Quad8" s_element_select = "Elm 1:25 " ia_modify_options = [0, 1, 0, 0, 0, 0, 0, 0, 0, 0] i_return_value = fem_modify_elems ( s_new_element_id, s_new_shape, s_new_element_type, s_current_node_select, s_new_node_select, s_element_select, ia_modify_options, sv_elements_modified ) dump i_return_value dump sv_elements_modified

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Get the modified topology i_return_value = @ db_get_elem_etop @ ( i_num_elems, @ ia_elem_ids, @ ia_topo_codes ) dump i_return_value dump ia_topo_codes sys_free_string(sv_patch_xy_created_ids) sys_free_string(sv_s_nodes_created) sys_free_string(sv_s_elems_created) sys_free_string(sv_elements_modified) #---------------------------------------------------------------------

()

fem_modify_mpc_nodal # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_modify_mpc_nodal() This file opens a new database and creates four nodes. It creates explicit MPC with node 3 and node 1, 2. Then modifies the MPC , changing the independent nodes as node 2, 4. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown

896 PCL Reference Manual Examples Modify Action

# menus on the menu bar. # # The function fem_modify_mpc_nodal() # has the following arguments: # # fem_modify_mpc_nodal # ( mpc_id, # constant, # num_terms, # dependency_flag, # coefficient, # node_select, # degrees_of_freedom ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_mpc_id REAL r_constant INTEGER i_num_terms LOGICAL la_dependency_flag(3) REAL ra_coefficient(3) STRING saa_node_select[6](3) STRING saa_degrees_of_freedom[14](3) INTEGER i_return_value 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 four nodes i_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[0 0 0][1 0 0][1 1 0][0 1 0]", sv_nodes_created ) dump i_return_value node_label ( TRUE ) #--------------------------------------------------------------------# Create a MPC i_return_value = @ fem_create_mpc_nodal @ ( 1, "Explicit", 1., 2, [TRUE, FALSE], [0., 1.], @ ["Node 3", "Node 1 2"], @ ["UX,UY,UZ,RX,RY", "UX,UY,UZ,RX,RY"] ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Modify the MPC i_mpc_id = 1 r_constant = 1.0 i_num_terms = 3 la_dependency_flag = [TRUE, FALSE, FALSE] ra_coefficient = [0., 1., 1.] saa_node_select = ["Node 3", "Node 1", "Node 4"] saa_degrees_of_freedom = ["UX,UY,UZ,RX,RY", @ "UX,UY,UZ,RX,RY", "UX,UY,UZ,RX,RY"] i_return_value = fem_modify_mpc_nodal ( i_mpc_id, r_constant,

Main Index

@ @ @ @

Chapter 4: Finite Element Functions 897 Modify Action

i_num_terms, la_dependency_flag, ra_coefficient, saa_node_select, saa_degrees_of_freedom ) dump i_return_value

@ @ @ @

sys_free_string(sv_nodes_created) sys_free_string(sv_elems_created) #---------------------------------------------------------------------

fem_mod_bar_split

()

# # Purpose : This file provides an example of a call to the # function fem_mod_bar_split() # # This file opens a new database "new.db" and # creates a bar element, then splits it into # two. Before and after this action it gets # the number of elements in 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 fem_mod_bar_split() # has the following arguments: # # fem_mod_bar_split # ( element_select, # num_nodes_created, # num_elems_created, # num_nodes_deleted, # num_elems_deleted, # nodes_created, # elements_created, # nodes_deleted, # elements_deleted ) # #--------------------------------------------------------------------# Variable Declarations STRING s_element_select[32] INTEGER i_num_nodes_created INTEGER i_num_elems_created INTEGER i_num_nodes_deleted INTEGER i_num_elems_deleted STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_nodes_deleted[VIRTUAL] STRING sv_elements_deleted[VIRTUAL] INTEGER i_return_value STRING sv_elemen_elems_created[VIRTUAL] INTEGER i_num_elems #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a bar element i_return_value = @ fem_create_elems @ ( "Bar ", "Bar2", "1", "Standard", TRUE, @ "[0 0 0]", "[1 0 0]", "", "", "", "", "", "", @ sv_elemen_elems_created )

Main Index

898 PCL Reference Manual Examples Modify Action

dump i_return_value bar_elem_label ( TRUE ) #--------------------------------------------------------------------# Count the number of elements i_return_value = @ db_count_elems (i_num_elems ) dump i_num_elems dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Split the bar element into two s_element_select = "Elem 1" i_return_value = fem_mod_bar_split ( s_element_select, i_num_nodes_created, i_num_elems_created, i_num_nodes_deleted, i_num_elems_deleted, sv_nodes_created, sv_elements_created, sv_nodes_deleted, sv_elements_deleted ) dump dump dump dump dump dump dump dump dump

@ @ @ @ @ @ @ @ @ @

i_return_value i_num_nodes_created i_num_elems_created i_num_nodes_deleted i_num_elems_deleted sv_nodes_created sv_elements_created sv_nodes_deleted sv_elements_deleted

#--------------------------------------------------------------------# Count the number of elements i_return_value = db_count_elems (i_num_elems ) dump i_num_elems

@

sys_free_string(sv_elemen_elems_created) sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_nodes_deleted) sys_free_string(sv_elements_deleted) #---------------------------------------------------------------------

()

fem_mod_tria_split # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_mod_tria_split() This file opens a new database "new.db" and creates a tria element, then splits it in a pattern. Before and after this action it gets the number of elements in the database. This file can be run by starting a session of

Chapter 4: Finite Element Functions 899 Modify Action

# Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fem_mod_tria_split() # has the following arguments: # # fem_mod_tria_split # ( pattern, # auto_manual, # element_select, # orientation_node, # num_nodes_created, # num_elems_created, # num_nodes_deleted, # num_elems_deleted, # nodes_created, # elements_created, # nodes_deleted, # elements_deleted ) # #--------------------------------------------------------------------# Variable Declarations STRING s_pattern[128] STRING s_auto_manual[128] STRING s_element_select[128] STRING s_orientation_node[128] INTEGER i_num_nodes_created INTEGER i_num_elems_created INTEGER i_num_nodes_deleted INTEGER i_num_elems_deleted STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_nodes_deleted[VIRTUAL] STRING sv_elements_deleted[VIRTUAL] INTEGER i_return_value STRING sv_elemen_elems_created[VIRTUAL] INTEGER i_num_elems #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a triangular element i_return_value = @ fem_create_elems @ ( "Tri ", "Tria3", "1", "Standard", FALSE, @ "[0 0 0]", "[1 0 0]", "[.5 1 0]", "", "", @ "", "", "", sv_elemen_elems_created ) dump i_return_value tri_elem_label (TRUE ) #--------------------------------------------------------------------# Count the number of elements i_return_value = @ db_count_elems (i_num_elems ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Split the triangular element s_pattern = "4_tria" s_auto_manual = "Auto" s_element_select = "Elm 1 "

Main Index

900 PCL Reference Manual Examples Modify Action

i_return_value = fem_mod_tria_split ( s_pattern, s_auto_manual, s_element_select, s_orientation_node, i_num_nodes_created, i_num_elems_created, i_num_nodes_deleted, i_num_elems_deleted, sv_nodes_created, sv_elements_created, sv_nodes_deleted, sv_elements_deleted ) dump i_return_value dump i_num_nodes_created dump i_num_elems_created dump i_num_nodes_deleted dump i_num_elems_deleted dump sv_nodes_created dump sv_elements_created dump sv_nodes_deleted dump sv_elements_deleted

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

#--------------------------------------------------------------------# Count the number of elements i_return_value = @ db_count_elems (i_num_elems ) dump i_num_elems dump i_return_value sys_free_string(sv_elemen_elems_created) sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_nodes_deleted) sys_free_string(sv_elements_deleted) #---------------------------------------------------------------------

()

fem_mod_quad_split # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_mod_quad_split() This file opens the new database "new.db" and creates a "quad" element. Then splits this quadrilateral element in a pattern. Before and after split action it gets the count of elements present in 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 fem_mod_quad_split() has the following arguments: fem_mod_quad_split ( pattern, auto_manual, element_select, orientation_node, orientation_element, num_nodes_created, num_elems_created,

Chapter 4: Finite Element Functions 901 Modify Action

# num_nodes_deleted, # num_elems_deleted, # nodes_created, # elements_created, # nodes_deleted, # elements_deleted ) # #--------------------------------------------------------------------# Variable Declarations STRING s_pattern[128] STRING s_auto_manual[128] STRING s_element_select[128] STRING s_orientation_node[128] STRING s_orientation_element[128] INTEGER i_num_nodes_created INTEGER i_num_elems_created INTEGER i_num_nodes_deleted INTEGER i_num_elems_deleted STRING sv_nodes_created[VIRTUAL] STRING sv_elements_created[VIRTUAL] STRING sv_nodes_deleted[VIRTUAL] STRING sv_elements_deleted[VIRTUAL] INTEGER i_return_value STRING sv_create_patch_xy_ids[VIRTUAL] STRING sv_fem_elems_created[VIRTUAL] INTEGER i_num_elems #--------------------------------------------------------------------# 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_create_patch_xy_ids ) dump i_return_value #--------------------------------------------------------------------# Create a quadrilateral element using the points of surface i_return_value = @ fem_create_elems @ ( "Quad", "Quad4", "1", "Standard", @ FALSE, "Point 1 ", "Point 2 ", "Point 3 ", @ "Point 4 ", "", "", "", "", @ sv_fem_elems_created ) dump i_return_value quad_elem_label ( TRUE ) #--------------------------------------------------------------------# Count the number of elements i_return_value = @ db_count_elems (i_num_elems ) dump i_num_elems #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Split the quadrilateral element s_pattern = "4_quad" s_auto_manual = "Auto" s_element_select = "Elm 1 " i_return_value = fem_mod_quad_split

Main Index

@ @

902 PCL Reference Manual Examples Modify Action

(

dump dump dump dump dump dump dump dump dump

s_pattern, s_auto_manual, s_element_select, s_orientation_node, s_orientation_element, i_num_nodes_created, i_num_elems_created, i_num_nodes_deleted, i_num_elems_deleted, sv_nodes_created, sv_elements_created, sv_nodes_deleted, sv_elements_deleted ) i_return_value i_num_nodes_created i_num_elems_created i_num_nodes_deleted i_num_elems_deleted sv_nodes_created sv_elements_created sv_nodes_deleted sv_elements_deleted

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

#--------------------------------------------------------------------# Count the number of elements i_return_value = @ db_count_elems (i_num_elems ) dump i_num_elems sys_free_string(sv_create_patch_xy_ids) sys_free_string(sv_fem_elems_created) sys_free_string(sv_nodes_created) sys_free_string(sv_elements_created) sys_free_string(sv_nodes_deleted) sys_free_string(sv_elements_deleted) #---------------------------------------------------------------------

modify_mesh_seed

()

# # Purpose : This file provides an example of a call to the # function modify_mesh_seed() # # This file creates a surface and creates mesh # seed on one of it’s curves. Then it changes # the mesh seed of the same 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 modify_mesh_seed() # has the following arguments: # # modify_mesh_seed # ( curve_list, # input_option, # num_elem, # ratio, # length1, # length2 ) # #--------------------------------------------------------------------# Variable Declarations STRING sv_curve_list[VIRTUAL]

Main Index

Chapter 4: Finite Element Functions 903 Modify Action

INTEGER i_input_option INTEGER i_num_elem REAL r_ratio REAL r_length1 REAL r_length2 INTEGER i_return_value STRING sv_patch_xy_created_ids[VIRTUAL] #--------------------------------------------------------------------# 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_patch_xy_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create mesh seed on one curve i_return_value = @ mesh_seed_create @ ( "Surface 1.2 ", 1, 5, 0., 0., 0. ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Modify the mesh seed sv_curve_list = "Surface 1.2 " i_input_option = 3 i_num_elem = 2 r_ratio = 1.5 r_length1 = 0.0 r_length2 = 0.0 i_return_value = @ modify_mesh_seed @ ( sv_curve_list, @ i_input_option, @ i_num_elem, @ r_ratio, @ r_length1, @ r_length2 ) dump i_return_value sys_free_string(sv_patch_xy_created_ids) sys_free_string(sv_curve_list) #---------------------------------------------------------------------

()

modify_mesh_seed_tabular # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function modify_mesh_seed_tabular() This file creates a surface and creates mesh seed on one of it’s curves. Then it changes the mesh seed of the same curve by tabular method. This file can be run by starting a session of Patran, and running this session file

904 PCL Reference Manual Examples Modify Action

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function modify_mesh_seed_tabular() # has the following arguments: # # modify_mesh_seed_tabular # ( curve_list, # coord_type, # num_nodes, # node_locs, # point_list ) # #--------------------------------------------------------------------# Variable Declarations STRING sv_curve_list[VIRTUAL] STRING sv_coord_type[VIRTUAL] INTEGER i_num_nodes REAL ra_node_locs(3) STRING sv_point_list[VIRTUAL] INTEGER i_return_value STRING sv_patch_xy_created_ids[VIRTUAL] #--------------------------------------------------------------------# 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_patch_xy_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create mesh seed on one curve i_return_value = @ mesh_seed_create_tabular @ ( "Surface 1.2 ", "Arc_Length", 11, @ [0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.] ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Modify the mesh seed by tabular method sv_curve_list = "Surface 1.2 " sv_coord_type = "Arc_Length" i_num_nodes = 3 ra_node_locs = [0., 0.5, 1.0 ] i_return_value = @ modify_mesh_seed_tabular @ ( sv_curve_list, @ sv_coord_type, @ i_num_nodes, @ ra_node_locs, @ sv_point_list, @ [-12345.] ) dump i_return_value sys_free_string(sv_patch_xy_created_ids) sys_free_string(sv_curve_list) sys_free_string(sv_coord_type) sys_free_string(sv_point_list) #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 905 Delete Action

Delete Action This section contains examples of some of the function used to delete elements, nodes, and meshes from a finite element model. fem_delete_elem_and_node

()

# # Purpose : This file provides an example of a call to the # function fem_delete_elem_and_node() # # This file opens a new database, and creates # a surface. It meshes the surface and deletes # one element and its associated nodes. # # This file can be run by starting a session of # Patran, through the "File","Session", # "Play" pulldown menus on the menu bar. # # The function fem_delete_elem_and_node() # has the following arguments: # # fem_delete_elem_and_node # ( element_select, # deleted_elements ) # #--------------------------------------------------------------------# Variable Declarations STRING sv_element_select[VIRTUAL] STRING sv_deleted_elements[VIRTUAL] INTEGER i_return_value INTEGER i_surfa_num_nodes INTEGER i_surfa_num_elems STRING sv_mesh_s_nodes_created[VIRTUAL] STRING sv_mesh_s_elems_created[VIRTUAL] STRING sv_patch_xy_created_ids[VIRTUAL] INTEGER i_num_elems INTEGER i_num_nodes #--------------------------------------------------------------------# 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_patch_xy_created_ids ) dump i_return_value #--------------------------------------------------------------------# Mesh the Surface i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.5], "Quad4", @ "1", "1", "Coord 0", "Coord 0", @ i_surfa_num_nodes, i_surfa_num_elems, @ sv_mesh_s_nodes_created, sv_mesh_s_elems_created ) dump i_return_value dump sv_mesh_s_nodes_created dump sv_mesh_s_elems_created node_label( TRUE ) quad_elem_label( TRUE )

Main Index

906 PCL Reference Manual Examples Delete Action

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Delete a Element and associated nodes sv_element_select = "Elm 3 " i_return_value = @ fem_delete_elem_and_node @ ( sv_element_select, @ sv_deleted_elements ) dump i_return_value dump sv_deleted_elements #--------------------------------------------------------------------# Get the count of elements i_return_value = @ db_count_elems (i_num_elems ) dump i_num_elems dump i_return_value #--------------------------------------------------------------------# Get the count of nodes i_return_value = @ db_count_nodes (i_num_nodes ) dump i_num_nodes dump i_return_value #--------------------------------------------------------------------sys_free_string( sv_element_select) sys_free_string(sv_patch_xy_created_ids) sys_free_string(sv_mesh_s_nodes_created) sys_free_string(sv_mesh_s_elems_created) sys_free_string(sv_deleted_elements) #---------------------------------------------------------------------

fem_delete_element

()

# # Purpose : This file provides an example of a call to the # function fem_delete_element() # # This file opens a new database and creates a # surface. It meshes the surface and then # deletes one element from 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 fem_delete_element() # has the following arguments: # # fem_delete_element # ( element_select, # deleted_elements ) # #--------------------------------------------------------------------# Variable Declarations STRING sv_element_select[VIRTUAL] STRING sv_deleted_elements[VIRTUAL] INTEGER i_return_value STRING sv_patch_xy_created_ids[VIRTUAL] INTEGER i_surfa_num_nodes INTEGER i_surfa_num_elems

Main Index

Chapter 4: Finite Element Functions 907 Delete Action

STRING STRING INTEGER INTEGER

sv_mesh_s_nodes_created[VIRTUAL] sv_mesh_s_elems_created[VIRTUAL] i_num_elems i_num_nodes

#--------------------------------------------------------------------# 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_patch_xy_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Mesh the Surface i_return_value = fem_create_mesh_surf_2 ( "IsoMesh", 0, "Surface 1 ", 1, [0.5], "Quad4", "1", "1", "Coord 0", "Coord 0", i_surfa_num_nodes, i_surfa_num_elems, sv_mesh_s_nodes_created, sv_mesh_s_elems_created ) dump i_return_value dump sv_mesh_s_nodes_created dump sv_mesh_s_elems_created node_label( TRUE ) quad_elem_label( TRUE )

@ @ @ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Delete a element from the surface sv_element_select = "Elm 4 " i_return_value = fem_delete_element ( sv_element_select, sv_deleted_elements ) dump i_return_value dump sv_deleted_elements

@ @ @

#--------------------------------------------------------------------# Get the count of elemts i_return_value = db_count_elems (i_num_elems ) dump i_num_elems dump i_return_value

@

#--------------------------------------------------------------------# Get the count of nodes i_return_value = db_count_nodes (i_num_nodes ) dump i_num_nodes dump i_return_value sys_free_string(sv_element_select) sys_free_string(sv_patch_xy_created_ids) sys_free_string(sv_mesh_s_nodes_created)

Main Index

@

908 PCL Reference Manual Examples Delete Action

sys_free_string(sv_mesh_s_elems_created) sys_free_string(sv_deleted_elements) #---------------------------------------------------------------------

fem_delete_free_node

()

# # Purpose : This file provides an example of a call to the # function fem_delete_free_node() # # This file opens a new database, and creates # a surface. It meshes the surface and deletes # a element leaving a free node on surface. # It deletes the free node using 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 fem_delete_free_node() # has the following arguments: # # fem_delete_free_node # ( node_select, # deleted_nodes, # not_found_nodes ) # #--------------------------------------------------------------------# Variable Declarations STRING sv_node_select[VIRTUAL] STRING sv_deleted_nodes[VIRTUAL] STRING sv_not_found_nodes[VIRTUAL] INTEGER i_return_value STRING sv_patch_xy_created_ids[VIRTUAL] INTEGER i_surfa_num_nodes INTEGER i_surfa_num_elems STRING sv_mesh_s_nodes_created[VIRTUAL] STRING sv_mesh_s_elems_created[VIRTUAL] STRING sv_element_select[VIRTUAL] STRING sv_deleted_elements[VIRTUAL] INTEGER i_num_elems INTEGER i_num_nodes #--------------------------------------------------------------------# 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_patch_xy_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Mesh the Surface i_return_value = fem_create_mesh_surf_2 ( "IsoMesh", 0, "Surface 1 ", 1, [0.5], "Quad4", "1", "1", "Coord 0", "Coord 0", i_surfa_num_nodes, i_surfa_num_elems,

Main Index

@ @ @ @ @

Chapter 4: Finite Element Functions 909 Delete Action

sv_mesh_s_nodes_created, sv_mesh_s_elems_created ) dump i_return_value dump sv_mesh_s_nodes_created dump sv_mesh_s_elems_created node_label( TRUE ) quad_elem_label( TRUE ) #--------------------------------------------------------------------# Delete a element from the mesh sv_element_select = "Elm 4 " i_return_value = fem_delete_element ( sv_element_select, sv_deleted_elements ) dump i_return_value dump sv_deleted_elements

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Delete free nodes from the mesh sv_node_select = "Node 1:9 " i_return_value = fem_delete_free_node ( sv_node_select, sv_deleted_nodes, sv_not_found_nodes ) dump i_return_value dump sv_deleted_nodes dump sv_not_found_nodes

@ @ @ @

#--------------------------------------------------------------------# Get the count of elements i_return_value = db_count_elems (i_num_elems ) dump i_num_elems dump i_return_value

@

#--------------------------------------------------------------------# Get the count of nodes i_return_value = db_count_nodes (i_num_nodes ) dump i_num_nodes dump i_return_value

@

sys_free_string(sv_patch_xy_created_ids) sys_free_string(sv_mesh_s_nodes_created) sys_free_string(sv_mesh_s_elems_created) sys_free_string(sv_deleted_elements) sys_free_string(sv_deleted_nodes) sys_free_string(sv_not_found_nodes) sys_free_string(sv_node_select) sys_free_string(sv_element_select) #---------------------------------------------------------------------

fem_delete_mesh_from_curve # # #

Main Index

Purpose

:

()

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

910 PCL Reference Manual Examples Delete Action

# # This file opens a new database "new.db" and # creates a curve and meshes it. Then it deletes # the mesh from the curve. # # This file can be run by starting a session of # Patran, through the "File","Session", # "Play" pulldown menus on the menu bar. # # The function fem_delete_mesh_from_curve() # has the following arguments: # # fem_delete_mesh_from_curve # ( curve_select, # deleted_mesh, # not_found_mesh ) # #--------------------------------------------------------------------# Variable Declarations STRING sv_curve_select[VIRTUAL] STRING sv_deleted_mesh[VIRTUAL] STRING sv_not_found_mesh[VIRTUAL] INTEGER i_return_value STRING sv_line_xyz_created_ids[VIRTUAL] INTEGER i_curve_num_nodes INTEGER i_curve_num_elems STRING sv_c_nodes_created[VIRTUAL] STRING sv_c_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_xyz( "1", "<1 0 0>", "[0 0 0]", "Coord 0", sv_line_xyz_created_ids ) dump i_return_value

@ @

#--------------------------------------------------------------------# Mesh the Curve i_return_value = fem_create_mesh_curv( "Curve 1 ", 0.1, "Bar2", "1", "1", "Coord 0", "Coord 0", i_curve_num_nodes, i_curve_num_elems, sv_c_nodes_created, sv_c_elems_created ) dump i_return_value

@ @ @ @ @ @

bar_elem_label ( TRUE ) #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Delete the mesh on the Curve sv_curve_select = "Curve 1 " i_return_value = fem_delete_mesh_from_curve ( sv_curve_select, sv_deleted_mesh, sv_not_found_mesh )

Main Index

@ @ @ @

Chapter 4: Finite Element Functions 911 Delete Action

dump i_return_value dump sv_deleted_mesh dump sv_not_found_mesh sys_free_string(sv_curve_select) sys_free_string(sv_line_xyz_created_ids) sys_free_string(sv_c_nodes_created) sys_free_string(sv_c_elems_created) sys_free_string(sv_deleted_mesh) sys_free_string(sv_not_found_mesh) #---------------------------------------------------------------------

fem_delete_mesh_from_surface

()

# # Purpose : This file provides an example of a call to the # function fem_delete_mesh_from_surface() # # This file opens a new database "new.db" # and creates a mesh on it. Then deletes the # mesh from the surface using the function. # # This file can be run by starting a session of # Patran, through the "File","Session", # "Play" pulldown menus on the menu bar. # # The function fem_delete_mesh_from_surface() # has the following arguments: # # fem_delete_mesh_from_surface # ( surface_select, # deleted_mesh, # not_found_mesh ) # #--------------------------------------------------------------------# Variable Declarations STRING sv_surface_select[VIRTUAL] STRING sv_deleted_mesh[VIRTUAL] STRING sv_not_found_mesh[VIRTUAL] INTEGER i_return_value STRING sv_patch_xy_created_ids[VIRTUAL] INTEGER i_surfa_num_nodes INTEGER i_surfa_num_elems STRING sv_mesh_s_nodes_created[VIRTUAL] STRING sv_mesh_s_elems_created[VIRTUAL] #--------------------------------------------------------------------# 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_patch_xy_created_ids ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Mesh the Surface i_return_value = fem_create_mesh_surf_2 ( "IsoMesh", 0, "Surface 1 ", 1, [0.5], "Quad4",

Main Index

@ @ @

912 PCL Reference Manual Examples Delete Action

"1", "1", "Coord 0", "Coord 0", @ i_surfa_num_nodes, i_surfa_num_elems, @ sv_mesh_s_nodes_created, sv_mesh_s_elems_created ) dump i_return_value dump sv_mesh_s_nodes_created dump sv_mesh_s_elems_created quad_elem_label( TRUE ) #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Delete the mesh from the Surface sv_surface_select = "Surface 1 " i_return_value = fem_delete_mesh_from_surface ( sv_surface_select, sv_deleted_mesh, sv_not_found_mesh ) dump i_return_value dump sv_deleted_mesh dump sv_not_found_mesh

@ @ @ @

sys_free_string(sv_surface_select) sys_free_string(sv_patch_xy_created_ids) sys_free_string(sv_mesh_s_nodes_created) sys_free_string(sv_mesh_s_elems_created) sys_free_string(sv_deleted_mesh) sys_free_string(sv_not_found_mesh) #---------------------------------------------------------------------

fem_delete_mesh_from_solid

()

# # Purpose : This file provides an example of a call to the # function fem_delete_mesh_from_solid() # # This file opens a new database "new.db", # creates a solid and meshes it. Then deletes # the mesh from solid using the function. # # This file can be run by starting a session of # Patran, through the "File","Session", # "Play" pulldown menus on the menu bar. # # The function fem_delete_mesh_from_solid() # has the following arguments: # # fem_delete_mesh_from_solid # ( solid_select, # deleted_mesh, # not_found_mesh ) # #--------------------------------------------------------------------# Variable Declarations STRING sv_solid_select[VIRTUAL] STRING sv_deleted_mesh[VIRTUAL] STRING sv_not_found_mesh[VIRTUAL] INTEGER i_return_value STRING sv_hpat_xyz_created_ids[VIRTUAL] INTEGER i_mesh_solid_num_nodes INTEGER i_mesh_solid_num_elems STRING sv_s_nodes_created[VIRTUAL]

Main Index

Chapter 4: Finite Element Functions 913 Delete Action

STRING sv_s_elems_created[VIRTUAL] #--------------------------------------------------------------------# 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_hpat_xyz_created_ids ) dump i_return_value #--------------------------------------------------------------------# Setting to the iso view i_return_value = ga_view_aa_set(-67., 0., -34.) dump i_return_value #--------------------------------------------------------------------# Mesh the Solid i_return_value = @ fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [0.25], @ "Hex8", "1", "1", "Coord 0", @ "Coord 0", i_mesh_solid_num_nodes, @ i_mesh_solid_num_elems, @ sv_s_nodes_created, sv_s_elems_created ) dump i_return_value hex_elem_label( TRUE ) #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Delete the mesh from the Solid sv_solid_select = "Solid 1 " i_return_value = fem_delete_mesh_from_solid ( sv_solid_select, sv_deleted_mesh, sv_not_found_mesh ) dump i_return_value dump sv_deleted_mesh dump sv_not_found_mesh

@ @ @ @

sys_free_string(sv_solid_select) sys_free_string(sv_hpat_xyz_created_ids) sys_free_string(sv_s_nodes_created) sys_free_string(sv_s_elems_created) sys_free_string(sv_deleted_mesh) sys_free_string(sv_not_found_mesh) #---------------------------------------------------------------------

Main Index

914 PCL Reference Manual Examples Utilities

Utilities This section contains examples of some of the finite element model utility functions. fem_geom_match_closest

()

# # Purpose : This file provides an example of a call to the # function fem_geom_match_closest() # # This file opens a new database "new.db" and # creates four points. Gets the closest point # for point 4 from the target list of remaining # three points. # # This file can be run by starting a session of # Patran, through the "File","Session", # "Play" pulldown menus on the menu bar. # # The function fem_geom_match_closest() # has the following arguments: # # fem_geom_match_closest # ( source_select, # target_select, # entity_count, # match, # distance, # length ) # #--------------------------------------------------------------------# Variable Declarations STRING s_source_select[32] STRING s_target_select[32] INTEGER i_entity_count STRING sv_match[VIRTUAL] REAL rv_distance(VIRTUAL) INTEGER i_length INTEGER i_return_value STRING sv_grid_xyz_created_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create four points i_return_value = asm_const_grid_xyz( "1", "[0 0 0][-1 2 0][1 2 0][2 3 0]", "Coord 0", sv_grid_xyz_created_ids ) dump i_return_value

@ @

point_label( TRUE ) #--------------------------------------------------------------------# Get the closest match of the point 4 from target list s_source_select = "Point 4" s_target_select = "Point 2 1 3" i_return_value = fem_geom_match_closest ( s_source_select, s_target_select,

Main Index

@ @ @ @

Chapter 4: Finite Element Functions 915 Utilities

dump dump dump dump dump

i_entity_count, sv_match, rv_distance, i_length ) i_return_value i_entity_count sv_match rv_distance i_length

@ @ @

sys_free_string(sv_grid_xyz_created_ids) sys_free_string(sv_match) sys_free_array(rv_distance) #---------------------------------------------------------------------

fem_geom_edge_length

()

# # Purpose : This file provides an example of a call to the # function fem_geom_edge_length() # # This function opens a new database "new.db" # and creates a quadrilateral and a triangular # elements. It then gets the lengths of all the # element edges using this function. # # This file can be run by starting a session of # Patran, through the "File","Session", # "Play" pulldown menus on the menu bar. # # The function fem_geom_edge_length() # has the following arguments: # # fem_geom_edge_length # ( element_select, # lengths, # entity_count ) # #--------------------------------------------------------------------# Variable Declarations STRING s_element_select[64] REAL rv_lengths(VIRTUAL) INTEGER i_entity_count INTEGER i_return_value STRING sv_elems_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a quadrilateral element i_return_value = fem_create_elems ("Quad", "Quad4", "1", "Standard", TRUE, "[0 0 0] ","[1 0 0] ", "[1 1 0] ", "[0 1 0] ", "", "", "", "", sv_elems_created ) dump i_return_value

@ @ @ @

quad_elem_label( TRUE ) #--------------------------------------------------------------------# Create a triangular element

Main Index

916 PCL Reference Manual Examples Utilities

i_return_value = fem_create_elems( "Tri ", "Tria3", "2", "Standard", TRUE, "[2 0 0] ", "[3 0 0] ", "[2 1 0] ", "", "", "", "", "", sv_elems_created ) dump i_return_value tri_elem_label( TRUE )

@ @ @ @

#--------------------------------------------------------------------# Get lengths of all the edges s_element_select = "Elm 1.1.1 1.1.2 1.1.3 1.1.4 2.1.1 2.1.2 2.1.3" i_return_value = fem_geom_edge_length ( s_element_select, rv_lengths, i_entity_count ) dump i_return_value dump rv_lengths dump i_entity_count

@ @ @ @

sys_free_string(sv_elems_created) sys_free_array(rv_lengths) #---------------------------------------------------------------------

fem_geom_edge_length2

()

# # Purpose : This file provides an example of a call to the # function fem_geom_edge_length2() # # This file opens a new database "new.db", # creates a cube and meshes it. Using this # function it gets the edge length of two # elements by specifying the required face and # edge ids. # # This file can be run by starting a session of # Patran, through the "File","Session", # "Play" pulldown menus on the menu bar. # # The function fem_geom_edge_length2() # has the following arguments: # # fem_geom_edge_length2 # ( edge_count, # element_id, # element_face_id, # element_face_edge_id, # segment_count, # edge_length ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_edge_count INTEGER ia_element_id(2) INTEGER ia_element_face_id(2) INTEGER ia_element_face_edge_id(2) INTEGER i_segment_count REAL rv_edge_length(VIRTUAL) INTEGER i_return_value STRING sv_hpat_xyz_created_ids[VIRTUAL] INTEGER i_mesh_solid_num_nodes INTEGER i_mesh_solid_num_elems STRING sv_mesh_s_nodes_created[VIRTUAL] STRING sv_mesh_s_elems_created[VIRTUAL]

Main Index

Chapter 4: Finite Element Functions 917 Utilities

#--------------------------------------------------------------------# 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_hpat_xyz_created_ids ) dump i_return_value

@ @

i_return_value = ga_view_aa_set (23., -34., 0.) dump i_return_value

@

#--------------------------------------------------------------------# Mesh the solid i_return_value = fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [0.5], "Hex8", "1", "1", "Coord 0", "Coord 0", i_mesh_solid_num_nodes, i_mesh_solid_num_elems, sv_mesh_s_nodes_created, sv_mesh_s_elems_created ) dump i_return_value

@ @ @ @ @ @

#--------------------------------------------------------------------# Get the edge lengths of elements i_edge_count ia_element_id(1) ia_element_id(2) ia_element_face_id(1) ia_element_face_id(2) ia_element_face_edge_id(1) ia_element_face_edge_id(2) i_segment_count = 2

= = = = = = =

2 1 2 5 0 2 8

i_return_value = fem_geom_edge_length2 ( i_edge_count, ia_element_id, ia_element_face_id, ia_element_face_edge_id, i_segment_count, rv_edge_length ) dump i_return_value dump rv_edge_length

@ @ @ @ @ @ @

sys_free_string(sv_hpat_xyz_created_ids) sys_free_string(sv_mesh_s_nodes_created) sys_free_string(sv_mesh_s_elems_created) sys_free_array(rv_edge_length) #---------------------------------------------------------------------

()

fem_geom_face_area # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fem_geom_face_area() This file opens a new database "new.db",

918 PCL Reference Manual Examples Utilities

# creates a quadrilateral and a triangular # elements. Using this function it gets the # face area of these two elements. # # This file can be run by starting a session of # Patran, through the "File","Session", # "Play" pulldown menus on the menu bar. # # The function fem_geom_face_area() # has the following arguments: # # fem_geom_face_area # ( element_select, # areas, # entity_count ) # #--------------------------------------------------------------------# Variable Declarations STRING s_element_select[32] REAL rv_areas(VIRTUAL) INTEGER i_entity_count INTEGER i_return_value STRING sv_elems_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a quadrilateral element i_return_value = fem_create_elems( "Quad", "Quad4", "1", "Standard", TRUE, "[0 0 0] ","[1 0 0] ", "[1 1 0] ", "[0 1 0] ", "", "", "", "", sv_elems_created ) dump i_return_value

@ @

quad_elem_label( TRUE ) #--------------------------------------------------------------------# Create a triangular element i_return_value = fem_create_elems( "Tri ", "Tria3", "2", @ "Standard", TRUE, "[2 0 0] ", "[3 0 0] ", "[2 1 0] ", "", "",@ "", "", "", sv_elems_created ) dump i_return_value tri_elem_label( TRUE ) #--------------------------------------------------------------------# Get the face areas of the elements s_element_select = "Elem 1 2 " i_return_value = fem_geom_face_area ( s_element_select, rv_areas, i_entity_count ) dump i_return_value dump rv_areas dump i_entity_count

@ @ @ @

sys_free_string(sv_elems_created) sys_free_array(rv_areas) #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 919 Utilities

fem_geom_elem_volume

()

# # Purpose : This file provides an example of a call to the # function fem_geom_elem_volume() # # This file opens a new database "new.db", and # creates brick and wedge elements and gets # their volumes using this function. # # This file can be run by starting a session of # Patran, through the "File","Session", # "Play" pulldown menus on the menu bar. # # The function fem_geom_elem_volume() # has the following arguments: # # fem_geom_elem_volume # ( element_select, # volumes, # entity_count ) # #--------------------------------------------------------------------# Variable Declarations STRING s_element_select[32] REAL rv_volumes(VIRTUAL) INTEGER i_entity_count INTEGER i_return_value STRING sv_hpat_xyz_created_ids[VIRTUAL] INTEGER i_mesh_solid_num_nodes INTEGER i_mesh_solid_num_elems STRING sv_s_nodes_created[VIRTUAL] STRING sv_s_elems_created[VIRTUAL] #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create two solids i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_hpat_xyz_created_ids ) dump i_return_value

@ @

i_return_value = asm_const_hpat_xyz( "", "<1 1 1>", "[2 0 0]", "Coord 0", sv_hpat_xyz_created_ids ) dump i_return_value

@ @

i_return_value = ga_view_aa_set (23., -34., 0.) dump i_return_value

@

#--------------------------------------------------------------------# Mesh the solid 1 with brick element i_return_value = @ fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [1.], @ "Hex8", "1", "1", "Coord 0", @ "Coord 0", i_mesh_solid_num_nodes, @ i_mesh_solid_num_elems, @ sv_s_nodes_created, sv_s_elems_created ) dump i_return_value

Main Index

920 PCL Reference Manual Examples Utilities

hex_elem_label( TRUE ) #--------------------------------------------------------------------# Mesh the solid 2 with wedge element i_return_value = @ fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 2 ", 1, @ [1.], "Wedge6", "9", "2", "Coord 0",@ "Coord 0", i_mesh_solid_num_nodes, @ i_mesh_solid_num_elems, @ sv_s_nodes_created, sv_s_elems_created ) dump i_return_value wedge_elem_label( TRUE ) #--------------------------------------------------------------------# Get the volume of brick and wedge elements s_element_select = "Elem 1:3 " i_return_value = fem_geom_elem_volume ( s_element_select, rv_volumes, i_entity_count ) dump i_return_value dump rv_volumes dump i_entity_count

@ @ @ @

sys_free_string(sv_hpat_xyz_created_ids) sys_free_string(sv_s_nodes_created) sys_free_string(sv_s_elems_created) sys_free_array(rv_volumes) #---------------------------------------------------------------------

fem_geom_elem_location

()

# # Purpose : This file provides an example of a call to the # function fem_geom_elem_location() # # This file opens a new database "new.db", # creates a quadrilateral element and gets the # location of all the element edges. # # This file can be run by starting a session of # Patran, through the "File","Session", # "Play" pulldown menus on the menu bar. # # The function fem_geom_elem_location() # has the following arguments: # # fem_geom_elem_location # ( element_select, # locations, # entity_count ) # #--------------------------------------------------------------------# Variable Declarations STRING s_element_select[64] REAL rv_locations(VIRTUAL) INTEGER i_entity_count INTEGER i_return_value STRING sv_elems_created[VIRTUAL] #---------------------------------------------------------------------

Main Index

Chapter 4: Finite Element Functions 921 Utilities

# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a quadrilateral element i_return_value = fem_create_elems( "Quad", "Quad4", "1", "Standard", TRUE, "[0 0 0] ","[1 0 0] ", "[1 1 0] ", "[0 1 0] ", "", "", "", "", sv_elems_created ) dump i_return_value

@ @ @ @

quad_elem_label( TRUE ) #--------------------------------------------------------------------# Get the element edge locations s_element_select = "Elm 1 Elm 1.1.1 Elm 1.1.2 Elm 1.1.3 Elm 1.1.4" i_return_value = fem_geom_elem_location ( s_element_select, rv_locations, i_entity_count ) dump i_return_value dump rv_locations dump i_entity_count

@ @ @ @

sys_free_string(sv_elems_created) sys_free_array(rv_locations) #---------------------------------------------------------------------

fem_get_mesh_edge_def_data

()

# # Purpose : This file provides an example of a call to the # function fem_get_mesh_edge_def_data() # # This file opens a new database "new.db" # creates a surface and creates mesh seed for # all the edges with different methods. It # meshes the surface and gets the mesh and # mesh seed details for all the edges using # this function. # # This file can be run by starting a session of # Patran, through the "File","Session", # "Play" pulldown menus on the menu bar. # # The function fem_get_mesh_edge_def_data() # has the following arguments: # # fem_get_mesh_edge_def_data # ( curve_id, # mesh_status, # mesh_type, # num_elements, # mesh_ratio, # num_hard, # node_locations ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_curve_id

Main Index

922 PCL Reference Manual Examples Utilities

INTEGER i_mesh_status INTEGER i_mesh_type INTEGER i_num_elements REAL r_mesh_ratio INTEGER i_num_hard REAL rv_node_locations(VIRTUAL) INTEGER i_return_value STRING sv_patch_xy_created_ids[VIRTUAL] INTEGER i_mesh_surfa_num_nodes INTEGER i_mesh_surfa_num_elems STRING sv_mesh_s_nodes_created[VIRTUAL] STRING sv_s_elems_created[VIRTUAL] INTEGER i_count INTEGER ia_curve_ids(4) = [1, 2, 3, 4] #--------------------------------------------------------------------# 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_patch_xy_created_ids ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create mesh seed for all the surface edges i_return_value = mesh_seed_create( "Surface 1.1 ", 1, 5, 0., 0., 0. ) dump i_return_value

@

i_return_value = mesh_seed_create( "Surface 1.2 ", 3, 5, 1.25, 0., 0. ) dump i_return_value

@

i_return_value = mesh_seed_create( "Surface 1.3 ", 5, 5, 1.5, 0., 0. ) dump i_return_value

@

i_return_value = @ mesh_seed_create_tabular( "Surface 1.4 ", "Arc_Length", @ 6, [0., 0.2, 0.4, 0.6, 0.8, 1., 0., 0.] ) dump i_return_value #--------------------------------------------------------------------# Mesh the surface i_return_value = fem_create_mesh_surf_2( "IsoMesh", 0, "Surface 1 ", 1, [0.1], "Quad4", "1", "1", "Coord 0", "Coord 0", i_mesh_surfa_num_nodes, i_mesh_surfa_num_elems, sv_mesh_s_nodes_created, sv_s_elems_created ) dump i_return_value

@ @ @ @ @ @ @

#--------------------------------------------------------------------# Get the mesh and mesh seed details of all the suface edges FOR (i_count = 1 TO 4 ) i_curve_id = ia_curve_ids(i_count) i_return_value = fem_get_mesh_edge_def_data

Main Index

@ @

Chapter 4: Finite Element Functions 923 Utilities

(

dump dump dump dump dump dump dump

i_curve_id, i_mesh_status, i_mesh_type, i_num_elements, r_mesh_ratio, i_num_hard, rv_node_locations ) i_return_value i_mesh_status i_mesh_type i_num_elements r_mesh_ratio i_num_hard rv_node_locations

@ @ @ @ @ @

END FOR sys_free_array(rv_node_locations) sys_free_string(sv_patch_xy_created_ids) sys_free_string(sv_mesh_s_nodes_created) sys_free_string(sv_s_elems_created) #---------------------------------------------------------------------

Main Index

924 PCL Reference Manual Examples Utilities

Main Index

Chapter 5: Property Assignment Functions PCL Reference Manual Examples

5

Main Index

Property Assignment Functions 

Introduction



Loads and Boundary Conditions



Element Properties



Beam Library



Materials



Load Cases



Fields

969

926

946

964

937

927

926 PCL Reference Manual Examples Introduction

Introduction The purpose of this chapter is to provide examples for functions used to define and manipulate loads and boundary conditions (Load/BC or lbc), element properties, the beam library, material properties, load cases, and fields. These six function groupings are often referred to as functional assignments. See Property Assignment Functions (Ch. 5) in the PCL Reference Manual for a description of these functions.

Main Index

Chapter 5: Property Assignment Functions 927 Loads and Boundary Conditions

Loads and Boundary Conditions This section contains examples of some of the functions that pertain to loads and boundary conditions (Loads/BCs). .

loadsbcs_create

()

# # Purpose : This file provides an example of a call to the # function loadsbcs_create() # # This function creates a new Load/BC set in the # database. # # In this example a new database is opened and a # cuboid of dimension 5 X 1 X 1 is created. Then # this function is called to create a load set # consisting of force, "New_Force" on the edge of # the cuboid. The creation is verified by getting # the number of lbcs present in the database # before and after the creation of the load 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 loadsbcs_create() # has the following arguments: # # loadsbcs_create # ( lbc_name, # lbc_type, # lbc_category, # target_element, # load_case_type, # ap_list, # geo_filter, # alt_coord_frame, # lbc_scale_factor, # static_data, # dynamic_data) # #--------------------------------------------------------------------# Variable Declarations STRING s_lbc_name[32] STRING s_lbc_type[66] STRING s_lbc_category[32] STRING s_target_element[32] STRING s_load_case_type[32] STRING sa_ap_list[32](1) STRING s_geo_filter[32] STRING s_alt_coord_frame[200] REAL r_lbc_scale_factor STRING sa_static_data[100](2) STRING sa_dynamic_data[200](2) INTEGER i_return_value STRING sv_create_hpat_xyz_created_ids[VIRTUAL] INTEGER i_load_count #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "new.db" ) $? YES 36000002

Main Index

928 PCL Reference Manual Examples Loads and Boundary Conditions

# Set ISO-1 viewing i_return_value = ga_view_aa_set ( 23., -34., 0. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create cuboid i_return_value = @ asm_const_hpat_xyz @ ( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_create_hpat_xyz_created_ids ) dump i_return_value #--------------------------------------------------------------------# Count number of Loads/BCs before load set creation i_return_value = @ db_count_lbc(i_load_count) dump i_return_value dump i_load_count #--------------------------------------------------------------------# Create load set "New_Force" s_lbc_name s_lbc_type s_lbc_category s_target_element s_load_case_type sa_ap_list(1) s_geo_filter s_alt_coord_frame r_lbc_scale_factor sa_static_data(1) sa_static_data(2) sa_dynamic_data(1) sa_dynamic_data(2)

= = = = = = = = = = = = =

"New_Force" "Force" "Nodal" "" "Static" "Solid 1.2.3" "Geometry" "Coord 0" 1.0 "< 0. -100. 0. >" "< 0. 0. 0. >" "" ""

i_return_value = loadsbcs_create ( s_lbc_name, s_lbc_type, s_lbc_category, s_target_element, s_load_case_type, sa_ap_list, s_geo_filter, s_alt_coord_frame, r_lbc_scale_factor, sa_static_data, sa_dynamic_data) dump i_return_value

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

# Count number of Loads/BCs after load set creation i_return_value = @ db_count_lbc(i_load_count) dump i_return_value dump i_load_count #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_create_hpat_xyz_created_ids) #---------------------------------------------------------------------

loadsbcs_delete

Main Index

()

Chapter 5: Property Assignment Functions 929 Loads and Boundary Conditions

# # Purpose : This file provides an example of a call to the # function loadsbcs_delete() # # This function deletes the specified Load/BC # sets from the database. # # In this example a new database is opened and a # cuboid of dimension 5 X 1 X 1 is created. Then # a load set is created consisting of force, # "New_Force" on the edge of the cuboid. Then # this function is called to delete the created # load set, after a pause.The deletion is # verified by getting the number of lbcs present # in the database before and after the deletion # of the load 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 loadsbcs_delete() # has the following arguments: # # loadsbcs_delete # ( lbc_names ) # #--------------------------------------------------------------------# Variable Declarations STRING sa_lbc_names[32](1) INTEGER i_return_value STRING sv_create_hpat_xyz_created_ids[VIRTUAL] INTEGER i_load_count #--------------------------------------------------------------------# 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 cuboid i_return_value = @ asm_const_hpat_xyz @ ( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_create_hpat_xyz_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create load set "New_Force" i_return_value = @ loadsbcs_create @ ( "New_Force", "Force", "Nodal", "", @ "Static", ["Solid 1.2.3"], "Geometry", @ "Coord 0", 1., ["<0. -100. 0.>", @ "< 0. 0. 0.>"], ["", ""] ) dump i_return_value # Count number of Loads/BCs after load set creation i_return_value = @ db_count_lbc(i_load_count) dump i_return_value dump i_load_count

Main Index

930 PCL Reference Manual Examples Loads and Boundary Conditions

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Delete load set "New_Force" sa_lbc_names(1) = "New_Force" i_return_value = loadsbcs_delete ( sa_lbc_names ) dump i_return_value

@ @

# Count number of Loads/BCs after load set creation i_return_value = @ db_count_lbc(i_load_count) dump i_return_value dump i_load_count #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_create_hpat_xyz_created_ids) #---------------------------------------------------------------------

loadsbcs_modify

()

# # Purpose : This file provides an example of a call to the # function loadsbcs_modify() # # This function modifies the specified Load/BC # sets in the database. # # In this example a new database is opened and a # cuboid of dimension 5 X 1 X 1 is created. Then # a load set is created consisting of force, # "New_Force" on the edge of the cuboid. Then # this function is called to modify the created # load set, after a pause. The application region # and the name of the load set are modified. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function loadsbcs_modify() # has the following arguments: # # loadsbcs_modify # ( old_name, # new_name, # lbc_type, # lbc_category, # target_element, # load_case_type, # ap_list, # geo_filter, # alt_coord_frame, # lbc_scale_factor, # static_data, # dynamic_data ) # #---------------------------------------------------------------------

Main Index

Chapter 5: Property Assignment Functions 931 Loads and Boundary Conditions

# Variable Declarations STRING s_old_name[32] STRING s_new_name[32] STRING s_lbc_type[32] STRING s_lbc_category[32] STRING s_target_element[32] STRING s_load_case_type[32] STRING sa_ap_list[32](1) STRING s_geo_filter[32] STRING s_alt_coord_frame[200] REAL r_lbc_scale_factor STRING sa_static_data[100](2) STRING sa_dynamic_data[200](2) 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

@ @

#--------------------------------------------------------------------# Create cuboid i_return_value = @ asm_const_hpat_xyz @ ( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_create_hpat_xyz_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create load set "New_Force" i_return_value = @ loadsbcs_create @ ( "New_Force", "Force", "Nodal", "", @ "Static", ["Solid 1.2.3"], "Geometry", @ "Coord 0", 1., ["<0. -100. 0.>", @ "< 0. 0. 0.>"], ["", ""] ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Modify load set "New_Force" to "Modified_Force" s_old_name s_new_name s_lbc_type s_lbc_category s_target_element s_load_case_type sa_ap_list(1) s_geo_filter s_alt_coord_frame r_lbc_scale_factor sa_static_data(1) sa_static_data(2) sa_dynamic_data(1) sa_dynamic_data(2) i_return_value = loadsbcs_modify

Main Index

= = = = = = = = = = = = = =

"New_Force" "Modified_Force" "Force" "Nodal" "" "Static" "Solid 1.4.3" "Geometry" "Coord 0" 1.0 "< 0. -100. 0. >" "< 0. 0. 0. >" "" "" @ @

932 PCL Reference Manual Examples Loads and Boundary Conditions

(

s_old_name, s_new_name, s_lbc_type, s_lbc_category, s_target_element, s_load_case_type, sa_ap_list, s_geo_filter, s_alt_coord_frame, r_lbc_scale_factor, sa_static_data, sa_dynamic_data ) dump i_return_value

@ @ @ @ @ @ @ @ @ @ @

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

loadsbcs_plot_contours

()

# # Purpose : This file provides an example of a call to the # function loadsbcs_plot_contours() # # This function displays contour of the selected # data variable on the selected group for an # Load/BC in the current load case. # # In this example a new database is opened and a # surface ( 5 X 1 ) in XZ plane is created. Then # load set of varying pressure ("New_Press" - 0 # to 500 Units ) is created on the surface using # field, "New_Field". Then this function is # called to display the contours of # "Top Surf Pressure" of load set "New_Press" for # default group. Warnings generated during the # execution of this example are to be ignored. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function loadsbcs_plot_contours() # has the following arguments: # # loadsbcs_plot_contours # ( lbc_type, # dynamic_value, # data_variable, # vector_component, # lbc_name, # group_names ) # #--------------------------------------------------------------------# Variable Declarations STRING s_lbc_type[32] REAL r_dynamic_value STRING sa_data_variable[32] STRING sa_vector_component[32] STRING sa_lbc_name[32](1) STRING sa_group_names[32](1) INTEGER i_return_value STRING sv_create_patch_xy_created_ids[VIRTUAL] INTEGER i_fem_mesh_surfa_num_nodes

Main Index

Chapter 5: Property Assignment Functions 933 Loads and Boundary Conditions

INTEGER i_fem_mesh_surfa_num_elems STRING sv_fem_mesh_s_nodes_created[VIRTUAL] STRING sv_fem_mesh_s_elems_created[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 surface i_return_value = @ asm_const_patch_xyz @ ( "1", "<5 0 1>", "[0 0 0]", "Coord 0", @ sv_create_patch_xy_created_ids ) dump i_return_value # Create Finite Elements i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [1.], @ "Quad4", "1", "1" , "Coord 0","Coord 0", @ i_fem_mesh_surfa_num_nodes, @ i_fem_mesh_surfa_num_elems, @ sv_fem_mesh_s_nodes_created, @ sv_fem_mesh_s_elems_created ) dump i_return_value # Create field "New_Field" i_return_value = fields_create ( "New_Field", "Spatial", 1, "Scalar", "Real", "Coord 0", "", "Function",1,"X", "", "", "100*’X", "", "", FALSE, [0.], [0.], [0.], [[[0.]]] ) dump i_return_value

@ @ @ @ @

# Create load set "New_Press" i_return_value = @ loadsbcs_create @ ( "New_Press","Pressure","Element Uniform",@ "2D", "Static",["Surface 1"],"Geometry", @ "", 1., ["f:New_Field", " 0", " 0"], @ ["", "", ""] ) dump i_return_value #--------------------------------------------------------------------# Plot contours s_lbc_type r_dynamic_value sa_data_variable sa_vector_component sa_lbc_name(1) sa_group_names(1)

= = = = = =

"Pressure" 0. "Top Surf Pressure" "Resultant" "New_Press" "default_group"

i_return_value = loadsbcs_plot_contours ( s_lbc_type, r_dynamic_value, sa_data_variable, sa_vector_component, sa_lbc_name,

Main Index

@ @ @ @ @ @ @

934 PCL Reference Manual Examples Loads and Boundary Conditions

sa_group_names ) dump i_return_value #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_create_patch_xy_created_ids) sys_free_string( sv_fem_mesh_s_nodes_created) sys_free_string( sv_fem_mesh_s_elems_created) #---------------------------------------------------------------------

loadsbcs_plot_markers

()

# # Purpose : This file provides an example of a call to the # function loadsbcs_plot_markers() # # In this example a new database is opened and a # cuboid of dimension 5 X 1 X 1 with a load set # (New_Disp) is created. Then the markers of # "New_Disp" is displayed using this function # 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 loadsbcs_plot_markers() # has the following arguments: # # loadsbcs_plot_markers # ( lbc_name, # group_names ) # #--------------------------------------------------------------------# Variable Declarations STRING sa_lbc_name[32](1) STRING sa_group_names[32](1) 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

@ @

#--------------------------------------------------------------------# Create cuboid i_return_value = @ asm_const_hpat_xyz @ ( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_create_hpat_xyz_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create load sets "New_Disp" i_return_value = @ loadsbcs_create @ ( "New_Disp", "Displacement", "Nodal","", @ "Static", ["Point 1 2 5 6"], "Geometry",@ "Coord 0", 1., ["< 0. 0. 0. >", @

Main Index

Chapter 5: Property Assignment Functions 935 Loads and Boundary Conditions

"<0. 0. 0.>"], ["", ""] ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Plot markers for load set "New_Disp" sa_lbc_name(1) = "New_Disp" sa_group_names(1) = "default_group" i_return_value = loadsbcs_plot_markers ( sa_lbc_name, sa_group_names ) dump i_return_value

@ @ @

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

loadsbcs_show

()

# # Purpose : This file provides an example of a call to the # function loadsbcs_show() # # This function shows a display of data for a # selected Load/BC set on a spreadsheet. # # In this example a new database is opened and a # cuboid of dimension 5 X 1 X 1 with a load set, # "New_Force" is created. Then this function is # called to display the tabular details of the # lbc "New_Force". # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function loadsbcs_show() # has the following arguments: # # loadsbcs_show # ( lbc_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_lbc_name[32] 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

Main Index

@ @

936 PCL Reference Manual Examples Loads and Boundary Conditions

#--------------------------------------------------------------------# Create cuboid i_return_value = @ asm_const_hpat_xyz @ ( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_create_hpat_xyz_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create load set "New_Force" i_return_value = @ loadsbcs_create @ ( "New_Force", "Force", "Nodal", "", @ "Static", ["Solid 1.2.3"], "Geometry", @ "Coord 0", 1., ["<0. -100. 0.>", @ "< 0. 0. 0.>"], ["", ""] ) dump i_return_value #--------------------------------------------------------------------# Display lbc details in Tabular form s_lbc_name = "New_Force" loadsbcs_show( s_lbc_name ) #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_create_hpat_xyz_created_ids) #---------------------------------------------------------------------

Main Index

Chapter 5: Property Assignment Functions 937 Element Properties

Element Properties This section contains examples of some of the functions that pertain to element properties. .

elementprops_create

()

# # Purpose : This file provides an example of a call to the # function elementprops_create() # # This function creates an element property set. # # In this example a new database is opened. A # cuboid of dimension 5 X 1 X 1 is created and # meshed.Then a material("Aluminium") is created. # The material is associated with the elements # 1 & 2 using this function. The creation of the # element property set is verified by getting the # number of property words associated with the # property regions. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function elementprops_create() # has the following arguments: # # elementprops_create # ( name, # elem_type_id, # geo_opt_id, # con_opt_id, # for_opt_id, # lam_opt_id, # dof_opt_id, # pids, # dtypes, # dstrings, # app_str ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name[32] INTEGER i_elem_type_id INTEGER i_geo_opt_id INTEGER i_con_opt_id INTEGER i_for_opt_id INTEGER i_lam_opt_id INTEGER i_dof_opt_id INTEGER ia_pids(5) INTEGER ia_dtypes(5) STRING sa_dstrings[32](5) STRING sv_app_str[VIRTUAL] INTEGER i_return_value STRING sv_create_hpat_xyz_created_ids[VIRTUAL] INTEGER i_create_mesh_solid_num_nodes INTEGER i_create_mesh_solid_num_elems STRING sv_create_mesh_s_nodes_created[VIRTUAL] STRING sv_create_mesh_s_elems_created[VIRTUAL] INTEGER i_region_id = 1 INTEGER i_num_words #---------------------------------------------------------------------

Main Index

938 PCL Reference Manual Examples Element Properties

# 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 cuboid i_return_value = @ asm_const_hpat_xyz @ ( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_create_hpat_xyz_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create FEM mesh on solid i_return_value = @ fem_create_mesh_sol( "Solid 1", @ 1.0, "Hex8", "1", "1", "Coord 0", @ "Coord 0", i_create_mesh_solid_num_nodes, @ i_create_mesh_solid_num_elems, @ sv_create_mesh_s_nodes_created, @ sv_create_mesh_s_elems_created ) 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 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", ""] ) dump i_return_value #--------------------------------------------------------------------# Count the number of property words associated with property region # before creation of element property set. i_return_value = @ db_count_props( i_region_id, i_num_words) dump i_return_value dump i_num_words #--------------------------------------------------------------------# Create Element property set s_name i_elem_type_id i_geo_opt_id i_con_opt_id i_for_opt_id i_lam_opt_id i_dof_opt_id ia_pids ia_dtypes sa_dstrings(1) sv_app_str

Main Index

= = = = = = = = = = =

"elem_prop_1" 71 25 30 1 1 20 [13, 21, 4124, 4126, 4125] [5, 4, 4, 4, 4] "m:Aluminium" "Element 1 2"

Chapter 5: Property Assignment Functions 939 Element Properties

i_return_value = elementprops_create ( s_name, i_elem_type_id, i_geo_opt_id, i_con_opt_id, i_for_opt_id, i_lam_opt_id, i_dof_opt_id, ia_pids, ia_dtypes, sa_dstrings, sv_app_str ) dump i_return_value

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

#--------------------------------------------------------------------# Count the number of property words associated with property region # after creation of element property set. i_return_value = @ db_count_props( i_region_id, i_num_words) dump i_return_value dump i_num_words #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_app_str) sys_free_string( sv_create_hpat_xyz_created_ids) sys_free_string( sv_create_mesh_s_nodes_created) sys_free_string( sv_create_mesh_s_elems_created) #---------------------------------------------------------------------

elementprops_delete

()

# # Purpose : This file provides an example of a call to the # function elementprops_delete() # # This function deletes element property sets. # # In this example a new database is opened. A # cuboid of dimension 5 X 1 X 1 is created and # meshed. Then a material("Aluminium") is created # and associated with the elements using function # elementprops_create(). Then this function is # called to delete the created element-property. # The deletion of the element property set is # verified by getting the number of property # words associated with the property regions # before and after 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 elementprops_delete() # has the following arguments: # # elementprops_delete # ( del_names ) # #--------------------------------------------------------------------# Variable Declarations STRING sa_del_names[32](1) INTEGER i_return_value STRING sv_create_mesh_s_nodes_created[VIRTUAL]

Main Index

940 PCL Reference Manual Examples Element Properties

STRING sv_create_mesh_s_elems_created[VIRTUAL] STRING sv_create_hpat_xyz_created_ids[VIRTUAL] INTEGER i_create_mesh_solid_num_nodes INTEGER i_create_mesh_solid_num_elems INTEGER i_region_id = 1 INTEGER i_num_words #--------------------------------------------------------------------# 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 cuboid i_return_value = @ asm_const_hpat_xyz @ ( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_create_hpat_xyz_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create FEM mesh on solid i_return_value = fem_create_mesh_sol ( "Solid 1",1.,"Hex8","1", "1","Coord 0", "Coord 0", i_create_mesh_solid_num_nodes, i_create_mesh_solid_num_elems, sv_create_mesh_s_nodes_created, sv_create_mesh_s_elems_created ) 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 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", ""] ) dump i_return_value #--------------------------------------------------------------------# Create Element property set i_return_value = @ elementprops_create @ ( "elem_prop_1", 71, 25, 30, 1, 1, 20, [13, 21,4124,4126,@ 4125], [5,4,4, 4, 4],["m:Aluminium","", "", "", ""], @ "Element 1:5" ) dump i_return_value #--------------------------------------------------------------------# Count the number of property words associated with property region # before deletion of element property set. i_return_value = @ db_count_props( i_region_id, i_num_words) dump i_return_value dump i_num_words #---------------------------------------------------------------------

Main Index

Chapter 5: Property Assignment Functions 941 Element Properties

# Delete element property set sa_del_names(1) = "elem_prop_1" i_return_value = elementprops_delete ( sa_del_names ) dump i_return_value

@ @

#--------------------------------------------------------------------# Count the number of property words associated with property region # after deletion of element property set. i_return_value = @ db_count_props( i_region_id, i_num_words) dump i_return_value dump i_num_words #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_create_hpat_xyz_created_ids) sys_free_string( sv_create_mesh_s_nodes_created) sys_free_string( sv_create_mesh_s_elems_created) #---------------------------------------------------------------------

elementprops_modify

()

# # Purpose : This file provides an example of a call to the # function elementprops_modify() # # This function modifies element property sets. # # In this example a new database is opened. A # cuboid of dimension 5 X 1 X 1 is created and # meshed. Then a material("Aluminium") and an # element property("Elem_Prop") is created. After # a pause a new material("Polycarbonate") is # created. Then the material of "Elem_Prop" is # changed from "Aluminium" to "Polycarbonate" and # the associated elements from "Element 1:5" to # "Element 1:2". The change in element property # is displayed 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 elementprops_modify() # has the following arguments: # # elementprops_modify # ( name, # new_name, # elem_type_id, # geo_opt_id, # con_opt_id, # for_opt_id, # lam_opt_id, # dof_opt_id, # pids, # dtypes, # dstrings, # app_str ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name[32]

Main Index

942 PCL Reference Manual Examples Element Properties

STRING s_new_name[32] INTEGER i_elem_type_id INTEGER i_geo_opt_id INTEGER i_con_opt_id INTEGER i_for_opt_id INTEGER i_lam_opt_id INTEGER i_dof_opt_id INTEGER ia_pids(5) INTEGER ia_dtypes(5) STRING sa_dstrings[32](5) STRING sv_app_str[VIRTUAL] INTEGER i_return_value STRING sv_create_hpat_xyz_created_ids[VIRTUAL] INTEGER i_create_mesh_solid_num_nodes INTEGER i_create_mesh_solid_num_elems STRING sv_create_mesh_s_nodes_created[VIRTUAL] STRING sv_create_mesh_s_elems_created[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 cuboid i_return_value = @ asm_const_hpat_xyz @ ( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_create_hpat_xyz_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create FEM mesh on solid i_return_value = @ fem_create_mesh_sol @ ( "Solid 1",1.,"Hex8","1", "1","Coord 0", "Coord 0", @ i_create_mesh_solid_num_nodes, @ i_create_mesh_solid_num_elems, @ sv_create_mesh_s_nodes_created, @ sv_create_mesh_s_elems_created ) 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 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", ""] ) dump i_return_value #--------------------------------------------------------------------# Create Element property set i_return_value = @ elementprops_create @ ( "Elem_Prop", 71, 25, 30, 1, 1, 20, [13, 21,4124,4126,@ 4125], [5,4,4, 4, 4],["m:Aluminium","", "", "", ""], @ "Element 1:5" ) dump i_return_value

Main Index

Chapter 5: Property Assignment Functions 943 Element Properties

#--------------------------------------------------------------------# Display Material Name i_return_value = @ elementprops_show @ ( "Material Name", "Marker Plot", ["default_group"] ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Create material "Polycarbonate" i_return_value = @ material.create @ ( "Analysis code ID",1,"Analysis type ID",1, @ "Polycarbonate",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", ["3.9e5", "0.35", "0.042", ""] ) dump i_return_value #--------------------------------------------------------------------# Modify element property set "Elem_Prop" s_name s_new_name i_elem_type_id i_geo_opt_id i_con_opt_id i_for_opt_id i_lam_opt_id i_dof_opt_id ia_pids ia_dtypes sa_dstrings(1) sv_app_str

= = = = = = = = = = = =

"Elem_Prop" "Elem_Prop" 71 25 30 1 1 20 [13, 21, 4124, 4126, 4125] [5, 4, 4, 4, 4] "m:Polycarbonate" "Element 1 2"

i_return_value= elementprops_modify ( s_name, s_new_name, i_elem_type_id, i_geo_opt_id, i_con_opt_id, i_for_opt_id, i_lam_opt_id, i_dof_opt_id, ia_pids, ia_dtypes, sa_dstrings, sv_app_str ) dump i_return_value

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

#--------------------------------------------------------------------# Display Material Name dump i_return_value i_return_value = @ elementprops_show @ ( "Material Name", "Marker Plot", ["default_group"] ) dump i_return_value #--------------------------------------------------------------------# Free allocated memory

Main Index

944 PCL Reference Manual Examples Element Properties

sys_free_string( sv_app_str) sys_free_string( sv_create_hpat_xyz_created_ids) sys_free_string( sv_create_mesh_s_nodes_created) sys_free_string( sv_create_mesh_s_elems_created) #---------------------------------------------------------------------

elementprops_show

()

# # Purpose : This file provides an example of 2 calls to the # function elementprops_show() # # This function displays element property values. # # In this example a new database is opened. A # cuboid of dimension 5 X 1 X 1 is created and # meshed. Then a material("Aluminium") and an # element property("Elem_Prop") is created. # The Material name is displayed and after # a pause the name of element property is # displayed 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 elementprops_show() # has the following arguments: # # elementprops_show # ( prop_name, # disp_type, # grp_names ) # #--------------------------------------------------------------------# Variable Declarations STRING s_prop_name[32] STRING s_disp_type[32] STRING sa_grp_names[32](1) INTEGER i_return_value STRING sv_create_hpat_xyz_created_ids[VIRTUAL] INTEGER i_create_mesh_solid_num_nodes INTEGER i_create_mesh_solid_num_elems STRING sv_create_mesh_s_nodes_created[VIRTUAL] STRING sv_create_mesh_s_elems_created[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 cuboid i_return_value = @ asm_const_hpat_xyz @ ( "1", "<5 1 1>", "[0 0 0]", "Coord 0", @ sv_create_hpat_xyz_created_ids ) dump i_return_value #--------------------------------------------------------------------# Create FEM mesh on solid

Main Index

Chapter 5: Property Assignment Functions 945 Element Properties

i_return_value = fem_create_mesh_sol ( "Solid 1",1.,"Hex8","1", "1","Coord 0", "Coord 0", i_create_mesh_solid_num_nodes, i_create_mesh_solid_num_elems, sv_create_mesh_s_nodes_created, sv_create_mesh_s_elems_created ) 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 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", ""] ) dump i_return_value #--------------------------------------------------------------------# Create Element property set i_return_value = @ elementprops_create @ ( "Elem_Prop", 71, 25, 30, 1, 1, 20, [13, 21,4124,4126,@ 4125], [5,4,4, 4, 4],["m:Aluminium","", "", "", ""], @ "Element 1:3" ) dump i_return_value #--------------------------------------------------------------------# Display Material Name s_prop_name = "Material Name" s_disp_type = "Marker Plot" sa_grp_names(1) = "default_group" i_return_value = @ elementprops_show @ ( s_prop_name, @ s_disp_type, @ sa_grp_names ) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Display Property Set Name s_prop_name = "Property Set Name" s_disp_type = "Marker Plot" sa_grp_names(1) = "default_group" i_return_value = @ elementprops_show @ ( s_prop_name, @ s_disp_type, @ sa_grp_names ) dump i_return_value #--------------------------------------------------------------------# Free allocated memory sys_free_string( sv_create_hpat_xyz_created_ids) sys_free_string( sv_create_mesh_s_nodes_created) sys_free_string( sv_create_mesh_s_elems_created) #---------------------------------------------------------------------

Main Index

946 PCL Reference Manual Examples Beam Library

Beam Library This section contains examples of some of the functions that pertain to beam properties. .

beam_section_create

()

# # Purpose : This file provides an example of a call to the # function beam_section_create() # # This function creates a new beam section with # the given beam shape and a list of dimensions. # # In this example a new database is opened and # paused. The user is instructed to check the # listing of available beam sections. Then a beam # of T-section (BEAM_SECTION_1) is created and # the listing of beam-sections is once again # checked. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function beam_section_create() # has the following arguments: # # beam_section_create # ( name, # shape, # dstrings ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name[32] STRING s_shape[8] STRING sa_dstrings[32](4) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Follow the given direction to get a list of "Beam Section" # available in database. # # 1. Pick "Properties" of Application-radio button. # 2. Select "1D" against "Dimension", in the Element Properties form # 3. Press "Input Properties..." and activate the databox # against "Section Name" in the appearing form # # The above selection displays the list of sections available in # the database in the list box titled "Beam Section" just above # the "OK" button. # # Close the forms by picking "Properties" of Application-radio button # and resume the working. #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Create beam section "BEAM_SECTION_1"

Main Index

Chapter 5: Property Assignment Functions 947 Beam Library

s_name s_shape sa_dstrings(1) sa_dstrings(2) sa_dstrings(3) sa_dstrings(4)

= = = = = =

"BEAM_SECTION_1" "T" "5.0" "5.0" "1.0" "1.0"

i_return_value = beam_section_create ( s_name, s_shape, sa_dstrings ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Check the listing of "Beam Section" as instructed before. # # It can be observed that the "BEAM_SECTION_1" appearing on the list. #---------------------------------------------------------------------

beam_section_delete

()

# # Purpose : This file provides an example of a call to # the function beam_section_delete() # # This function deletes a list of beams. # # In this example a new database is opened and 2 # beam-sections (BEAM_1 & BEAM_2) are created. # The session is paused and the user is # instructed to check the listing of available # beam sections. After resuming, BEAM_1 is # deleted using this function and the listing of # available beam sections is once again checked. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function beam_section_delete() # has the following arguments: # # beam_section_delete # ( section_names ) # #--------------------------------------------------------------------# Variable Declarations STRING sa_section_names[32](1) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create beam section "BEAM_1" & "BEAM_2" i_return_value = @ beam_section_create("BEAM_1", "T",["5.0", "5.0", "1.0", "1.0"]) dump i_return_value i_return_value = @ beam_section_create("BEAM_2", "L",["5.0", "5.0", "1.0", "1.0"]) dump i_return_value

Main Index

948 PCL Reference Manual Examples Beam Library

#--------------------------------------------------------------------# Follow the given direction to get a list of "Beam Section" # available in database. # # 1. Pick "Properties" of Application-radio button. # 2. Select "1D" against "Dimension", in the Element Properties form # 3. Press "Input Properties..." and activate the databox # against "Section Name" in the appearing form # # The above selection displays the list of sections available in # the database in the list box titled "Beam Section" just above # the "OK" button. # # Close the forms by picking "Properties" of Application-radio button # and resume the working. #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Delete the "BEAM_1" sa_section_names(1) = "BEAM_1" i_return_value = beam_section_delete ( sa_section_names ) dump i_return_value

@ @

#--------------------------------------------------------------------# Check the listing of "Beam Section" as instructed before. # # It can be observed that the "BEAM_1" not appearing on the list. #---------------------------------------------------------------------

beam_section_display

()

# # Purpose : This file provides an example of a call to the # function beam_section_display() # # This function creates a new beam section with # the given beam shape and a list of dimensions. # # In this example a new database is opened and a # beam of T-section ("BEAM_1") is created # and displayed 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 beam_section_display() # has the following arguments: # # beam_section_display # ( shape, # name, # dstrings, # ent_or_loc, # sel_string, # c1 ) # #--------------------------------------------------------------------# Variable Declarations

Main Index

Chapter 5: Property Assignment Functions 949 Beam Library

STRING s_shape[8] STRING s_name[32] STRING sa_dstrings[32](4) STRING s_ent_or_loc[8] STRING s_sel_string[8] REAL r_c1 INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create beam section "BEAM_1" i_return_value = @ beam_section_create("BEAM_1", "T",["5.0", "5.0", "1.0", "1.0"]) dump i_return_value #--------------------------------------------------------------------# Display beam section "BEAM_1" s_shape s_name sa_dstrings(1) sa_dstrings(2) sa_dstrings(3) sa_dstrings(4) s_ent_or_loc s_sel_string r_c1

= = = = = = = = =

"T" "BEAM_1" "5.0" "5.0" "1.0" "1.0" "" "" 0.0

i_return_value = beam_section_display ( s_shape, s_name, sa_dstrings, s_ent_or_loc, s_sel_string, r_c1 ) dump i_return_value

@ @ @ @ @ @ @

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

()

beam_section_modify # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function beam_section_modify() This function modifies an existing beam section by replacing its name, shape and dimension In this example a new database is opened and a beam of T-section ("BEAM_ORIGINAL") is created and paused. The user is then instructed to observe the listing of available beam-sections. After a pause the dimension and the name of "BEAM_ORIGINAL" are modified and the listing of available beam sections is once again checked. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

950 PCL Reference Manual Examples Beam Library

# The function beam_section_modify() # has the following arguments: # # beam_section_modify # ( old_name, # new_name, # shape, # dstrings ) # #--------------------------------------------------------------------# Variable Declarations STRING s_old_name[32] STRING s_new_name[32] STRING s_shape[8] STRING sa_dstrings[32](4) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create beam section "BEAM_ORIGINAL" s_old_name s_shape sa_dstrings(1) sa_dstrings(2) sa_dstrings(3) sa_dstrings(4)

= = = = = =

"BEAM_ORIGINAL" "T" "5.0" "5.0" "1.0" "1.0"

i_return_value = beam_section_create ( s_old_name, s_shape, sa_dstrings ) dump i_return_value

@ @

#--------------------------------------------------------------------# Follow the given direction to get a list of "Beam Section" # available in database. # # 1. Pick "Properties" of Application-radio button. # 2. Select "1D" against "Dimension", in the Element Properties form # 3. Press "Input Properties..." and activate the databox # against "Section Name" in the appearing form # # The above selection displays the list of sections available in # the database in the list box titled "Beam Section" just above # the "OK" button. # # Close the forms by picking "Properties" of Application-radio button # and resume the working. #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Modify "BEAM_1" s_new_name sa_dstrings(1) sa_dstrings(2) sa_dstrings(3) sa_dstrings(4)

= = = = =

"BEAM_MODIFIED" "10.0" "10.0" "1.0" "1.0"

i_return_value = beam_section_modify ( s_old_name, s_new_name, s_shape,

Main Index

@ @ @ @ @

Chapter 5: Property Assignment Functions 951 Beam Library

sa_dstrings ) dump i_return_value #--------------------------------------------------------------------# Check the listing of "Beam Section" as instructed before. # # It can be observed that the beam-section,"BEAM_ORIGINAL" being # replaced with "BEAM_MODIFIED" #---------------------------------------------------------------------

()

beam_section_report

# # Purpose : This file provides an example of a call to the # function beam_section_report() # # This function writes the given information of # a beam section and the calculated section # properties to the report file. # # In this example a new database is opened and a # beam section (BEAM_1) is created. Then the # session file is paused for user to input report # file name. Finally this function is called to # write mass properties to the report file. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function beam_section_report() # has the following arguments: # # beam_section_report # ( shape, # name, # dstrings, # ent_or_loc, # sel_string, # c1 ) # #--------------------------------------------------------------------# Variable Declarations STRING s_shape[8] STRING s_name[32] STRING sa_dstrings[32](4) STRING s_ent_or_loc[32] STRING s_sel_string[32] REAL r_c1 INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create beam section "BEAM_1" s_name s_shape sa_dstrings(1) sa_dstrings(2) sa_dstrings(3) sa_dstrings(4)

Main Index

= = = = = =

"BEAM_1" "T" "5.0" "5.0" "1.0" "1.0"

952 PCL Reference Manual Examples Beam Library

i_return_value = beam_section_create ( s_name, s_shape, sa_dstrings ) dump i_return_value

@ @

#--------------------------------------------------------------------# Follow the given instruction for the input of report file name # # 1. Pick "File" from the menu bar # 2. Select "Report" # 3. Input the name of the report file as "BEAM_1.rpt" # 4. Press "Apply" and "Cancel" # # Pick "Resume" for session file play # #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Write beam properties to file "BEAM_1.rpt" s_ent_or_loc s_sel_string r_c1

= "" = "" = 0.0

i_return_value = beam_section_report ( s_shape, s_name, s_dstrings, s_ent_or_loc, s_sel_string, r_c1 ) dump i_return_value

@ @ @ @ @ @ @

# It can be observed that a new report file (BEAM_1.rpt) is # created in the current directory. This file contains the # properties of BEAM_1. #---------------------------------------------------------------------

Main Index

Chapter 5: Property Assignment Functions 953 Materials

Materials This section contains examples of some of the functions that pertain to material composites. .

material.create

()

# # Purpose : This file provides an example of a call to the # function material.create() # # This function creates a material in the # database. # # In this example a new database is opened and # a material (Aluminium) is created using this # function. The number of materials present in # the database is obtained, before and after the # calling of this function for verification. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function material.create() # has the following arguments: # # material.create # ( analysis_code_str, # analysis_code_id, # analysis_type_str, # analysis_type_id, # mat_name, # mat_id, # description, # mat_cat, # mat_cat_id, # dir_str, # dir_id, # lin_str, # lin_id, # mat_type_name, # mat_type_id, # cm_name, # cm_id, # opt_str, # opt_names, # opt_ids, # act_str, # act_flag, # action, # mat_exist, # ext_flag_str, # ext_flag, # prop_ids_str, # prop_names, # prop_ids, # string_va_str, # prop_values ) # #--------------------------------------------------------------------# Variable Declarations STRING s_analysis_code_str[64] INTEGER i_analysis_code_id

Main Index

954 PCL Reference Manual Examples Materials

STRING s_analysis_type_str[64] INTEGER i_analysis_type_id STRING s_mat_name[64] INTEGER i_mat_id STRING s_description[64] STRING s_mat_cat[64] INTEGER i_mat_cat_id STRING s_dir_str[64] INTEGER i_dir_id STRING s_lin_str[64] INTEGER i_lin_id STRING s_mat_type_name[64] INTEGER i_mat_type_id STRING s_cm_name[64] INTEGER i_cm_id STRING s_opt_str[64] STRING sa_opt_names[64](5) INTEGER ia_opt_ids(5) STRING s_act_str[64] INTEGER i_act_flag STRING s_action[64] INTEGER i_mat_exist STRING s_ext_flag_str[64] LOGICAL l_ext_flag STRING s_prop_ids_str[64] STRING sa_prop_names[64](3) INTEGER ia_prop_ids(4) STRING s_string_va_str[64] STRING sa_prop_values[64](4) INTEGER i_return_value INTEGER i_count #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Count the number of materials before creation of material i_return_value = db_count_materials ( i_count ) dump i_return_value dump i_count

@

#--------------------------------------------------------------------# Create Material "Aluminium" s_analysis_code_str i_analysis_code_id s_analysis_type_str i_analysis_type_id s_mat_name i_mat_id s_description s_mat_cat i_mat_cat_id s_dir_str i_dir_id s_lin_str i_lin_id s_mat_type_name i_mat_type_id s_cm_name i_cm_id s_opt_str sa_opt_names(1) sa_opt_names(2) sa_opt_names(3)

Main Index

= = = = = = = = = = = = = = = = = = = = =

"Analysis code ID" 1 "Analysis type ID" 1 "Aluminium" 0 "" "Isotropic" 1 "Directionality" 1 "Linearity" 1 "Homogeneous" 0 "Linear Elastic" 1 "Model Options & IDs" "" "" ""

Chapter 5: Property Assignment Functions 955 Materials

sa_opt_names(4) sa_opt_names(5) ia_opt_ids s_act_str i_act_flag s_action i_mat_exist s_ext_flag_str l_ext_flag s_prop_ids_str sa_prop_names(1) sa_prop_names(2) sa_prop_names(3) ia_prop_ids s_string_va_str sa_prop_values(1) sa_prop_values(2) sa_prop_values(3) sa_prop_values(4)

= = = = = = = = = = = = = = = = = = =

"" "" [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.31" "0.1" ""

i_return_value = material.create ( s_analysis_code_str, i_analysis_code_id, s_analysis_type_str, i_analysis_type_id, s_mat_name, i_mat_id, s_description, s_mat_cat, i_mat_cat_id, s_dir_str, i_dir_id, s_lin_str, i_lin_id, s_mat_type_name, i_mat_type_id, s_cm_name, i_cm_id, s_opt_str, sa_opt_names, ia_opt_ids, s_act_str, i_act_flag, s_action, i_mat_exist, s_ext_flag_str, l_ext_flag, s_prop_ids_str, sa_prop_names, ia_prop_ids, s_string_va_str, sa_prop_values ) dump i_return_value

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

#--------------------------------------------------------------------# Count the number of materials after creation of material i_return_value = @ db_count_materials ( i_count ) dump i_return_value dump i_count #---------------------------------------------------------------------

Main Index

956 PCL Reference Manual Examples Materials

mat_create_lam

()

# # Purpose : This file provides an example of a call to the # function mat_create_lam() # # This function creates a laminated composite # material in the database given the stacking # sequence. # # In this example a new database is opened and # two materials (MAT_1 and MAT_2) are created. # Then this function is called to create a # laminate composite (COMPOSITE_LAMINATE) with # MAT_1 and MAT_2 as ply materials. # The number of materials present in the database # is obtained, before and after the calling of # this function for verification. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function mat_create_lam() # has the following arguments: # # mat_create_lam # ( mat_name, # description, # iconv, # ply_names, # thicks, # orients, # num_names, # offset_string, # action ) # #--------------------------------------------------------------------# Variable Declarations STRING s_mat_name[32] STRING s_description[32] INTEGER i_iconv STRING sa_ply_names[32](6) REAL ra_thicks(6) REAL ra_orients(6) INTEGER i_num_names STRING s_offset_string[32] STRING s_action[32] INTEGER i_return_value INTEGER i_count #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create Material "MAT_1" & "MAT_2" 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, @

Main Index

Chapter 5: Property Assignment Functions 957 Materials

"Property IDs", ["Elastic Modulus", "Poisson Ratio", @ "Density"], [2, 5, 16,0],"Property Values",["10E6","0.31",@ "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.32",@ "0.2", ""] ) dump i_return_value #--------------------------------------------------------------------# Count the number of materials before creation of material i_return_value = db_count_materials ( i_count ) dump i_return_value dump i_count #--------------------------------------------------------------------# Create Laminate "COMPOSITE_LAMINATE" s_mat_name s_description i_iconv sa_ply_names(1) sa_ply_names(2) sa_ply_names(3) sa_ply_names(4) sa_ply_names(5) sa_ply_names(6) ra_thicks ra_orients i_num_names s_offset_string s_action

= = = = = = = = = = = = = =

"COMPOSITE_LAMINATE" "" 1 "MAT_1" "MAT_2" "MAT_1" "MAT_2" "MAT_1" "MAT_2" [0.01, 0.02, 0.01, 0.02,0.01, 0.02] [-60., 0., -60., 0., -60., 0.] 6 "" "Create"

i_return_value = mat_create_lam ( s_mat_name, s_description, i_iconv, sa_ply_names, ra_thicks, ra_orients, i_num_names, s_offset_string, s_action ) dump i_return_value

@ @ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Count the number of materials after creation of material i_return_value = db_count_materials ( i_count ) dump i_return_value dump i_count #---------------------------------------------------------------------

()

mat_create_mix # #

Main Index

Purpose

:

This file provides an example of a call to the

958 PCL Reference Manual Examples Materials

# function mat_create_mix() # # This function creates a Rule-of-mixture # material in the database. # # In this example a new database is opened and # two materials (MAT_1 and MAT_2) are created. # Then this function is called to create a # Rule-of-mixture material(COMPOSITE_RULE_OF_MIX) # with MAT_1 and MAT_2 as constituent materials. # The number of materials present in the database # is obtained before and after the calling of # this function for verification. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function mat_create_mix() # has the following arguments: # # mat_create_mix # ( mat_name, # description, # phase_string, # vf_string, # orient_string, # action ) # #--------------------------------------------------------------------# Variable Declarations STRING s_mat_name[32] STRING s_description[32] STRING s_phase_string[32] STRING s_vf_string[32] STRING s_orient_string[32] STRING s_action[32] INTEGER i_return_value INTEGER i_count #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create Material "MAT_1" & "MAT_2" 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.31",@ "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.32",@ "0.2", ""] )

Main Index

Chapter 5: Property Assignment Functions 959 Materials

dump i_return_value #--------------------------------------------------------------------# Count the number of materials after creation of material i_return_value = db_count_materials ( i_count ) dump i_return_value dump i_count #--------------------------------------------------------------------# Create Composite "COMPOSITE_RULE_OF_MIX" s_mat_name s_description s_phase_string s_vf_string s_orient_string s_action

= = = = = =

"COMPOSITE_RULE_OF_MIX" "" "MAT_1 MAT_2" "0.5 0.5" "10.0 20.0 30. 40. 50. 60." "Create"

i_return_value = mat_create_mix ( s_mat_name, s_description, s_phase_string, s_vf_string, s_orient_string, s_action ) dump i_return_value

@ @ @ @ @ @ @

#--------------------------------------------------------------------# Count the number of materials after creation of material i_return_value = db_count_materials ( i_count ) dump i_return_value dump i_count #---------------------------------------------------------------------

()

mat_hal_create # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function mat_hal_create() This function creates a Halpin-Tsai material in the database. In this example a new database is opened and two materials (ISO_MAT and ANISO_MAT) are created. Then this function is called to create a Halpin-Tsai material (Halpin_Tsai_CFC) with ANISO_MAT as fiber and ISO_MAT as matrix. The number of materials present in the database is obtained, before and after the calling of this function for verification. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function mat_hal_create() has the following arguments: mat_hal_create ( mat_name, description,

960 PCL Reference Manual Examples Materials

# iopt, # fvf, # mvf, # theory, # aspect_ratios, # override, # fudge_factors, # fiber_name, # matrix_name, # action ) # #--------------------------------------------------------------------# Variable Declarations STRING s_mat_name[32] STRING s_description[32] INTEGER i_iopt REAL r_fvf REAL r_mvf INTEGER i_theory STRING sa_aspect_ratios[32](2) LOGICAL l_override STRING sa_fudge_factors[32](7) STRING s_fiber_name[64] STRING s_matrix_name[64] STRING s_action[64] INTEGER i_return_value INTEGER i_count #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create Material "ISO_MAT" & "ANISO_MAT" i_return_value = @ material.create("Analysis code ID", 1, "Analysis type ID",1, @ "ISO_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.31",@ "0.1", ""] ) dump i_return_value i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1, "ANISO_MAT",0,"", "3d Anisotropic", 3,"Directionality",@ 3, "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", ["Stiffness 11", "Stiffness 12", @ "Stiffness 13","Stiffness 14","Stiffness 15", @ "Stiffness 16", "Stiffness 22", "Stiffness 23", @ "Stiffness 24", "Stiffness 25", "Stiffness 26", @ "Stiffness 33", "Stiffness 34", "Stiffness 35", @ "Stiffness 36", "Stiffness 44", "Stiffness 45", @ "Stiffness 46", "Stiffness 55", "Stiffness 56", @ "Stiffness 66", "Density", "Thermal Expan. Coeff", @ "Thermal Expan. Coeff 22", "Thermal Expan. Coeff 33", @ "Thermal Expan. Coeff 12", "Thermal Expan. Coeff 31", @ "Thermal Expan. Coeff 23", "Reference Temperature"], @ [54, 55, 56, 66, 67, 68, 57, 58, 69, 70, 71, 59, 72, 73, @ 74, 60, 61, 62, 63, 64, 65, 16, 24, 25, 26, 27, 29, 28, 1,@ 0], "Property Values", ["0.11", "0.12", "0.13", "0.14", @ "0.15", "0.16", "0.22", "0.23", "0.24", "0.25", "0.26", @ "0.33", "0.34", "0.35", "0.36", "0.44", "0.45", "0.46", @ "0.55", "0.56", "0.66", "0.1", "0.11", "0.22", "0.33", @

Main Index

Chapter 5: Property Assignment Functions 961 Materials

"0.12", "0.31", "0.23", "20.0", ""] ) dump i_return_value #--------------------------------------------------------------------# Count the number of materials after creation of material i_return_value = db_count_materials ( i_count ) dump i_return_value dump i_count #--------------------------------------------------------------------s_mat_name s_description i_iopt r_fvf r_mvf i_theory l_override s_fiber_name s_matrix_name s_action

= = = = = = = = = =

"Halpin_Tsai_CFC" "" 1 0.5 0.5 1 FALSE "ANISO_MAT" "ISO_MAT" "Create"

i_return_value = mat_hal_create ( s_mat_name, s_description, i_iopt, r_fvf, r_mvf, i_theory, sa_aspect_ratios, l_override, sa_fudge_factors, s_fiber_name, s_matrix_name, s_action ) dump i_return_value

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

#--------------------------------------------------------------------# Count the number of materials after creation of material i_return_value = db_count_materials ( i_count ) dump i_return_value dump i_count #---------------------------------------------------------------------

()

mat_sfc_create # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function mat_sfc_create() This function creates a Short Fiber Composite in the database. In this example a new database is opened and a material (MAT_2D_ORTHO) is created. Then this function is called to create a Short Fiber Composite material (MAT_SFC) with MAT_2D_ORTHO as the phase material. The number of materials present in the database is obtained, before and after the calling of this function for verification.

962 PCL Reference Manual Examples Materials

# This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function mat_sfc_create() # has the following arguments: # # mat_sfc_create # ( mat_name, # description, # iopt, # mo1, # mo2, # sd1, # sd2, # col, # niter, # uni_mat_name, # action ) # #--------------------------------------------------------------------# Variable Declarations STRING s_mat_name[32] STRING s_description[32] INTEGER i_iopt REAL r_mo1 REAL r_mo2 REAL r_sd1 REAL r_sd2 REAL r_col INTEGER i_niter STRING s_uni_mat_name[32] STRING s_action[32] INTEGER i_return_value INTEGER i_count #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create Material "MAT_2D_ORTHO" i_return_value = @ material.create( "Analysis code ID", 1, "Analysis type ID", @ 1,"MAT_2D_ORTHO",0,"","2d Orthotropic",5,"Directionality",@ 4, "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","Elastic Modulus 22", @ "Poisson Ratio", "Shear Modulus", "Shear Modulus 23", @ "Shear Modulus 31", "Density", "Thermal Expan. Coeff", @ "Thermal Expan. Coeff 22"], [2, 3, 5, 8, 9, 10, 16, 24, @ 25, 0], "Property Values", ["0.11", "0.22", "0.12","0.12",@ "0.23", "0.13", "0.1", "0.11", "0.22", ""] ) dump i_return_value #--------------------------------------------------------------------# Count the number of materials after creation of material i_return_value = db_count_materials ( i_count ) dump i_return_value dump i_count #--------------------------------------------------------------------# Create

Main Index

Chapter 5: Property Assignment Functions 963 Materials

s_mat_name s_description i_iopt r_mo1 r_mo2 r_sd1 r_sd2 r_col i_niter s_uni_mat_name s_action

= = = = = = = = = = =

"MAT_SFC" "" 1 0.0 0.0 10. 0.0 0.0 1000 "MAT_2D_ORTHO" "Create"

i_return_value = mat_sfc_create ( s_mat_name, s_description, i_iopt, r_mo1, r_mo2, r_sd1, r_sd2, r_col, i_niter, s_uni_mat_name, s_action ) dump i_return_value

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

#--------------------------------------------------------------------# Count the number of materials after creation of material i_return_value = db_count_materials ( i_count ) dump i_return_value dump i_count #---------------------------------------------------------------------

Main Index

964 PCL Reference Manual Examples Load Cases

Load Cases This section contains examples of some of the functions that pertain to load cases. loadcase_create

()

# # Purpose : This file provides an example of a call to the # function loadcase_create() # # This function creates a new load case. # # In this example a new database is opened and # paused for the user to observe the Load Cases # Form. On resuming, this function is called # to create a new load case ("NEW_LOAD_CASE"), # which appears immediately in the load-cases # form. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function loadcase_create() # has the following arguments: # # loadcase_create # ( lc_name, # lc_type, # lc_desc, # lbc_names, # priorities, # dlname, # dynamic_value, # make_current ) # #--------------------------------------------------------------------# Variable Declarations STRING s_lc_name[32] STRING s_lc_type[32] STRING s_lc_desc[32] STRING sa_lbc_names[32](1) INTEGER ia_priorities(32) STRING s_dlname[32] REAL r_dynamic_value LOGICAL l_make_current INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Activate "Load Cases" of Application radio button and observe # the names of available load cases # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Create Load case "NEW_LOAD_CASE" s_lc_name = "NEW_LOAD_CASE" s_lc_type = "Static" s_lc_desc = "Example load case"

Main Index

Chapter 5: Property Assignment Functions 965 Load Cases

s_dlname r_dynamic_value l_make_current

= "" = 0.0 = TRUE

i_return_value = loadcase_create ( s_lc_name, s_lc_type, s_lc_desc, sa_lbc_names, ia_priorities, s_dlname, r_dynamic_value, l_make_current ) dump i_return_value

@ @ @ @ @ @ @ @ @

# Note the changes in the Load Cases form #---------------------------------------------------------------------

loadcase_delete

()

# # Purpose : This file provides an example of a call to the # function loadcase_delete() # # This function deletes the specified load case. # # In this example a new database is opened and # 2 load cases (LOAD_CASE_ONE, LOAD_CASE_TWO) # are created. After a pause this function is # called to delete "LOAD_CASE_ONE". The # deletion is confirmed by observing the Load # Cases Form before and after 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 loadcase_delete() # has the following arguments: # # loadcase_delete # ( lc_name, # del_lbcs ) # #--------------------------------------------------------------------# Variable Declarations STRING s_lc_name[16] LOGICAL l_del_lbcs INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create Load case "LOAD_CASE_ONE" and "LOAD_CASE_TWO" i_return_value = loadcase_create( "LOAD_CASE_ONE", "Static", @ "", [""], [0], "", 0.0, FALSE) dump i_return_value i_return_value = loadcase_create( "LOAD_CASE_TWO", "Static", "", [""], [0], "", 0.0, FALSE) dump i_return_value

Main Index

@

966 PCL Reference Manual Examples Load Cases

#--------------------------------------------------------------------# Activate "Load Cases" of Application radio button and observe # the names of available load cases # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Delete load case "LOAD_CASE_ONE" s_lc_name = "LOAD_CASE_ONE" l_del_lbcs = FALSE i_return_value = loadcase_delete ( s_lc_name, l_del_lbcs ) dump i_return_value

@ @ @

# Refresh all forms that are currently visible ui_wid_refresh() # Note the changes in the Load Cases form. #---------------------------------------------------------------------

loadcase_modify

()

# # Purpose : This file provides an example of a call to the # function loadcase_modify() # # This function modifies a load case in the # database. # # In this example a new database is opened and # a cuboid is created with 2 load sets. Then a # load case(NEW_LOAD_CASE) is created and the # session file is paused for observation of # Load-Cases Form. On resuming, NEW_LOAD_CASE # is modified 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 loadcase_modify() # has the following arguments: # # loadcase_modify # ( old_name, # new_name, # lc_type, # lc_desc, # lbc_names, # priorities, # dlname, # dynamic_value, # make_current ) # #--------------------------------------------------------------------# Variable Declarations STRING s_old_name[32] STRING s_new_name[32] STRING s_lc_type[32] STRING s_lc_desc[64] STRING sa_lbc_names[32](2)

Main Index

Chapter 5: Property Assignment Functions 967 Load Cases

INTEGER ia_priorities(2) STRING s_dlname[32] REAL r_dynamic_value LOGICAL l_make_current INTEGER i_return_value STRING sv_create_hpat_xyz_created_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 #--------------------------------------------------------------------# Create Cuboid ( 10 X 1 X 1 ) i_return_value = asm_const_hpat_xyz( "1", "<10 1 1>", "[0 0 0]",@ "Coord 0", sv_create_hpat_xyz_created_ids ) dump i_return_value # Create Load/BC set "NEW_DISP" and "NEW_FORCE" i_return_value = loadsbcs_create( "NEW_DISP", "Displacement", "Nodal", "", "Static", ["Point 1 2 5 6"], "Geometry", "Coord 0", 1., ["< 0. 0. 0. >", "< 0. 0. 0. >"], ["", ""] ) dump i_return_value

@ @

i_return_value = loadsbcs_create( "NEW_FORCE", "Force", "Nodal",@ "", "Static", ["Point 3 7"], "Geometry", "Coord 0", 1., @ ["< 0 -100 0 >", "< 0. 0. 0. >"], ["", ""] ) dump i_return_value #--------------------------------------------------------------------# Create Load case "NEW_LOAD_CASE" i_return_value = loadcase_create( "NEW_LOAD_CASE", "Static", "",@ [""], [0], "", 0.0, FALSE ) dump i_return_value #--------------------------------------------------------------------# Activate "Load Cases" of Application radio button and set action # to "Show". Observe the name of current load case and the list of # available load cases # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Modify load case "NEW_LOAD_CASE" s_old_name s_new_name s_lc_type s_lc_desc sa_lbc_names(1) sa_lbc_names(2) ia_priorities s_dlname r_dynamic_value l_make_current

= = = = = =

"NEW_LOAD_CASE" "MODIFIED_LOAD_CASE" "Static" "Modified Load case" "NEW_DISP" "NEW_FORCE" = [ 0, 0] = "" = 0.0 = TRUE

i_return_value = loadcase_modify ( s_old_name, s_new_name, s_lc_type, s_lc_desc, sa_lbc_names, ia_priorities, s_dlname,

Main Index

@ @ @ @ @ @ @ @ @

968 PCL Reference Manual Examples Load Cases

r_dynamic_value, l_make_current ) dump i_return_value

@

#--------------------------------------------------------------------# Note the changes in the Loadcase form sys_free_string(sv_create_hpat_xyz_created_ids) #---------------------------------------------------------------------

loadcase_show

()

# # Purpose : This file provides an example of a call to the # function loadcase_show() # # This function shows/displays the specified # load-case in a form. # # In this example a new database is opened and # a load case is created. Then this function is # called to display the details of created load # case. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function loadcase_show() has the following arguments: # # loadcase_show # ( lc_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_lc_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create Load case "NEW_LOAD_CASE" i_return_value = loadcase_create( "NEW_LOAD_CASE", "Static", "",@ [""], [0], "", 0.0, FALSE) dump i_return_value #--------------------------------------------------------------------# Show Load case "NEW_LOAD_CASE" s_lc_name = "NEW_LOAD_CASE" i_return_value = loadcase_show ( s_lc_name ) dump i_return_value

@ @

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

Main Index

Chapter 5: Property Assignment Functions 969 Fields

Fields This section contains examples of some of the functions that pertain to fields. fields_create

()

# # Purpose : This file provides an example of a call to the # function fields_create() # # This function creates a new field. # # In this example a new database is opened and # a field is created. The field is showed 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 fields_create() # has the following arguments: # # fields_create # ( name, # obj_type, # extrap_method, # type, # coord_type, # coord, # geom_entity, # defn_type, # nvar, # ivar1, # ivar2, # ivar3, # fn1, # fn2, # fn3, # lin_def, # vals_1, # vals_2, # vals_3, # vals ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name[32] STRING s_obj_type[32] INTEGER i_extrap_method STRING s_type[32] STRING s_coord_type[32] STRING s_coord[32] STRING s_geom_entity[32] STRING s_defn_type[32] INTEGER i_nvar STRING s_ivar1[32] STRING s_ivar2[32] STRING s_ivar3[32] STRING s_fn1[32] STRING s_fn2[32] STRING s_fn3[32] LOGICAL l_lin_def

Main Index

970 PCL Reference Manual Examples Fields

REAL ra_vals_1(5) REAL ra_vals_2(1) REAL ra_vals_3(1) REAL ra_vals(5,1,1) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create Field s_name s_obj_type i_extrap_method s_type s_coord_type s_coord s_geom_entity s_defn_type i_nvar s_ivar1 s_ivar2 s_ivar3 s_fn1 s_fn2 s_fn3 l_lin_def ra_vals_1 ra_vals

= = = = = = = = = = = = = = = = = =

"NEW_FIELD" "Spatial" 1 "Scalar" "Real" "Coord 0" "" "Table" 1 "X" "" "" "" "" "" FALSE [1., 2., 3., 4., 5.] [[[11.]][[22.]][[33.]][[44.]][[55.]]]

i_return_value = fields_create ( s_name, s_obj_type, i_extrap_method, s_type, s_coord_type, s_coord, s_geom_entity, s_defn_type, i_nvar, s_ivar1, s_ivar2, s_ivar3, s_fn1, s_fn2, s_fn3, l_lin_def, ra_vals_1, ra_vals_2, ra_vals_3, ra_vals ) dump i_return_value

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

# Show Field i_return_value = fields_show( "NEW_FIELD", "X", 0., 5., 11, 0., @ 0., 0, 0., 0., 0, FALSE, TRUE, 1 ) dump i_return_value #---------------------------------------------------------------------

()

fields_create_general # # # #

Main Index

Purpose

:

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

Chapter 5: Property Assignment Functions 971 Fields

# This function creates a new general field. # # In this example a new database is opened and # paused for the user to observe the Field # Form. On resuming, this function is called # to create a new general field (GENERAL_FIELD), # which appears immediately in the Field # form. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fields_create_general() has the following arguments: # # fields_create_general # ( name, # object, # method, # extrap_method, # coord_type, # coord, # geom_entity, # nvar, # ivar1, # ivar2, # ivar3 ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name[32] INTEGER i_object INTEGER i_method INTEGER i_extrap_method STRING s_coord_type[32] STRING s_coord[32] STRING s_geom_entity[32] INTEGER i_nvar INTEGER i_ivar1 INTEGER i_ivar2 INTEGER i_ivar3 INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Activate "Fields" of Application radio button and observe # the names of available Fields # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Create field "GENERAL_FIELD" s_name i_object i_method i_extrap_method s_coord_type s_coord s_geom_entity i_nvar i_ivar1 i_ivar2 i_ivar3

Main Index

= = = = = = = = = = =

"GENERAL_FIELD" 0 5 2 "Real" "Coord 0" "" 1 1 0 0

972 PCL Reference Manual Examples Fields

i_return_value = fields_create_general ( s_name, i_object, i_method, i_extrap_method, s_coord_type, s_coord, s_geom_entity, i_nvar, i_ivar1, i_ivar2, i_ivar3 ) dump i_return_value

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

# Create term for the general field,"GENERAL_FIELD" i_return_value = fields_create_general_term( s_name, 0, 0, 0, 8,@ "10*’X" ) dump i_return_value # Refresh all forms that are currently visible ui_wid_refresh() # Note the changes in the Fields form #---------------------------------------------------------------------

fields_create_general_term

()

# # Purpose : This file provides an example of a call to the # function fields_create_general_term() # # This function creates a term for a general # field in the database. # # In this example a new database is opened and # a general field (GENERAL_FIELD) is created. # Then this function is called to create a term # for GENERAL_FIELD. The user is instructed to # view the term in Field form. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # # The function fields_create_general_term() has the following # arguments: # # fields_create_general_term # ( name, # term_fld_id, # term_type, # term_id, # data_length, # data ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name[32] INTEGER i_term_fld_id INTEGER i_term_type INTEGER i_term_id INTEGER i_data_length STRING s_data[32]

Main Index

Chapter 5: Property Assignment Functions 973 Fields

INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create field "GENERAL_FIELD" i_return_value = fields_create_general( "GENERAL_FIELD", 0, 5, 2, "Real", "Coord 0", "", 1, 1, 0, 0) dump i_return_value

@

#--------------------------------------------------------------------# Create term for the general field,"GENERAL_FIELD" s_name = "GENERAL_FIELD" i_term_fld_id = 0 i_term_type = 0 i_term_id = 0 i_data_length = 8 s_data = "10*’X" i_return_value = fields_create_general_term ( s_name, i_term_fld_id, i_term_type, i_term_id, i_data_length, s_data ) dump i_return_value

@ @ @ @ @ @ @

# Refresh all forms that are currently visible ui_wid_refresh() #--------------------------------------------------------------------# Activate "Fields" of Application radio button. Then select the # field "GENERAL_FIELD" which shows up a form containing the TERM # in Text box titled - FUNCTION EXPRESSION #---------------------------------------------------------------------

()

fields_create_fem # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fields_create_fem() This function creates a new FEM field in the database. In this example the field database is opened and result-fringe of displacements is posted. Then this function is called to create FEM field using the fringe plot. 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 fields_create_fem() has the following arguments:

974 PCL Reference Manual Examples Fields

# fields_create_fem # ( name, # group, # type, # extrap_method, # coord, # result_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name[32] STRING s_group[32] STRING s_type[32] INTEGER i_extrap_method STRING s_coord[32] INTEGER i_result_flag INTEGER i_return_value #--------------------------------------------------------------------# Open a database "field.db" uil_file_open.go( "field.db" ) i_return_value = ga_view_aa_set( -62.958218, -3.879048, -53.761284 ) dump i_return_value #--------------------------------------------------------------------# Plot result fringe for displacement res_init_fringe_plot(

)

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

)

#--------------------------------------------------------------------# Activate "Field" of Application radio button and observe # the names of available fields # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Create Fem Field s_name = "NEW_FEM_FIELD" s_group = "default_group" s_type = "Scalar" i_extrap_method = 1 s_coord = "Coord 0" i_result_flag = 0 i_return_value = fields_create_fem ( s_name, s_group, s_type, i_extrap_method, s_coord, i_result_flag ) dump i_return_value

@ @ @ @ @ @ @

# Note the changes in the Field form #---------------------------------------------------------------------

Main Index

Chapter 5: Property Assignment Functions 975 Fields

fields_create_lbc

()

# # Purpose : This file provides an example of a call to the # function fields_create_lbc() # # This function creates a new LBC field in the # database. # # In this example a new database is opened and # a cuboid is created. Then this function is # called to create an LBC field and the field # is displayed using function fields_show_lbc(). # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fields_create_lbc() # has the following arguments: # # fields_create_lbc # ( name, # entity_type, # type, # num_entities, # entities, # values ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name[32] STRING s_entity_type[32] STRING s_type[32] INTEGER i_num_entities STRING sa_entities[16](6) STRING sa_values[16](6) INTEGER i_return_value STRING sv_create_hpat_xyz_created_ids[VIRTUAL] INTEGER i_create_mesh_solid_num_nodes INTEGER i_create_mesh_solid_num_elems STRING sv_create_mesh_s_nodes_created[VIRTUAL] STRING sv_create_mesh_s_elems_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 #--------------------------------------------------------------------# Create Cuboid ( 2 X 1 X 1 ) and Hex Mesh i_return_value = asm_const_hpat_xyz( "1", "<2 1 1>", "[0 0 0]", @ "Coord 0", sv_create_hpat_xyz_created_ids ) 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_create_mesh_solid_num_nodes, i_create_mesh_solid_num_elems,@ sv_create_mesh_s_nodes_created, sv_create_mesh_s_elems_created ) # Display node label node_label(TRUE)

Main Index

976 PCL Reference Manual Examples Fields

#--------------------------------------------------------------------# Create LBC Field s_name s_entity_type s_type i_num_entities

= = = =

"LBC_FIELD" "Node" "Scalar" 6

sa_entities(1) sa_entities(2) sa_entities(3) sa_entities(4) sa_entities(5) sa_entities(6)

= = = = = =

"Node "Node "Node "Node "Node "Node

sa_values(1) sa_values(2) sa_values(3) sa_values(4) sa_values(5) sa_values(6)

= = = = = =

4" 5" 6" 10" 11" 12"

"40" "50" "60" "100" "110" "120"

i_return_value = fields_create_lbc ( s_name, s_entity_type, s_type, i_num_entities, sa_entities, sa_values ) dump i_return_value

@ @ @ @ @ @ @

# Show Load/BC field i_return_value = fields_show_lbc( "LBC_FIELD" ) dump i_return_value sys_free_string( sv_create_hpat_xyz_created_ids) sys_free_string( sv_create_mesh_s_nodes_created) sys_free_string( sv_create_mesh_s_elems_created) #---------------------------------------------------------------------

()

fields_delete # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fields_delete() This function deletes an existing field from the database. In this example a new database is opened and paused after creation of a field(NEW_FIELD). The user is instructed to to observe the Field Form. On resuming, this function is called to delete "NEW_FIELD" This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function fields_delete() has the following arguments: fields_delete ( num_fields,

Chapter 5: Property Assignment Functions 977 Fields

# del_fields ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_num_fields STRING sa_del_fields[32](1) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create Field i_return_value = fields_create( "NEW_FIELD", "Spatial", 1, @ "Scalar", "Real", "Coord 0", "", "Table", 1, "X", "", "", "",@ "", "", FALSE, [1., 2., 3., 4., 5.], [0.], [0.], @ [[[11.]][[22.]][[33.]][[44.]][[55.]]] ) dump i_return_value #--------------------------------------------------------------------# Activate "Field" of Application radio button and observe # the names of available fields. # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Delete FEM field i_num_fields = 1 sa_del_fields(1) = "NEW_FIELD" i_return_value = fields_delete ( i_num_fields, sa_del_fields ) dump i_return_value

@ @ @

# Refresh all forms that are currently visible ui_wid_refresh() #---------------------------------------------------------------------

()

fields_modify # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fields_modify() In this example a new database is opened and a field(NEW_FIELD) is created. The field is then displayed. After a pause NEW_FIELD is renamed(MODIFIED_FIELD) and the PCL equation representing the field is changed using this function and displayed 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 fields_modify() has the following arguments: fields_modify ( old_name, new_name, obj_type, extrap_method,

978 PCL Reference Manual Examples Fields

# type, # coord_type, # coord, # geom_entity, # defn_type, # nvar, # ivar1, # ivar2, # ivar3, # fn1, # fn2, # fn3, # lin_def, # vals_1, # vals_2, # vals_3, # vals ) # #--------------------------------------------------------------------# Variable Declarations STRING s_old_name[32] STRING s_new_name[32] STRING s_obj_type[32] INTEGER i_extrap_method STRING s_type[32] STRING s_coord_type[32] STRING s_coord[32] STRING s_geom_entity[32] STRING s_defn_type[32] INTEGER i_nvar STRING s_ivar1[32] STRING s_ivar2[32] STRING s_ivar3[32] STRING s_fn1[32] STRING s_fn2[32] STRING s_fn3[32] LOGICAL l_lin_def REAL ra_vals_1(1) REAL ra_vals_2(1) REAL ra_vals_3(1) REAL ra_vals(1,1,1) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create Field i_return_value = fields_create( "NEW_FIELD", "Spatial", @ 1, "Scalar", "Real", "Coord 0", "", "Function", 1, "X", "", @ "", "10*’X", "", "", FALSE, [0.], [0.], [0.], [[[0.]]] ) dump i_return_value i_return_value = fields_show( "NEW_FIELD", "X", 0., 10., 11, 0.,@ 0., 0, 0., 0., 0, FALSE, TRUE, 1 ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Delete curve "NEW_FIELD" from XY window i_return_value = xy_curve_delete( "NEW_FIELD" ) dump i_return_value # Modify field s_old_name = "NEW_FIELD" s_new_name = "MODIFIED_FIELD"

Main Index

Chapter 5: Property Assignment Functions 979 Fields

s_obj_type i_extrap_method s_type s_coord_type s_coord s_geom_entity s_defn_type i_nvar s_ivar1 s_ivar2 s_ivar3 s_fn1 s_fn2 s_fn3 l_lin_def

= = = = = = = = = = = = = = =

"Spatial" 1 "Scalar" "Real" "Coord 0" "" "Function" 1 "X" "" "" "1111*’X" "" "" FALSE

i_return_value = fields_modify ( s_old_name, s_new_name, s_obj_type, i_extrap_method, s_type, s_coord_type, s_coord, s_geom_entity, s_defn_type, i_nvar, s_ivar1, s_ivar2, s_ivar3, s_fn1, s_fn2, s_fn3, l_lin_def, ra_vals_1, ra_vals_2, ra_vals_3, ra_vals ) dump i_return_value

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

i_return_value = fields_show( "MODIFIED_FIELD", "X", 0., 10., @ 11, 0., 0., 0, 0., 0., 0, FALSE, TRUE, 1 ) dump i_return_value #---------------------------------------------------------------------

()

fields_modify_lbc # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fields_modify_lbc() This function modifies an existing LBC field in the database. In this example a new database is opened and an LBC field is created. The field is then displayed and session is paused. After resuming this function is called to modify the created FEM field. The modified field is displyed 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.

980 PCL Reference Manual Examples Fields

# # The function fields_modify_lbc() has the following arguments: # # fields_modify_lbc # ( old_name, # new_name, # entity_type, # type, # num_entities, # entities, # values ) # #--------------------------------------------------------------------# Variable Declarations STRING s_old_name[32] STRING s_new_name[32] STRING s_entity_type[32] STRING s_type[32] INTEGER i_num_entities STRING sa_entities[32](9) STRING sa_values[32](9) INTEGER i_return_value STRING sv_create_hpat_xyz_created_ids[VIRTUAL] INTEGER i_create_mesh_solid_num_nodes INTEGER i_create_mesh_solid_num_elems STRING sv_create_mesh_s_nodes_created[VIRTUAL] STRING sv_create_mesh_s_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 Cuboid ( 2 X 1 X 1 ) and Hex Mesh i_return_value = asm_const_hpat_xyz( "1", "<2 1 1>", "[0 0 0]", @ "Coord 0", sv_create_hpat_xyz_created_ids ) 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_create_mesh_solid_num_nodes, i_create_mesh_solid_num_elems,@ sv_create_mesh_s_nodes_created, sv_create_mesh_s_elems_created ) # Display node label node_label(TRUE) #--------------------------------------------------------------------# Create Field i_return_value = fields_create_lbc( "LBC_FIELD", "Node", @ "Scalar", 3, ["Node 1", "Node 2", "Node 3"], @ ["10.", "20.", "30."] ) # Show Field i_return_value = fields_show_lbc( "LBC_FIELD" ) dump i_return_value # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Modify field "LBC_FIELD" s_old_name s_new_name s_entity_type

Main Index

= "LBC_FIELD" = "MODIFIED_LBC_FIELD" = "Node"

Chapter 5: Property Assignment Functions 981 Fields

s_type

= "Scalar"

i_num_entities = 9 sa_entities(1) sa_entities(2) sa_entities(3) sa_entities(4) sa_entities(5) sa_entities(6) sa_entities(7) sa_entities(8) sa_entities(9)

= = = = = = = = =

"Node "Node "Node "Node "Node "Node "Node "Node "Node

sa_values(1) sa_values(2) sa_values(3) sa_values(4) sa_values(5) sa_values(6) sa_values(7) sa_values(8) sa_values(9)

= = = = = = = = =

"10" "20" "30" "40" "50" "60" "70" "80" "90"

1" 2" 3" 4" 5" 6" 7" 8" 9"

dump i_return_value i_return_value = fields_modify_lbc ( s_old_name, s_new_name, s_entity_type, s_type, i_num_entities, sa_entities, sa_values ) dump i_return_value

@ @ @ @ @ @ @ @

# Show Field i_return_value = fields_show_lbc( "MODIFIED_LBC_FIELD" ) dump i_return_value sys_free_string( sv_create_hpat_xyz_created_ids) sys_free_string( sv_create_mesh_s_nodes_created) sys_free_string( sv_create_mesh_s_elems_created) #---------------------------------------------------------------------

()

fields_modify_fem # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fields_modify_fem() This function modifies an existing FEM field in the database. In this example the field database is opened and result-fringe of displacements is posted. Then a FEM field is created and paused. After resuming the FEM field is renamed using this function. 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

982 PCL Reference Manual Examples Fields

# menus on the menu bar. # # The function fields_modify_fem() has the following arguments: # # fields_modify_fem # ( old_name, # new_name, # group, # type, # extrap_method, # coord, # results_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_old_name[32] STRING s_new_name[32] STRING s_group[32] STRING s_type[32] INTEGER i_extrap_method STRING s_coord[32] INTEGER i_results_flag INTEGER i_return_value #--------------------------------------------------------------------# Open a database "field.db" uil_file_open.go( "field.db" ) i_return_value = ga_view_aa_set( -62.958218, -3.879048, -53.761284 ) dump i_return_value #--------------------------------------------------------------------# Plot result fringes res_init_fringe_plot(

)

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

)

#--------------------------------------------------------------------# Create Fem Field i_return_value = fields_create_fem( "NEW_FEM_FIELD", @ "default_group", "Scalar", 1, "Coord 0", 0 ) dump i_return_value #--------------------------------------------------------------------# Activate "Fields" of Application radio button and observe # the names of available field # Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Modify Fem Field s_old_name s_new_name s_group s_type i_extrap_method s_coord i_results_flag i_return_value =

Main Index

= = = = = = =

"NEW_FEM_FIELD" "MODIFIED_FEM_FIELD" "default_group" "Scalar" 1 "Coord 0" 0 @

Chapter 5: Property Assignment Functions 983 Fields

fields_modify_fem ( s_old_name, s_new_name, s_group, s_type, i_extrap_method, s_coord, i_results_flag ) dump i_return_value

@ @ @ @ @ @ @

# Note the changes in the field form #---------------------------------------------------------------------

fields_show

()

# # Purpose : This file provides an example of a call to the # function fields_show() # # This function shows an existing field in # tabular and XY plot format. # # In this example a new dabase is opened and a # field is created. Then this function is # called to show the created field. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function fields_show() # has the following arguments: # # fields_show # ( name, # ind_label, # ind_min, # ind_max, # ind_npts, # fixed1_min, # fixed1_max, # fixed1_npts, # fixed2_min, # fixed2_max, # fixed2_npts, # existing_pts_flag, # post_xy_flag, # vect_comp_val ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name[32] STRING s_ind_label[32] REAL r_ind_min REAL r_ind_max INTEGER i_ind_npts REAL r_fixed1_min REAL r_fixed1_max INTEGER i_fixed1_npts REAL r_fixed2_min REAL r_fixed2_max INTEGER i_fixed2_npts LOGICAL l_existing_pts_flag LOGICAL l_post_xy_flag INTEGER i_vect_comp_val

Main Index

984 PCL Reference Manual Examples Fields

INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create Field i_return_value = fields_create( "NEW_FIELD", "Spatial", 1, @ "Scalar", "Real", "Coord 0", "", "Table", 1, "X", "", "", "",@ "", "", FALSE, [1., 2., 3., 4., 5.], [0.], [0.], @ [[[11.]][[22.]][[33.]][[44.]][[55.]]] ) dump i_return_value #--------------------------------------------------------------------# Show Field i_return_value = fields_show( "NEW_FIELD", "X", 0., 5., 11, 0., @ 0., 0, 0., 0., 0, FALSE, TRUE, 1 ) dump i_return_value s_name s_ind_label r_ind_min r_ind_max i_ind_npts l_existing_pts_flag l_post_xy_flag i_vect_comp_val

= = = = = = = =

"NEW_FIELD" "X" 0. 5. 11 FALSE TRUE 1

i_return_value = fields_show ( s_name, s_ind_label, r_ind_min, r_ind_max, i_ind_npts, r_fixed1_min, r_fixed1_max, i_fixed1_npts, r_fixed2_min, r_fixed2_max, i_fixed2_npts, l_existing_pts_flag, l_post_xy_flag, i_vect_comp_val ) dump i_return_value

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

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

()

fields_show_lbc # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function fields_show_lbc() This function shows an LBC field in tabular format. In this example a new database is opened and an LBC field is created. Then this function is called to show the created field. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

Chapter 5: Property Assignment Functions 985 Fields

# The function fields_show_lbc() has the following arguments: # # fields_show_lbc # ( name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_name[32] INTEGER i_return_value STRING sv_create_hpat_xyz_created_ids[VIRTUAL] INTEGER i_create_mesh_solid_num_nodes INTEGER i_create_mesh_solid_num_elems STRING sv_create_mesh_s_nodes_created[VIRTUAL] STRING sv_create_mesh_s_elems_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 #--------------------------------------------------------------------# Create Cuboid ( 2 X 1 X 1 ) and Hex Mesh i_return_value = asm_const_hpat_xyz( "1", "<2 1 1>", "[0 0 0]", @ "Coord 0", sv_create_hpat_xyz_created_ids ) 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_create_mesh_solid_num_nodes, i_create_mesh_solid_num_elems,@ sv_create_mesh_s_nodes_created, sv_create_mesh_s_elems_created ) # Display node label node_label(TRUE) #--------------------------------------------------------------------# Create LBC Field i_return_value = fields_create_lbc( "LBC_FIELD", "Node", @ "Scalar", 6, ["Node 4","Node 5", "Node 6", "Node 10", @ "Node 11", "Node 12"], [ "40", "50", "60", "100", "110", "120"] ) dump i_return_value # Show Load/BC field s_name = "LBC_FIELD" i_return_value = fields_show_lbc ( s_name ) dump i_return_value

@ @

sys_free_string( sv_create_hpat_xyz_created_ids) sys_free_string( sv_create_mesh_s_nodes_created) sys_free_string( sv_create_mesh_s_elems_created) #---------------------------------------------------------------------

Main Index

986 PCL Reference Manual Examples Fields

Main Index

Chapter 6: Results Postprocessing Functions PCL Reference Manual Examples

6

Main Index

Results Postprocessing Functions 

Introduction



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



Animation Functions



Plot Tool Query Functions

988 989

1099 1117

1025

1047 1062

1087

1066

988 PCL Reference Manual Examples Introduction

Introduction This chapter provides examples for functions that are used by the “Results” switch bar form. See Results Postprocessing Functions (Ch. 6) in the PCL Reference Manual for a description of these functions.

Main Index

Chapter 6: Results Postprocessing Functions 989 Results Utility Functions

Results Utility Functions This section contains examples of some of the results utility functions used to extract results data and attributes of results data from the database. res_utl_extract_elem_pos_ids

()

# # Purpose : This file provides an example of a call to the # function res_utl_extract_elem_pos_ids() # # This session file extracts the internal element # position id for the specified element. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_extract_elem_pos_ids() # has the following arguments: # # res_utl_extract_elem_pos_ids # ( res_ids, # elem_list, # count, # ids, # npos, # posids ) # #--------------------------------------------------------------------# Variable Declarations INTEGER ia_res_ids(5) STRING s_elem_list[10] INTEGER i_count INTEGER iv_ids(VIRTUAL) INTEGER iv_npos(VIRTUAL) INTEGER iv_posids(VIRTUAL) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #-------------------------------------------------------------------# Argument initialization ia_res_ids = [3, 1, 2, 1, 1] s_elem_list = "Elem 77" #--------------------------------------------------------------------# Extract the result data for one element i_return_value = @ res_utl_extract_elem_pos_ids @ ( ia_res_ids, @ s_elem_list, @ i_count, @ iv_ids, @ iv_npos, @ iv_posids ) dump i_return_value dump i_count

Main Index

990 PCL Reference Manual Examples Results Utility Functions

# This value shows the number of elements dump iv_ids # This shows list of element ids dump iv_npos # This shows the number of element positions per element dump iv_posids # This shows element position ids for the specified elements sys_free_array(iv_ids) sys_free_array(iv_npos) sys_free_array(iv_posids) #---------------------------------------------------------------------

res_utl_get_elem_pos_loc

()

# # Purpose : This file provides an example of a call to the # function res_utl_get_elem_pos_loc() # # This session file extracts specified results # from the database. It gives XYZ coordinates of # node belonging to specific element. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_get_elem_pos_loc() # has the following arguments: # # res_utl_get_elem_pos_loc # ( elem_id, # param_flag, # epos_id, # location ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_elem_id INTEGER i_param_flag INTEGER i_epos_id REAL ra_location(4) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_elem_id = 100 i_param_flag = 0 i_epos_id = 2 #--------------------------------------------------------------------# Extract element position location for an element i_return_value = @ res_utl_get_elem_pos_loc @ ( i_elem_id, @ i_param_flag, @ i_epos_id, @ ra_location ) dump i_return_value

Main Index

Chapter 6: Results Postprocessing Functions 991 Results Utility Functions

dump ra_location # These are the XYZ coordinates of the 2nd node of element 100. #---------------------------------------------------------------------

res_utl_get_result_info

()

# # Purpose : This file provides an example of a call to the # function res_utl_get_result_info() # # This session file extracts information about # the specified results from the database. It # gives title, number and type of results etc. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_get_result_info() # has the following arguments: # # res_utl_get_result_info # ( res_ids, # title, # nres, # datatype, # assoc, # resloc, # cidflag, # minloc, # maxloc ) # #--------------------------------------------------------------------# Variable Declarations INTEGER ia_res_ids(5) STRING sa_title[80](3) INTEGER i_nres INTEGER i_datatype INTEGER i_assoc INTEGER i_resloc LOGICAL l_cidflag INTEGER iaa_minloc(2,6) INTEGER iaa_maxloc(2,6) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization ia_res_ids = [3, 1, 2, 1, 1] #--------------------------------------------------------------------# Extract information about the specified result case i_return_value = @ res_utl_get_result_info @ ( ia_res_ids, @ sa_title, @ i_nres, @ i_datatype, @ i_assoc, @

Main Index

992 PCL Reference Manual Examples Results Utility Functions

i_resloc, @ l_cidflag, @ iaa_minloc, @ iaa_maxloc ) dump i_return_value dump sa_title # This shows title of the result dump i_nres # This shows total number of results dump i_datatype # This value shows that results are associated with vector dump i_assoc # This value shows that results are associated with nodes dump i_resloc # This value shows the result location dump l_cidflag # This shows that results are defined in non-global system dump iaa_minloc # This shows id and location for each minimum result component dump iaa_maxloc # This shows id and location for each maximum result component #---------------------------------------------------------------------

res_utl_clear_result

()

# # Purpose : This file provides an example of a call to the # function res_utl_clear_result() # # This session file clears previously used # results from memory. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_clear_result() has no arguments. # #--------------------------------------------------------------------# Variable Declarations INTEGER ia_res_ids(5) INTEGER i_type INTEGER i_nids INTEGER ia_ids(1) INTEGER ia_cids(1) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization ia_res_ids = [3, 1, 2, 1, 1] i_type = 1 i_nids = 1 ia_ids = [100] #--------------------------------------------------------------------# Clear any previous results from the memory i_return_value = @ res_utl_clear_result()

Main Index

Chapter 6: Results Postprocessing Functions 993 Results Utility Functions

dump i_return_value #--------------------------------------------------------------------# Extract cids for the specified nodes i_return_value = @ res_utl_get_results_cids @ ( ia_res_ids, i_type, i_nids, ia_ids, ia_cids ) dump i_return_value dump ia_cids #---------------------------------------------------------------------

res_utl_get_result_entities

()

# # Purpose : This file provides an example of a call to the # function res_utl_get_result_entities() # # This session file extracts specified results # from the database. It gives the list of ids for # which specified result exists. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_get_result_entities() # has the following arguments: # # res_utl_get_result_entities # ( res_ids, # id_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER ia_res_ids(5) STRING sv_id_list[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization ia_res_ids = [3, 1, 2, 1, 1] #--------------------------------------------------------------------# Gets the result entities i_return_value = @ res_utl_get_result_entities @ ( ia_res_ids, @ sv_id_list ) dump i_return_value dump sv_id_list # This shows the list of ids for which specified results exists sys_free_string(sv_id_list) #---------------------------------------------------------------------

res_utl_get_result_type #

Main Index

()

994 PCL Reference Manual Examples Results Utility Functions

# Purpose : This file provides an example of a call to the # function res_utl_get_result_type() # # This session file extracts specified results # from the database. It returns a value # which shows the type of result i.e. scaler, # vector or tensor. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_get_result_type() # has the following arguments: # # res_utl_get_result_type # ( res_ids, # type ) # #--------------------------------------------------------------------# Variable Declarations INTEGER ia_res_ids(5) INTEGER i_type INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization ia_res_ids = [3, 1, 2, 1, 1] #--------------------------------------------------------------------# Extract the tupe of result i_return_value = @ res_utl_get_result_type @ ( ia_res_ids, @ i_type ) dump i_return_value dump i_type # This value shows type of result, 1 = scaler, 2 = vector 3 = tensor. #---------------------------------------------------------------------

()

res_utl_get_results_cids # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_utl_get_result_cids() This session file shows cids used for result defined at the specified node. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown

Chapter 6: Results Postprocessing Functions 995 Results Utility Functions

# menus on the menu bar. # # The function res_utl_get_result_cids() # has the following arguments: # # res_utl_get_result_cids # ( res_ids, # type, # nids, # ids, # cids ) # #--------------------------------------------------------------------# Variable Declarations INTEGER ia_res_ids(5) INTEGER i_type INTEGER i_nids INTEGER ia_ids(1) INTEGER ia_cids(1) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization ia_res_ids = [3, 1, 2, 1, 1] i_type = 1 i_nids = 1 ia_ids = [100] #--------------------------------------------------------------------# Clear any previous results from the memory i_return_value = res_utl_clear_result() dump i_return_value #--------------------------------------------------------------------# Extract cids for the specified nodes i_return_value = @ res_utl_get_results_cids @ ( ia_res_ids, @ i_type, @ i_nids, @ ia_ids, @ ia_cids ) dump i_return_value dump ia_cids #---------------------------------------------------------------------

()

res_utl_extract_nodal_results # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_utl_extract_nodal_results() This session file extracts specified results from the database. It gives the result at each node along with the type of result, node ids, minimum and maximum values of results within specified nodes. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file

996 PCL Reference Manual Examples Results Utility Functions

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_extract_nodal_results() # has the following arguments: # # res_utl_extract_nodal_results # ( res_ids, # node_list, # derivation, # cid, # datatype, # nres, # ids, # results, # minloc, # maxloc ) # #--------------------------------------------------------------------# Variable Declarations INTEGER ia_res_ids(5) STRING s_node_list[15] STRING s_derivation[5] STRING s_cid[1] INTEGER i_datatype INTEGER i_nres INTEGER iv_ids(VIRTUAL) REAL rv_results(VIRTUAL) INTEGER ia_minloc(6) INTEGER ia_maxloc(6) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization ia_res_ids = [3, 1, 2, 1, 1] s_node_list = "Node 10:20" s_derivation = "MAG" s_cid = "" #--------------------------------------------------------------------# Extract the result data for specified nodes i_return_value = @ res_utl_extract_nodal_results @ ( ia_res_ids, @ s_node_list, @ s_derivation, @ s_cid, @ i_datatype, @ i_nres, @ iv_ids, @ rv_results, @ ia_minloc, @ ia_maxloc ) dump i_return_value dump i_datatype # This value shows type of result dump i_nres # This value shows number of node ids dump iv_ids # This shows list of node ids dump rv_results # This shows magnitude of results at the specified nodes dump ia_minloc # This value shows minimum result component dump ia_maxloc # This value shows maximum result component sys_free_array(iv_ids)

Main Index

Chapter 6: Results Postprocessing Functions 997 Results Utility Functions

sys_free_array(rv_results) #---------------------------------------------------------------------

res_utl_extract_nodal_history

()

# # Purpose : This file provides an example of a call to the # function res_utl_extract_nodal_history() # # This session file extracts specified results # from the database. It gives the result at each # node along with the type of result, node ids. # It also gives load case/subcase id array index # for each node maximum and minimum result # component. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_extract_nodal_history() # has the following arguments: # # res_utl_extract_nodal_history # ( nlcs, # lcids, # subids, # res_ids, # node_list, # derivation, # cid, # datatype, # nres, # ids, # results, # minloc, # maxloc ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_nlcs INTEGER ia_lcids(2) INTEGER ia_subids(2) INTEGER ia_res_ids(3) STRING s_node_list[15] STRING s_derivation[5] STRING s_cid[2] INTEGER i_datatype INTEGER i_nres INTEGER iv_ids(VIRTUAL) REAL rv_results(VIRTUAL) INTEGER iv_minloc(VIRTUAL) INTEGER iv_maxloc(VIRTUAL) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_nlcs = 2

Main Index

998 PCL Reference Manual Examples Results Utility Functions

ia_lcids = [3, 4] ia_subids = [1, 2] ia_res_ids = [2, 1, 1] s_node_list = "Node 10:20" s_derivation = "MAG" s_cid = "" #--------------------------------------------------------------------# Extract the result data for specified nodes i_return_value = @ res_utl_extract_nodal_history @ ( i_nlcs, @ ia_lcids, @ ia_subids, @ ia_res_ids, @ s_node_list, @ s_derivation, @ s_cid, @ i_datatype, @ i_nres, @ iv_ids, @ rv_results, @ iv_minloc, @ iv_maxloc ) dump i_return_value dump i_datatype # This value shows type of result dump i_nres # This value shows number of node ids dump iv_ids # This shows list of node ids dump rv_results # These values shows the results associated with the specified nodes dump iv_minloc # This shows load case/subcase id array index for each node minimum # result component dump iv_maxloc # This shows load case/subcase id array index for each node maximum # result component sys_free_array(iv_ids) sys_free_array(rv_results) sys_free_array(iv_minloc) sys_free_array(iv_maxloc) #---------------------------------------------------------------------

()

res_utl_create_nodal_result # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_utl_create_nodal_result() This session file creates new result case and writes to the database. The new result case is then displayed in the viewport. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_utl_create_nodal_result()

Chapter 6: Results Postprocessing Functions 999 Results Utility Functions

# has the following arguments: # # res_utl_create_nodal_result # ( res_ids, # prim_title, # sec_title, # nids, # ids, # cid_list, # datatype, # results ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i INTEGER ia_res_ids(5) STRING s_prim_title[80] STRING s_sec_title[80] INTEGER i_nids INTEGER iv_ids(VIRTUAL) STRING s_cid_list[10] INTEGER i_datatype REAL rv_new_results(VIRTUAL) INTEGER i_return_value INTEGER i_nres INTEGER ia_minloc(6) INTEGER ia_maxloc(6) REAL rv_results(VIRTUAL) #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Extracts the existing results i_return_value = @ res_utl_extract_nodal_results( [4, 2, 2, 1, @ 1], "Node 1:#", "MAG", "", i_datatype, @ i_nres, iv_ids, rv_results, ia_minloc, ia_maxloc ) dump i_return_value #--------------------------------------------------------------------# Argument initialization ia_res_ids = [4, 2, 0, 0, 1] s_prim_title = "New result case" s_sec_title = "Displacement" i_nids = i_nres s_cid_list = "" #--------------------------------------------------------------------# Creates new result values twice the older values sys_allocate_array(rv_new_results, 1, i_nres) FOR (i = 1 TO i_nres) rv_new_results(i) = 2 * rv_results(i) END FOR #--------------------------------------------------------------------# Creates new result case i_return_value = @ res_utl_create_nodal_result @ ( ia_res_ids, @ s_prim_title, @ s_sec_title, @ i_nids, @ iv_ids, @ s_cid_list, @ i_datatype, @ rv_new_results ) dump i_return_value #--------------------------------------------------------------------# Creates the plot i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Scalar", @

Main Index

1000 PCL Reference Manual Examples Results Utility Functions

"SPOOL_LOADS", "Static Subcase", "New result case", "Displacement", "(NON-LAYERED)", "", "Default", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value

@ @ @

i_return_value = @ res_data_title( 0, "Nodal", "Scalar", 1, @ [ "SPOOL_LOADS, Static Subcase: New result @ case, Displacement-(NON-LAYERED) "] ) dump i_return_value i_return_value = @ res_display_fringe_create( "", "FreeFaces", 0,@ [""], 12, [ "Range:Fri_default_Fringe", @ "RangeOverwrite:ON", @ "FringeStyle:Discrete/Smooth" , @ "Shade:None", @ "ElemEdge:FreeEdge,Blue,Solid,1", @ "Shrink:0", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ValueDisplay:OFF", @ "Filter:None", "ScaleFactor:1.", @ "LabelStyle:Exponential, 12, White, 3"], TRUE ) dump i_return_value i_return_value = @ res_display_fringe_post( "", 0, "Nodal", TRUE, TRUE ) dump i_return_value sys_free_array(iv_ids) sys_free_array(rv_new_results) sys_free_array(rv_results) #---------------------------------------------------------------------

()

res_utl_extract_elem_results # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_utl_extract_elem_results() This session file extracts specified results from the database. It gives the result at each elements along with the type of result, element ids. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_utl_extract_elem_results() has the following arguments: res_utl_extract_elem_results ( res_ids, elem_list, derivation, location, cid, datatype,

Chapter 6: Results Postprocessing Functions 1001 Results Utility Functions

# resloc, # nres, # ids, # nresults, # results, # minloc, # maxloc ) # #--------------------------------------------------------------------# Variable Declarations INTEGER ia_res_ids(5) STRING s_elem_list[12], s_derivation[5], s_location[10], s_cid[2] INTEGER i_datatype, i_resloc, i_nres, iv_ids(VIRTUAL) INTEGER iv_nresults(VIRTUAL) INTEGER i_return_value, iv_minloc(VIRTUAL), iv_maxloc(VIRTUAL) REAL rv_results(VIRTUAL) #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization ia_res_ids = [3, 1, 2, 1, 1] s_elem_list = "Elem 295:305" s_derivation = "MAG" s_location = "N[odal]" s_cid = "" #--------------------------------------------------------------------# Extract the result data for specified elements i_return_value = @ res_utl_extract_elem_results @ ( ia_res_ids, @ s_elem_list, @ s_derivation, @ s_location, @ s_cid, @ i_datatype, @ i_resloc, @ i_nres, @ iv_ids, @ iv_nresults, @ rv_results, @ iv_minloc, @ iv_maxloc ) dump i_return_value dump i_datatype # This value shows type of result, 1=scaler, 2=vector, 3=tensor dump i_resloc # This value returns the result location, 1=centroid, 2=nodal # 3=multiple. dump i_nres # This value shows the number of elements selected dump iv_ids # This shows list of element ids dump iv_nresults # This value shows number of results per element. dump rv_results # This value shows all the results at the specified element locations dump iv_minloc # This shows an array index for each minimum result component dump iv_maxloc # This shows an array index for each maximum result component sys_free_array(iv_ids) sys_free_array(iv_nresults) sys_free_array(rv_results) sys_free_array(iv_minloc) sys_free_array(iv_maxloc) #---------------------------------------------------------------------

Main Index

1002 PCL Reference Manual Examples Results Utility Functions

res_utl_extract_elem_history

()

# # Purpose : This file provides an example of a call to the # function res_utl_extract_elem_history() # # This session file extracts specified results # from the database. It gives the result at each # element along with the type of result, element # ids. It also gives an array index for each # minimum and maximum element result component. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_extract_elem_history() # has the following arguments: # # res_utl_extract_elem_history # ( nlcs, # lcids, # subids, # res_ids, # elem_list, # derivation, # location, # cid, # datatype, # resloc, # nres, # ids, # nresults, # results, # minloc, # maxloc ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_nlcs, ia_lcids(2), ia_subids(2), ia_res_ids(3) STRING s_elem_list[12], s_derivation[12], s_location[12], s_cid[12] INTEGER i_datatype, i_resloc, i_nres, iv_ids(VIRTUAL) INTEGER iv_nresults(VIRTUAL), iv_minloc(VIRTUAL), iv_maxloc(VIRTUAL) REAL rv_results(VIRTUAL) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_nlcs = 2 ia_lcids = [3, 4] ia_subids = [1, 2] ia_res_ids = [2, 1, 1] s_elem_list = "Elem 200" s_derivation = "MAG" s_location = "C[entroid]" s_cid = ""

Main Index

Chapter 6: Results Postprocessing Functions 1003 Results Utility Functions

#--------------------------------------------------------------------# Clear any previous results from the memory i_return_value = res_utl_clear_result() dump i_return_value #--------------------------------------------------------------------# Extract result data for one element from the database i_return_value = @ res_utl_extract_elem_history @ ( i_nlcs, @ ia_lcids, @ ia_subids, @ ia_res_ids, @ s_elem_list, @ s_derivation, @ s_location, @ s_cid, @ i_datatype, @ i_resloc, @ i_nres, @ iv_ids, @ iv_nresults, @ rv_results, @ iv_minloc, @ iv_maxloc ) dump i_return_value dump i_datatype # This shows type of result 1=scaler, 2=vector, 3=tensor dump i_resloc # This shows result location 1=centroid, 2=nodal, 3=multiple dump i_nres # This shows the number of element id dump iv_ids # This shows list of element ids dump iv_nresults # This shows number of results per element dump rv_results # This shows result at the specified element dump iv_minloc # This shows minimum element result component dump iv_maxloc # This shows maximum element result component sys_free_array(iv_ids) sys_free_array(iv_nresults) sys_free_array(rv_results) sys_free_array(iv_minloc) sys_free_array(iv_maxloc) #---------------------------------------------------------------------

()

res_utl_create_elem_result # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_utl_create_elem_result() This session file creates new result case and writes to the database. After that the new result case can be displayed in the viewport. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into 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.

1004 PCL Reference Manual Examples Results Utility Functions

# # # The function res_utl_create_elem_result() # has the following arguments: # # res_utl_create_elem_result( resultids, @ # primary_title, @ # secondary_title, @ # nids, @ # ids, @ # cidlist, @ # datatype, @ # location, @ # nresults, @ # results) # # #--------------------------------------------------------------------# Variable Decleration INTEGER STRING STRING INTEGER INTEGER STRING INTEGER STRING INTEGER REAL

resultids(5) primary_title[80] secondary_title[80] nids ids(virtual) cidlist[12] datatype location[12] nresults(VIRTUAL) results(VIRTUAL)

STRING STRING INTEGER INTEGER INTEGER INTEGER INTEGER INTEGER STRING INTEGER

elem_list[12] derivation[12] resloc, cnt min_loc(12), max_loc(12) nrc, lcids(virtual), subids(virtual) nres, primary_id(virtual), secondary_id(virtual) nsub(virtual), nsub1 result_ids(4), nlayers, layerids(VIRTUAL) layerlabels[80](VIRTUAL) i_return_value

#--------------------------------------------------------------------# Opening the file spool.db uil_file_open.go( "./spool.db") #--------------------------------------------------------------------# Clear any previous results from the memory res_utl_clear_result() #--------------------------------------------------------------------# Gets the loadcases associated with the results res_utl_get_loadcases(nrc, lcids, nsub) dump nrc, lcids, nsub #--------------------------------------------------------------------# Gets the subcases res_utl_get_subcases(lcids(1), nsub1, subids) dump lcids(1), nsub1, subids #--------------------------------------------------------------------# Gets the result ids res_utl_get_result_ids (

Main Index

nrc, lcids,

@

Chapter 6: Results Postprocessing Functions 1005 Results Utility Functions

subids, nres, primary_id, secondary_id) dump dump dump dump

@

nres, primary_id, secondary_id nrc lcids subids

#--------------------------------------------------------------------# Gets the layer positions associated with the results result_ids(1) result_ids(2) result_ids(3) result_ids(4)

= = = =

lcids(1) subids(1) primary_id(2) secondary_id(2)

res_utl_get_result_layers( result_ids, nlayers, layerids, layerlabels)

@

dump nlayers dump layerids dump layerlabels #--------------------------------------------------------------------# Extracts result data for 10 elements (Elm 1:10) from the database resultids(1) resultids(2) resultids(3) resultids(4) resultids(5)

= = = = =

lcids(1) subids(1) primary_id(2) secondary_id(2) layerids(1)

elem_list derivation location cidlist

= = = =

"Elm 1:10" "MAG" "N[odal" ""

res_utl_extract_elem_results ( resultids, elem_list, derivation, location, cidlist, datatype, resloc, cnt, ids, nresults, results, min_loc, max_loc )

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

#--------------------------------------------------------------------# Dump all extracted results as a output dump dump dump dump dump dump dump dump

datatype resloc cnt ids nresults results min_loc max_loc

#--------------------------------------------------------------------# Argument Initialization resultids(1) resultids(2)

Main Index

= lcids(1) = subids(1)

1006 PCL Reference Manual Examples Results Utility Functions

resultids(3) resultids(4) resultids(5)

= 0 = 0 = layerids(1)

primary_title = "NEW RESULT CASE" secondary_title = "Displacement" nids location cidlist

= nres = "N[odal" = ""

#--------------------------------------------------------------------# Created new result case in the database as a # "NEW RESULT CASE" (Primary load case title) and # "DISPLACEMENT" (Secondary load case title) i_return_value =

res_utl_create_elem_result( resultids, primary_title, secondary_title, nids, ids, cidlist, datatype, location, nresults, results )

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Dump the return value of the function and output of the used function. # The resultids(3) and resultids(4) are created newly. dump i_return_value dump resultids #--------------------------------------------------------------------# Closing the patran environment. uil_file_close.goquit(

)

#--------------------------------------------------------------------# End of File.

()

res_utl_extract_path_results # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_utl_extract_path_results() This session file extracts the specified result data from the database along a specified set of XYZ coordinates. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_utl_extract_path_results() has the following arguments:

Chapter 6: Results Postprocessing Functions 1007 Results Utility Functions

# res_utl_extract_path_results # ( res_ids, # npts, # pts, # derivation, # cid, # datatype, # results, # minloc, # maxloc, # elem_ids ) # #--------------------------------------------------------------------# Variable Declarations INTEGER ia_res_ids(5) INTEGER i_npts REAL ra_pts(3) STRING s_derivation[5] STRING s_cid[8] INTEGER i_datatype REAL rv_results(VIRTUAL) INTEGER ia_minloc(6) INTEGER ia_maxloc(6) INTEGER ia_elem_ids(1) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization ia_res_ids = [2, 2, 2, 1, 1] # # Where ia_res_ids[0] = loadcase id (in this case 2) # ia_res_ids[1] = subcase id (in this case 2) # ia_res_ids[2] = Primary results_id (2 for Displacements) # ia_res_ids[3] = Secondary results_id (1 for Translational) # ia_res_ids[4] = Layer Position id (1 for (Non-Layered) i_npts = 1 #Try various points by using the FEM Element Show menu for Node values #Example point this point does give a result value: ra_pts = [-4.0, 8.0, -1.75] s_derivation = "MAG" s_cid = "Coord 1" s_derivation = "MAG" s_cid = "Coord 1" #--------------------------------------------------------------------# Extracts the results along the specified coordinates i_return_value = @ res_utl_extract_path_results @ ( ia_res_ids, @ i_npts, @ ra_pts, @ s_derivation, @ s_cid, @ i_datatype, @ rv_results, @ ia_minloc, @ ia_maxloc, @ ia_elem_ids ) dump i_return_value dump i_datatype dump rv_results dump ia_minloc dump ia_maxloc dump ia_elem_ids sys_free_array(rv_results) #---------------------------------------------------------------------

Main Index

1008 PCL Reference Manual Examples Results Utility Functions

()

res_utl_get_loadcases

# # Purpose : This file provides an example of a call to the # function res_utl_get_loadcases() # # This session file retrieves the existing load # cases associated with results from the database # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_get_loadcases() # has the following arguments: # # res_utl_get_loadcases # ( ncases, # lcids, # nsub ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_ncases INTEGER iv_lcids(VIRTUAL) INTEGER iv_nsub(VIRTUAL) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Gets the loadcases associated with the results i_return_value = @ res_utl_get_loadcases @ ( i_ncases, @ iv_lcids, @ iv_nsub ) dump i_return_value dump i_ncases # This value shows number of loadcases dump iv_lcids # This shows the list of load case ids dump iv_nsub # This shows number of subcases for each load case sys_free_array(iv_lcids) sys_free_array(iv_nsub) #---------------------------------------------------------------------

()

res_utl_get_subcases # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_utl_get_subcases() This session file retrieves the existing subcases associated with results from the

Chapter 6: Results Postprocessing Functions 1009 Results Utility Functions

# database. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_get_subcases() # has the following arguments: # # res_utl_get_subcases # ( lcid, # nsub, # subids ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_lcid INTEGER i_nsub INTEGER iv_subids(VIRTUAL) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_lcid = 3 #--------------------------------------------------------------------# Gets the subcases i_return_value = @ res_utl_get_subcases @ ( i_lcid, @ i_nsub, @ iv_subids ) dump i_return_value dump i_nsub # This shows the number of subcases dump iv_subids # This shows the list of subcase ids sys_free_array(iv_subids) #---------------------------------------------------------------------

()

res_utl_get_result_ids # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_utl_get_result_ids() This session file retrieves the existing result ids associated with a list of load case/subcase ids from the database. Before running this session file run spool.ses and import result file spool.op2 to create spool.db with results. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown

1010 PCL Reference Manual Examples Results Utility Functions

# menus on the menu bar. # # The function res_utl_get_result_ids() # has the following arguments: # # res_utl_get_result_ids # ( ncls, # lcid, # subids, # nres, # prim_ids, # sec_ids ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_ncls INTEGER ia_lcid(2) INTEGER ia_subids(2) INTEGER i_nres INTEGER iv_prim_ids(VIRTUAL) INTEGER iv_sec_ids(VIRTUAL) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_ncls = 2 ia_lcid = [3, 4] ia_subids = [1, 1] #--------------------------------------------------------------------# Gets the result ids i_return_value = @ res_utl_get_result_ids @ ( i_ncls, @ ia_lcid, @ ia_subids, @ i_nres, @ iv_prim_ids, @ iv_sec_ids ) dump i_return_value dump i_nres # This value shows the number of results dump iv_prim_ids # This shows the list of primary result ids dump iv_sec_ids # This shows the list of secondary result ids sys_free_array(iv_prim_ids) sys_free_array(iv_sec_ids) #---------------------------------------------------------------------

()

res_utl_get_result_layers # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_utl_get_result_layers() This session file retrieves the layer positions associated with results from the database. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses

Chapter 6: Results Postprocessing Functions 1011 Results Utility Functions

# This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_get_result_layers() # has the following arguments: # # res_utl_get_result_layers # ( res_ids, # nlayers, # ids, # labels ) # #--------------------------------------------------------------------# Variable Declarations INTEGER ia_res_ids(4) INTEGER i_nlayers INTEGER iv_ids(VIRTUAL) STRING sav_labels[32](VIRTUAL) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization ia_res_ids = [3, 1, 2, 1] #--------------------------------------------------------------------# Gets the layer positions associated with the results i_return_value = @ res_utl_get_result_layers @ ( ia_res_ids, @ i_nlayers, @ iv_ids, @ sav_labels ) dump i_return_value dump i_nlayers # This shows the number of associated layers dump iv_ids # This shows a list of layer position ids dump sav_labels # This shows the labels for the layers sys_free_array(iv_ids) sys_free_array(sav_labels) #---------------------------------------------------------------------

()

res_utl_get_global_vars # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_utl_get_global_vars() This session file retrieves the existing global variables from the database. Before running this session file run dyna.ses to create dyna.db. Then create dyna.op2 as per the instructions in dyna.ses and import it in dyna.db to create dyna.db with results. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_utl_get_global_vars()

1012 PCL Reference Manual Examples Results Utility Functions

# has the following arguments: # # res_utl_get_global_vars # ( nvar, # varnames ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_nvar STRING sav_varnames[16](VIRTUAL) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file dyna.db uil_file_open.go ("dyna.db") #--------------------------------------------------------------------# Gets global variables i_return_value = @ res_utl_get_global_vars @ ( i_nvar, @ sav_varnames ) dump i_return_value dump i_nvar # This value shows number of global variables dump sav_varnames # This shows the label for the variable. sys_free_array(sav_varnames) #---------------------------------------------------------------------

res_utl_get_global_vars

()

# # Purpose : This file provides an example of a call to the # function res_utl_get_global_var_for_lc() # # This function retrieves the value of a specific # global variable associated with a loadcase. # # Before running this session file run dyna.ses # to create dyna.db. Then create dyna.op2 as per # the instructions in dyna.ses and import it in # dyna.db to create dyna.db with results. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # # The function res_utl_get_global_var_for_lc() # has the following arguments: # # res_utl_get_global_var_for_lc # ( lcid, # subid, # varname, # ncomp, # vals ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_lcid INTEGER i_subid STRING s_varname[10] INTEGER i_ncomp REAL ra_vals(6) INTEGER i_return_value

Main Index

Chapter 6: Results Postprocessing Functions 1013 Results Utility Functions

#--------------------------------------------------------------------# Opens the file dyna.db uil_file_open.go ("dyna.db") #--------------------------------------------------------------------# Argument initialization i_lcid = 1 i_subid = 5 s_varname = "Frequency" #--------------------------------------------------------------------# Retrieve value of the specified global variable i_return_value = @ res_utl_get_global_var_for_lc @ ( i_lcid, @ i_subid, @ s_varname, @ i_ncomp, @ ra_vals ) dump i_return_value dump i_ncomp # This shows number of components used for the variable value dump ra_vals # This shows the value of global variable #---------------------------------------------------------------------

res_utl_get_subcases_by_gv

()

# # Purpose : This file provides an example of a call to the # function res_utl_get_subcases_by_gv() # # This session file retrieves all subcase ids # with the specified global variable value within # the specified range. # # Before running this session file run dyna.ses # to create dyna.db. Then create dyna.op2 as per # the instructions in dyna.ses and import it in # dyna.db to create dyna.db with results. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # # The function res_utl_get_subcases_by_gv() # has the following arguments: # # res_utl_get_subcases_by_gv # ( lcid, # varname, # compnum, # val1, # val2, # method, # nscs, # subids ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_lcid STRING s_varname[16] INTEGER i_compnum REAL r_val1 REAL r_val2 STRING s_method[16]

Main Index

1014 PCL Reference Manual Examples Results Utility Functions

INTEGER i_nscs INTEGER iv_subids(VIRTUAL) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file dyna.db uil_file_open.go ("dyna.db") #--------------------------------------------------------------------# Sets the viewport size ga_viewport_size_set("default_viewport", 6.926, 5.29, 1) ga_viewport_location_set("default_viewport", 0.000, 3.826, 1) #--------------------------------------------------------------------# Argument initialization i_lcid = 1 s_varname = "Mode number" i_compnum = 1 r_val1 = 1. r_val2 = 10. s_method = "B[etween]" #--------------------------------------------------------------------i_return_value = @ res_utl_get_subcases_by_gv @ ( i_lcid, @ s_varname, @ i_compnum, @ r_val1, @ r_val2, @ s_method, @ i_nscs, @ iv_subids ) dump i_return_value dump i_nscs # This shows the number of subcases associated with the given range dump iv_subids # This shows list of subcase ids associated with the given range of # Mode numbers sys_free_array(iv_subids) #---------------------------------------------------------------------

res_utl_calc_results

()

# # Purpose : This file provides an example of a call to the # function res_utl_calc_results() # # This session file operates mathematically on # two arrays on a component by component basis. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_calc_results() # has the following arguments: # # res_utl_calc_results # ( res1, # operator, # res2, # res3 ) # #--------------------------------------------------------------------# Variable Declarations REAL ra_res1(2) STRING s_operator[5] REAL ra_res2(2)

Main Index

Chapter 6: Results Postprocessing Functions 1015 Results Utility Functions

REAL ra_res3(2) INTEGER i_return_value #--------------------------------------------------------------------# Argument initialization ra_res1 = [10., 20.] s_operator = "*" ra_res2 = [5., 3.] #--------------------------------------------------------------------# Calculates the result i_return_value = @ res_utl_calc_results @ ( ra_res1, @ s_operator, @ ra_res2, @ ra_res3 ) dump i_return_value dump ra_res3 # First value in the array shows the multiplication of 10.0 and 5.0 # and second value shows the multiplication of 20.0 and 3.0 #---------------------------------------------------------------------

res_utl_dot_results

()

# # Purpose : This file provides an example of a call to the # function res_utl_dot_results() # # This session file calculates the dot product of # 2 vector arrays. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_dot_results() # has the following arguments: # # res_utl_dot_results # ( nres, # res1, # res2, # res3 ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_nres REAL ra_res1(2, 3) REAL ra_res2(2, 3) REAL ra_res3(2) INTEGER i_return_value #--------------------------------------------------------------------# Argument initialization i_nres = 2 ra_res1 = [[1., 4., 5.] [2., 2., 2.]] ra_res2 = [[1., 2., 3.] [4., 5., 6.]] #--------------------------------------------------------------------# Calculates the dot product i_return_value = @ res_utl_dot_results @ ( i_nres, @ ra_res1, @ ra_res2, @ ra_res3 ) dump i_return_value dump ra_res3

Main Index

1016 PCL Reference Manual Examples Results Utility Functions

# This shows the dot product of two arrays #---------------------------------------------------------------------

()

res_utl_cross_results

# # Purpose : This file provides an example of a call to the # function res_utl_cross_results() # # This session file calculates the cross product # of 2 vector arrays. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_cross_results() # has the following arguments: # # res_utl_cross_results # ( nres, # res1, # res2, # res3 ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_nres REAL ra_res1(2, 3) REAL ra_res2(2, 3) REAL ra_res3(2, 3) INTEGER i_return_value #--------------------------------------------------------------------# Argument initialization i_nres = 2 ra_res1 = [[1., 4., 5.] [2., 2., 2.]] ra_res2 = [[1., 2., 3.] [4., 5., 6.]] #--------------------------------------------------------------------# Calculates cross products i_return_value = @ res_utl_cross_results @ ( i_nres, @ ra_res1, @ ra_res2, @ ra_res3 ) dump i_return_value dump ra_res3 # This shows the cross product of two arrays #---------------------------------------------------------------------

()

res_utl_transform_results

# # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_utl_transform_results() This session file transforms the input vector or tensor from one rectangular coordinate system to another. Before running this session file run spool.ses and create result file spool.op2 as per the

Chapter 6: Results Postprocessing Functions 1017 Results Utility Functions

# instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_utl_transform_results() # has the following arguments: # # res_utl_transform_results # ( nvals, # ncomp, # in_vals, # from_cid, # to_cid, # out_vals ) # #--------------------------------------------------------------------# Opens file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Variable Declarations INTEGER i_nvals INTEGER i_ncomp REAL ra_in_vals(1, 3) INTEGER i_from_cid INTEGER i_to_cid REAL ra_out_vals(1, 3) INTEGER i_return_value STRING asm_create_cord_axi_created_ids[VIRTUAL] #--------------------------------------------------------------------# Creates a new coordinate frame i_return_value = @ asm_const_coord_axis( "2", "XY", "Coord 0", 1,@ "[0 0 5]", "[1 0 0]", "[0 1 0]" , @ asm_create_cord_axi_created_ids ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_nvals = 1 i_ncomp = 3 ra_in_vals = [[1., 1., 0.]] i_from_cid = 0 i_to_cid = 2 #--------------------------------------------------------------------# Transforms the input vector i_return_value = @ res_utl_transform_results @ ( i_nvals, @ i_ncomp, @ ra_in_vals, @ i_from_cid, @ i_to_cid, @ ra_out_vals ) dump i_return_value dump ra_out_vals # This shows the transformed array #---------------------------------------------------------------------

()

db_get_load_case_title # #

Main Index

Purpose

:

This file provides an example of a call to the

1018 PCL Reference Manual Examples Results Utility Functions

# function db_get_load_case_title() # # This session file retrieves the title for a # specified loadcase id. # # Before running this session file run spool.ses # and import result file spool.op2 to create # spool.db with results. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function db_get_load_case_title() # has the following arguments: # # db_get_load_case_title # ( id, # title ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_id STRING s_title[32] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_id = 4 #--------------------------------------------------------------------# Gets the loadcase title i_return_value = @ db_get_load_case_title @ ( i_id, @ s_title ) dump i_return_value dump s_title # This shows the loadcase title #---------------------------------------------------------------------

()

db_get_load_case_id # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function db_get_load_case_id() This session file retrieves the id for a specified loadcase title. Before running this session file run spool.ses and import result file spool.op2 to create spool.db with results. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function db_get_load_case_id() has the following arguments:

Chapter 6: Results Postprocessing Functions 1019 Results Utility Functions

# db_get_load_case_id # ( title, # id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_title[32] INTEGER i_id INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization s_title = "SPOOL_LOADS" #--------------------------------------------------------------------# Gets the loadcase id i_return_value = @ db_get_load_case_id @ ( s_title, @ i_id ) dump i_return_value dump i_id # This shows loadcase id for specified loadcase title #---------------------------------------------------------------------

db_get_sub_case_title

()

# # Purpose : This file provides an example of a call to the # function db_get_sub_case_title() # # This session file retrieves the title for a # specified loadcase/subcase id. # # Before running this session file run spool.ses # and import result file spool.op2 to create # spool.db with results. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function db_get_sub_case_title() # has the following arguments: # # db_get_sub_case_title # ( lcid, # subid, # title ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_lcid INTEGER i_subid STRING s_title[32] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_lcid = 4 i_subid = 2

Main Index

1020 PCL Reference Manual Examples Results Utility Functions

#--------------------------------------------------------------------# Gets the subcase title i_return_value = @ db_get_sub_case_title @ ( i_lcid, @ i_subid, @ s_title ) dump i_return_value dump s_title # This shows the subcase title #---------------------------------------------------------------------

db_get_sub_case_id

()

# # Purpose : This file provides an example of a call to the # function db_get_sub_case_id() # # This session file retrieves the id for a # specified loadcase/subcase title. # # Before running this session file run spool.ses # and import result file spool.op2 to create # spool.db with results. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function db_get_sub_case_id() # has the following arguments: # # db_get_sub_case_id # ( lcid, # title, # subid ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_lcid STRING s_title[32] INTEGER i_subid INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_lcid = 4 s_title = "Static Subcase" #--------------------------------------------------------------------# Gets the loadcase/subcase id i_return_value = @ db_get_sub_case_id @ ( i_lcid, @ s_title, @ i_subid ) dump i_return_value dump i_subid # This value shows subcase id for the specified title #---------------------------------------------------------------------

Main Index

Chapter 6: Results Postprocessing Functions 1021 Results Utility Functions

()

db_get_primary_res_label

# # Purpose : This file provides an example of a call to the # function db_get_primary_res_label() # # This session file retrieves the title for a # specified primary result id. # # Before running this session file run spool.ses # and import result file spool.op2 to create # spool.db with results. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function db_get_primary_res_label() # has the following arguments: # # db_get_primary_res_label # ( id, # label ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_id STRING s_label[32] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_id = 2 #--------------------------------------------------------------------# Gets the primary result label i_return_value = @ db_get_primary_res_label @ ( i_id, @ s_label ) dump i_return_value dump s_label # This shows the primary result label #---------------------------------------------------------------------

()

db_get_primary_res_id # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function db_get_primary_res_id() This session file retrieves the id for a specified primary result label. Before running this session file run spool.ses and import result file spool.op2 to create spool.db with results. For instructions see file spool.ses This file can be run by starting a session of

1022 PCL Reference Manual Examples Results Utility Functions

# Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function db_get_primary_res_id() # has the following arguments: # # db_get_primary_res_id # ( label, # id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_label[32] INTEGER i_id INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization s_label = "Stress Tensor" #--------------------------------------------------------------------# Gets the primary result id i_return_value = @ db_get_primary_res_id @ ( s_label, @ i_id ) dump i_return_value dump i_id # This value shows primary result id #---------------------------------------------------------------------

db_get_secondary_res_label

()

# # Purpose : This file provides an example of a call to the # function db_get_secondary_res_label() # # This session file retrieves the label for a # specified secondary result id. # # Before running this session file run spool.ses # and import result file spool.op2 to create # spool.db with results. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function db_get_secondary_res_label() # has the following arguments: # # db_get_secondary_res_label # ( primary_id, # secondary_id, # label ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_primary_id INTEGER i_secondary_id STRING s_label[32] INTEGER i_return_value

Main Index

Chapter 6: Results Postprocessing Functions 1023 Results Utility Functions

#--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_primary_id = 2 i_secondary_id = 1 #--------------------------------------------------------------------# Gets the secondary result label i_return_value = @ db_get_secondary_res_label @ ( i_primary_id, @ i_secondary_id, @ s_label ) dump i_return_value dump s_label # This shows the secondary result label #---------------------------------------------------------------------

db_get_secondary_res_id

()

# # Purpose : This file provides an example of a call to the # function db_get_secondary_res_id() # # This session file retrieves the id for a # specified secondary result label. # # Before running this session file run spool.ses # and import result file spool.op2 to create # spool.db with results. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function db_get_secondary_res_id() # has the following arguments: # # db_get_secondary_res_id # ( primary_id, # label, # secondary_id ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_primary_id STRING s_label[32] INTEGER i_secondary_id INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_primary_id = 1 s_label = "Translational" #--------------------------------------------------------------------# Gets the secondary result id i_return_value = @ db_get_secondary_res_id @ ( i_primary_id, @ s_label, @ i_secondary_id )

Main Index

1024 PCL Reference Manual Examples Results Utility Functions

dump i_return_value dump i_secondary_id # This value shows the id for the specified secondary result label #---------------------------------------------------------------------

Main Index

Chapter 6: Results Postprocessing Functions 1025 Data Register Definition Functions

Data Register Definition Functions This section contains examples of some of the functions that define the manipulation methods and data or data source for data registers. res_data_get_ntitles

()

# # Purpose : This file provides an example of a call to the # function res_data_get_ntitles() # # This session file extracts the number of titles # stored in a register. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_get_ntitles() # has the following arguments: # # res_data_get_ntitles # ( register, # location, # register_type, # count ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] INTEGER i_count INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Create a data register i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "VONM", @ "Default", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value i_return_value = @ res_data_title( 1, "Nodal", "Scalar", 1, @ ["SPOOL_LOADS, Static Subcase: Stress Tensor, -At Z1 (VONM)"] ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_register = 1 s_location = "Nodal" s_register_type = "Scalar" #--------------------------------------------------------------------# Gets the number of titles

Main Index

1026 PCL Reference Manual Examples Data Register Definition Functions

i_return_value = @ res_data_get_ntitles @ ( i_register, @ s_location, @ s_register_type, @ i_count ) dump i_return_value dump i_count # This value shows number of titles stored in a register. #---------------------------------------------------------------------

res_data_get_titles

()

# # Purpose : This file provides an example of a call to the # function res_data_get_titles() # # This session file extracts the number of titles # and titles stored in a register. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_get_titles() # has the following arguments: # # res_data_get_titles # ( register, # location, # register_type, # count, # titles ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] INTEGER i_count STRING sa_titles[128](1) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Creates a data register and a title for it i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "VONM", @ "Default", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value i_return_value = @ res_data_title( 1, "Nodal", "Scalar", 1, @ ["SPOOL_LOADS, Static Subcase: Stress Tensor, -At Z1 (VONM)"] ) dump i_return_value #--------------------------------------------------------------------# Argument initialization

Main Index

Chapter 6: Results Postprocessing Functions 1027 Data Register Definition Functions

i_register = 1 s_location = "Nodal" s_register_type = "Scalar" #--------------------------------------------------------------------# Gets the titles i_return_value = @ res_data_get_titles @ ( i_register, @ s_location, @ s_register_type, @ i_count, @ sa_titles ) dump i_return_value dump i_count # This value shows number of titles associated with this register. dump sa_titles # This shows the titles associated with this register. #---------------------------------------------------------------------

res_data_dbres_list

()

# # Purpose : This file provides an example of a call to the # function res_data_dbres_list() # # This session file associates a series of # registers with a specific register. # Two registers are defined then they are # associated with a single register and scanned # for the maximum value. New loadcase and # subcase are created and new register is saved. # Then new registers fringe plot is created. 3 # Before running this session file run dyna.ses # and import result file dyna.op2 to create # dyna.db with results. For instructions # see file dyna.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_dbres_list() # has the following arguments: # # res_data_dbres_list # ( register, # location, # register_type, # count, # load_cases, # subcases, # primary_result, # secondary_result, # layers ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] INTEGER i_count STRING sa_load_cases[32](2) STRING sa_subcases[32](2) STRING sa_primary_result[32](2) STRING sa_secondary_result[32](2)

Main Index

1028 PCL Reference Manual Examples Data Register Definition Functions

STRING sa_layers[32](2) INTEGER i_return_value INTEGER res_create_drv_maxmin_new_lcid INTEGER res_create_drv_maxmin_new_scid INTEGER res_create_drv_maxmin_new_rcid #--------------------------------------------------------------------# Opens the file dyna.db uil_file_open.go ("dyna.db") #--------------------------------------------------------------------# Register definition i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Mode 1:Freq.=751.31", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "" , 0. ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_register = 0 s_location = "Nodal" s_register_type = "Vector" i_count = 2 sa_load_cases(1) = "Default" sa_load_cases(2) = "Default" sa_subcases(1) = "Mode 1:Freq.=751.31" sa_subcases(2) = "Mode 2:Freq.=1394.7" sa_primary_result(1) = "Eigenvectors" sa_primary_result(2) = "Eigenvectors" sa_secondary_result(1) = "Translational" sa_secondary_result(2) = "Translational" sa_layers(1) = "(NON-LAYERED)" sa_layers(2) = "(NON-LAYERED)" #--------------------------------------------------------------------# Associates series of result with specified register i_return_value = @ res_data_dbres_list @ ( i_register, @ s_location, @ s_register_type, @ i_count, @ sa_load_cases, @ sa_subcases, @ sa_primary_result, @ sa_secondary_result, @ sa_layers ) dump i_return_value #--------------------------------------------------------------------# Scans the maximum value i_return_value = @ res_data_list_max( 0, "Nodal", "Vector", "Algebraic", "MAG" ) dump i_return_value #--------------------------------------------------------------------# Creates loadcase, subcase and saves it i_return_value = @ res_db_create_loadcase_c( "Derived Results", @ 1, "Created by Results Derive", res_create_drv_maxmin_new_lcid ) dump i_return_value i_return_value = @ res_db_create_subcase_c( 2, "Subcase 1", @ res_create_drv_maxmin_new_scid, res_create_drv_maxmin_new_rcid ) dump i_return_value i_return_value = @ res_data_save( 0, "Nodal", "Vector", @ "Derived Results", "Subcase 1", "", "Eigenvectors", "", 0, [""]) dump i_return_value #---------------------------------------------------------------------

Main Index

Chapter 6: Results Postprocessing Functions 1029 Data Register Definition Functions

# Plots the new result case i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Scalar", @ "Derived Results", "Subcase 1", @ "Eigenvectors", "", "(NON-LAYERED)", "MAG",@ "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_title( 0, "Nodal", "Scalar", 1, @ ["Derived Results, Subcase 1, Eigenvectors,@ - Magnitude, (NON-LAYERED)"] ) dump i_return_value i_return_value = @ res_display_fringe_create( "", "FreeFaces", 0 @ , [""], 12, ["Range:Fri_default_Fringe", @ "RangeOverwrite:ON", "FringeStyle:Disc" // @ "rete/Smooth", "Shade:None", "ElemEdge:" //@ "FreeEdge,Blue,Solid,1", "Shrink:0", @ "TitleDisplay:ON", "MinMaxDisplay:ON", @ "ValueDisplay:OFF", "Filter:None", @ "ScaleFactor:1.", "LabelStyle:Fixed, 8, White, 4"], TRUE ) dump i_return_value i_return_value = @ res_display_fringe_post( "", 0, "Nodal", TRUE, TRUE ) dump i_return_value #---------------------------------------------------------------------

res_data_register_list

()

# # Purpose : This file provides an example of a call to the # function res_data_register_list() # # This session file associates a series of # registers with a specific register. # Two registers are defined then they are # associated with a single register and scanned # for the maximum value. New loadcase and # subcase are created and new register is saved. # Then new registers fringe plot is created. # # Before running this session file run dyna.ses # and import result file dyna.op2 to create # dyna.db with results. For instructions # see file dyna.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_register_list() # has the following arguments: # # res_data_register_list # ( register, # location, # register_type, # count, # register_list ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register

Main Index

1030 PCL Reference Manual Examples Data Register Definition Functions

STRING s_location[16] STRING s_register_type[16] INTEGER i_count INTEGER ia_register_list(2) INTEGER res_create_drv_maxmin_new_lcid INTEGER res_create_drv_maxmin_new_scid INTEGER res_create_drv_maxmin_new_rcid INTEGER i_return_value #--------------------------------------------------------------------# Opens the file dyna.db uil_file_open.go( "dyna.db" ) #--------------------------------------------------------------------# Defining the registers i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Vector", @ "Default", "Mode 1:Freq.=751.31", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "" , 0. ) dump i_return_value i_return_value = @ res_data_load_dbresult( 2, "Nodal", "Vector", @ "Default", "Mode 2:Freq.=1394.7", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "" , 0. ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_register = 2 s_location = "Nodal" s_register_type = "Vector" i_count = 2 ia_register_list = [1, 2] #--------------------------------------------------------------------# Associates series of registers with a specific register i_return_value = @ res_data_register_list @ ( i_register, @ s_location, @ s_register_type, @ i_count, @ ia_register_list ) dump i_return_value #--------------------------------------------------------------------# Scans the maximum value i_return_value = @ res_data_list_max( 2, "Nodal", "Vector", "Algebraic", "MAG" ) dump i_return_value #--------------------------------------------------------------------# Creating new load and result case and saving the new result case i_return_value = @ res_db_create_loadcase_c("New Results", 1, @ "Created by Results Derive", res_create_drv_maxmin_new_lcid) dump i_return_value i_return_value = @ res_db_create_subcase_c( 2, "Subcase 1", @ res_create_drv_maxmin_new_scid, res_create_drv_maxmin_new_rcid) dump i_return_value i_return_value = @ res_data_save( 2, "Nodal", "Vector", @ "New Results", "Subcase 1", "(NON-LAYERED)"@ , "Eigenvectors", "") dump i_return_value #--------------------------------------------------------------------# Creating a fringe plot of new result case i_return_value = @

Main Index

Chapter 6: Results Postprocessing Functions 1031 Data Register Definition Functions

res_data_load_dbresult( 2, "Nodal", "Scalar", @ "New Results", "Subcase 1", "Eigenvectors",@ "", "(NON-LAYERED)", "MAG", "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_display_fringe_create( "", "FreeFaces", 0,@ [""], 12, ["Range:Fri_default_Fringe", @ "RangeOverwrite:ON", "FringeStyle:Disc" // @ "rete/Smooth", "Shade:None", "ElemEdge" // @ ":FreeEdge,Blue,Solid,1", "Shrink:0", @ "TitleDisplay:ON", "MinMaxDisplay:ON", @ "ValueDisplay:OFF", "Filter:None", @ "ScaleFactor:1.", @ "LabelStyle:Fixed, 8, White, 4"], TRUE ) dump i_return_value i_return_value = @ res_display_fringe_post( "", 2, "Nodal", TRUE, TRUE ) dump i_return_value #---------------------------------------------------------------------

res_data_list_sum

()

# # Purpose : This file provides an example of a call to the # function res_data_list_sum() # # This session file adds the data specified by # the register list, saves it in a new result # case and displays the fringe plot of the new # result case. # # Before running this session file run dyna.ses # and import result file dyna.op2 to create # dyna.db with results. For instructions # see file dyna.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_list_sum() # has the following arguments: # # res_data_list_sum_ # ( register, # location, # register_type, # count, # weights ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] INTEGER i_count REAL ra_weights(2) INTEGER i_return_value INTEGER res_create_drv_maxmin_new_lcid INTEGER res_create_drv_maxmin_new_scid INTEGER res_create_drv_maxmin_new_rcid #--------------------------------------------------------------------# Opens the file dyna.db uil_file_open.go ("dyna.db")

Main Index

1032 PCL Reference Manual Examples Data Register Definition Functions

#--------------------------------------------------------------------# Register definition i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Mode 1:Freq.=751.31", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "" , 0. ) dump i_return_value #--------------------------------------------------------------------# Associates series of result with specified register i_return_value = @ res_data_dbres_list( 0, "Nodal", "Vector", 1, @ ["Default"], ["Mode 2:Freq.=1394.7"], @ ["Eigenvectors"], ["Translational"], ["(NON-LAYERED)"] ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_register = 0 s_location = "Nodal" s_register_type = "Vector" i_count = 2 ra_weights(1) = 1. ra_weights(2) = 1. #--------------------------------------------------------------------# Adds the data i_return_value = @ res_data_list_sum @ ( i_register, @ s_location, @ s_register_type, @ i_count, @ ra_weights ) dump i_return_value #--------------------------------------------------------------------# Creates loadcase, subcase and saves it i_return_value = @ res_db_create_loadcase_c( "Derived Results", @ 1, "Created by Results Derive", res_create_drv_maxmin_new_lcid ) dump i_return_value i_return_value = @ res_db_create_subcase_c( 2, "Subcase 1", @ res_create_drv_maxmin_new_scid, res_create_drv_maxmin_new_rcid ) dump i_return_value i_return_value = @ res_data_save( 0, "Nodal", "Vector", @ "Derived Results", "Subcase 1", "", "Eigenvectors", "", 0, [""]) dump i_return_value #--------------------------------------------------------------------# Plots the new result case i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Scalar", @ "Derived Results", "Subcase 1", @ "Eigenvectors", "", "(NON-LAYERED)", "MAG",@ "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_title( 0, "Nodal", "Scalar", 1, @ ["Derived Results, Subcase 1, Eigenvectors,@ - Magnitude, (NON-LAYERED)"] ) dump i_return_value i_return_value = res_display_fringe_create( "", "FreeFaces", 0 , [""], 12, ["Range:Fri_default_Fringe", "RangeOverwrite:ON", "FringeStyle:Disc" //

Main Index

@ @ @ @

Chapter 6: Results Postprocessing Functions 1033 Data Register Definition Functions

"rete/Smooth", "Shade:None", "ElemEdge:" //@ "FreeEdge,Blue,Solid,1", "Shrink:0", @ "TitleDisplay:ON", "MinMaxDisplay:ON", @ "ValueDisplay:OFF", "Filter:None", @ "ScaleFactor:1.", "LabelStyle:Fixed, 8, White, 4"], TRUE ) dump i_return_value i_return_value = @ res_display_fringe_post( "", 0, "Nodal", TRUE, TRUE ) dump i_return_value #---------------------------------------------------------------------

res_data_list_max

()

# # Purpose : This file provides an example of a call to the # function res_data_list_max() # # This session file associates a series of # database result specifiers with a specific # register, saves the new register, scans the # maximum value and displays the fringe plot. # # Before running this session file run dyna.ses # and import result file dyna.op2 to create # dyna.db with results. For instructions # see file dyna.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_list_max() # has the following arguments: # # res_data_list_max # ( register, # location, # register_type, # method, # derivation ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] STRING s_method[16] STRING s_derivation[16] INTEGER i_return_value INTEGER res_create_drv_maxmin_new_lcid INTEGER res_create_drv_maxmin_new_scid INTEGER res_create_drv_maxmin_new_rcid #--------------------------------------------------------------------# Opens the file dyna.db uil_file_open.go ("dyna.db") #--------------------------------------------------------------------# Register definition i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Mode 1:Freq.=751.31", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "" , 0. ) dump i_return_value #--------------------------------------------------------------------# Associates series of result with specified register

Main Index

1034 PCL Reference Manual Examples Data Register Definition Functions

i_return_value = @ res_data_dbres_list(0, "Nodal", "Vector", 2, @ ["Default", "Default"], ["Mode 1:Freq." // @ "=751.31", "Mode 2:Freq.=1394.7"], @ ["Eigenvectors", "Eigenvectors"], @ ["Translational", "Translational"], @ ["(NON-LAYERED)", "(NON-LAYERED)"]) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_register = 0 s_location = "Nodal" s_register_type = "Vector" s_method = "Algebraic" s_derivation = "MAG" #--------------------------------------------------------------------# Scans the maximum value i_return_value = @ res_data_list_max @ ( i_register, @ s_location, @ s_register_type, @ s_method, @ s_derivation ) dump i_return_value #--------------------------------------------------------------------# Creates loadcase, subcase and saves data into it i_return_value = @ res_db_create_loadcase_c( "Derived Results", @ 1, "Created by Results Derive", res_create_drv_maxmin_new_lcid ) dump i_return_value i_return_value = @ res_db_create_subcase_c( 2, "Subcase 1", @ res_create_drv_maxmin_new_scid, res_create_drv_maxmin_new_rcid ) dump i_return_value i_return_value = @ res_data_save( 0, "Nodal", "Vector", @ "Derived Results", "Subcase 1", "", "Eigenvectors", "", 0, [""]) dump i_return_value #--------------------------------------------------------------------# Plots the new result case i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Scalar", @ "Derived Results", "Subcase 1", @ "Eigenvectors", "", "(NON-LAYERED)", "MAG",@ "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_title( 0, "Nodal", "Scalar", 1, @ ["Derived Results, Subcase 1, Eigenvectors,@ - Magnitude, (NON-LAYERED)"] ) dump i_return_value i_return_value = @ res_display_fringe_create( "", "FreeFaces", 0 @ , [""], 12, ["Range:Fri_default_Fringe", @ "RangeOverwrite:ON", "FringeStyle:Disc" // @ "rete/Smooth", "Shade:None", "ElemEdge:" //@ "FreeEdge,Blue,Solid,1", "Shrink:0", @ "TitleDisplay:ON", "MinMaxDisplay:ON", @ "ValueDisplay:OFF", "Filter:None", @ "ScaleFactor:1.", "LabelStyle:Fixed, 8, White, 4"], TRUE ) dump i_return_value i_return_value =

Main Index

@

Chapter 6: Results Postprocessing Functions 1035 Data Register Definition Functions

res_display_fringe_post( "", 0, "Nodal", TRUE, TRUE ) dump i_return_value #---------------------------------------------------------------------

res_data_list_min

()

# # Purpose : This file provides an example of a call to the # function res_data_list_min() # # This session file associates a series of # database result specifiers with a specific # register, saves the new register, scans the # minimum value and displays the fringe plot. # # Before running this session file run dyna.ses # and import result file dyna.op2 to create # dyna.db with results. For instructions # see file dyna.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_list_min() # has the following arguments: # # res_data_list_min # ( register, # location, # register_type, # method, # derivation ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] STRING s_method[16] STRING s_derivation[16] INTEGER i_return_value INTEGER res_create_drv_maxmin_new_lcid INTEGER res_create_drv_maxmin_new_scid INTEGER res_create_drv_maxmin_new_rcid #--------------------------------------------------------------------# Opens the file dyna.db uil_file_open.go ("dyna.db") #--------------------------------------------------------------------# Register definition i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Mode 1:Freq.=751.31", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "" , 0. ) dump i_return_value #--------------------------------------------------------------------# Associates series of result with specified register i_return_value = @ res_data_dbres_list(0, "Nodal", "Vector", 2, @ ["Default", "Default"], ["Mode 1:Freq." // @ "=751.31", "Mode 2:Freq.=1394.7"], @ ["Eigenvectors", "Eigenvectors"], @ ["Translational", "Translational"], @ ["(NON-LAYERED)", "(NON-LAYERED)"]) dump i_return_value

Main Index

1036 PCL Reference Manual Examples Data Register Definition Functions

#--------------------------------------------------------------------# Argument initialization i_register = 0 s_location = "Nodal" s_register_type = "Vector" s_method = "Algebraic" s_derivation = "MAG" #--------------------------------------------------------------------# Scans the maximum value i_return_value = @ res_data_list_min @ ( i_register, @ s_location, @ s_register_type, @ s_method, @ s_derivation ) dump i_return_value #--------------------------------------------------------------------# Creates loadcase, subcase and saves data into it i_return_value = @ res_db_create_loadcase_c( "Derived Results", @ 1, "Created by Results Derive", res_create_drv_maxmin_new_lcid ) dump i_return_value i_return_value = @ res_db_create_subcase_c( 2, "Subcase 1", @ res_create_drv_maxmin_new_scid, res_create_drv_maxmin_new_rcid ) dump i_return_value i_return_value = @ res_data_save( 0, "Nodal", "Vector", @ "Derived Results", "Subcase 1", "", "Eigenvectors", "", 0, [""]) dump i_return_value #--------------------------------------------------------------------# Plots the new result case i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Scalar", @ "Derived Results", "Subcase 1", @ "Eigenvectors", "", "(NON-LAYERED)", "MAG",@ "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_title( 0, "Nodal", "Scalar", 1, @ ["Derived Results, Subcase 1, Eigenvectors,@ - Magnitude, (NON-LAYERED)"] ) dump i_return_value i_return_value = @ res_display_fringe_create( "", "FreeFaces", 0 @ , [""], 12, ["Range:Fri_default_Fringe", @ "RangeOverwrite:ON", "FringeStyle:Disc" // @ "rete/Smooth", "Shade:None", "ElemEdge:" //@ "FreeEdge,Blue,Solid,1", "Shrink:0", @ "TitleDisplay:ON", "MinMaxDisplay:ON", @ "ValueDisplay:OFF", "Filter:None", @ "ScaleFactor:1.", "LabelStyle:Fixed, 8, White, 4"], TRUE ) dump i_return_value i_return_value = @ res_display_fringe_post( "", 0, "Nodal", TRUE, TRUE ) dump i_return_value #---------------------------------------------------------------------

res_data_list_interp_gv #

Main Index

()

Chapter 6: Results Postprocessing Functions 1037 Data Register Definition Functions

# Purpose : This file provides an example of a call to the # function res_data_list_interp_gv() # # This session file interpolates the result data # for the given value and saves it in a new # result case # # Before running this session file run dyna.ses # and import result file dyna.op2 to create # dyna.db with results. For instructions # see file dyna.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_list_interp_gv() # has the following arguments: # # res_data_list_interp_gv # ( register, # location, # register_type, # global_name, # value, # interpolation, # extrapolation ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] STRING s_global_name[16] REAL r_value STRING s_interpolation[16] STRING s_extrapolation[16] INTEGER res_create_drv_maxmin_new_lcid INTEGER res_create_drv_maxmin_new_scid INTEGER res_create_drv_maxmin_new_rcid INTEGER i_return_value #--------------------------------------------------------------------# Opens the file dyna.db uil_file_open.go ("dyna.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "Default", "Mode 1:Freq.=751.31", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "MAG", "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_dbres_list( 1, "Nodal", "Scalar", 1, @ ["Default"], ["Mode 2:Freq.=1394.7"], @ ["Eigenvectors"], ["Translational"], @ ["(NON-LAYERED)"] ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_register = 1 s_location = "Nodal" s_register_type = "Scalar" s_global_name = "Frequency" r_value = 1000.00 s_interpolation = "Linear"

Main Index

1038 PCL Reference Manual Examples Data Register Definition Functions

s_extrapolation = "Linear" #--------------------------------------------------------------------# Interpolates for the given value i_return_value = @ res_data_list_interp_gv @ ( i_register, @ s_location, @ s_register_type, @ s_global_name, @ r_value, @ s_interpolation, @ s_extrapolation ) dump i_return_value #--------------------------------------------------------------------# Creates new result case and saves new register in it. i_return_value = @ res_db_create_loadcase_c("Derived Results", 1,@ "Created by Results Derive", res_create_drv_maxmin_new_lcid ) dump i_return_value i_return_value = @ res_db_create_subcase_c( 2, "Subcase 1", @ res_create_drv_maxmin_new_scid, res_create_drv_maxmin_new_rcid ) dump i_return_value i_return_value = @ res_data_save( 1, "Nodal", "Scalar", @ "Derived Results", "Subcase 1", @ "(NON-LAYERED)", "New Result", "Frequency=1000.00" ) dump i_return_value #--------------------------------------------------------------------# Creates a plot of new result case i_return_value = @ res_display_fringe_create("", "FreeFaces", 0, @ [""], 12, ["Range:Fri_default_Fringe", @ "RangeOverwrite:ON", "FringeStyle:Disc" // @ "rete/Smooth", "Shade:None", "ElemEdge" // @ ":FreeEdge,Blue,Solid,1", "Shrink:0", @ "TitleDisplay:ON", "MinMaxDisplay:ON", @ "ValueDisplay:OFF", "Filter:None ", @ "ScaleFactor:1.", "LabelStyle:Fixed, 8, White, 4"], TRUE ) dump i_return_value i_return_value = @ res_display_fringe_post( "", 1, "Nodal", TRUE, TRUE ) dump i_return_value #---------------------------------------------------------------------

()

res_data_list_interp_factor # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_data_list_interp_factor() This session file interpolates the result data between two result data for the given factor and saves it in a new result case. New result case is created using existing result case, then interpolation is done between existing and new result case and interpolated case is saved and fringe plot is created. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions

Chapter 6: Results Postprocessing Functions 1039 Data Register Definition Functions

# see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_list_interp_factor() # has the following arguments: # # res_data_list_interp_factor # ( register, # location, # register_type, # factor, # interpolation, # extrapolation ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] REAL r_factor STRING s_interpolation[16] STRING s_extrapolation[16] INTEGER res_create_demo_lcid INTEGER res_create_demo_scid INTEGER res_create_demo_rcid INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Creating new load and result case i_return_value = @ res_db_create_loadcase_c( "COMBINE", 1, @ "Assign Results To A Load Case", res_create_demo_lcid) dump i_return_value i_return_value = @ res_db_create_subcase_c( 5, "Subcase 3", @ res_create_demo_scid, res_create_demo_rcid) dump i_return_value i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Vector", @ "SPOOL_LOADS", "Static Subcase", @ "Displacements", "Translational", @ "(NON-LAYERED)", "", "", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_dbres_list( 1, "Nodal", "Vector", 1, @ ["SPOOL_LOADS"], ["Static Subcase"], @ ["Displacements"], ["Translational"], @ ["(NON-LAYERED)"] ) dump i_return_value i_return_value = @ res_data_list_sum( 1, "Nodal", "Vector", 1, [2.]) dump i_return_value i_return_value = @ res_data_save(1, "Nodal", "Vector", "COMBINE",@ "Subcase 3", "(NON-LAYERED)", "Displacements", "Translational") dump i_return_value #---------------------------------------------------------------------

Main Index

1040 PCL Reference Manual Examples Data Register Definition Functions

# Register definition i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Vector", @ "SPOOL_LOADS", "Static Subcase", @ "Displacements", "Translational", @ "(NON-LAYERED)", "", "", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_dbres_list( 1, "Nodal", "Vector", 1, @ ["COMBINE"], ["Subcase 3"], @ ["Displacements"], ["Translational"], @ ["(NON-LAYERED)"] ) dump i_return_value #--------------------------------------------------------------------# Creating load and subcase i_return_value = @ res_db_create_loadcase_c( "NEW", 1, @ "Assign Results To A Load Case", res_create_demo_lcid ) dump i_return_value i_return_value = @ res_db_create_subcase_c( 6, "Subcase 4", @ res_create_demo_scid, res_create_demo_rcid ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_register = 1 s_location = "Nodal" s_register_type = "Vector" r_factor = 0.2 s_interpolation = "Linear" s_extrapolation = "Error" #--------------------------------------------------------------------# Interpolates the data i_return_value = @ res_data_list_interp_factor @ ( i_register, @ s_location, @ s_register_type, @ r_factor, @ s_interpolation, @ s_extrapolation ) dump i_return_value #--------------------------------------------------------------------# Saves the new data i_return_value = @ res_data_save(1, "Nodal", "Vector", "NEW",@ "Subcase 4", "(NON-LAYERED)", "Displacements", "Translational" ) dump i_return_value #--------------------------------------------------------------------# Creating plot for the new case i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "NEW", "Subcase 4", "Displacements", @ "Translational", "(NON-LAYERED)", "MAG", @ "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_display_fringe_create( "", "FreeFaces", 0,@ [""], 12, ["Range:Fri_default_Fringe", @ "RangeOverwrite:ON", "FringeStyle:Disc" // @ "rete/Smooth", "Shade:None", "ElemEdge" // @ ":FreeEdge,Blue,Solid,1", "Shrink:0", @ "TitleDisplay:ON", "MinMaxDisplay:ON", @ "ValueDisplay:OFF", "Filter:None", @

Main Index

Chapter 6: Results Postprocessing Functions 1041 Data Register Definition Functions

"ScaleFactor:1.", "LabelStyle:Fixed, 12, White, 4"], TRUE) dump i_return_value i_return_value = @ res_display_fringe_post( "", 1, "Nodal", TRUE, TRUE ) dump i_return_value #---------------------------------------------------------------------

res_data_function

()

# # Purpose : This file provides an example of a call to the # function res_data_function() # # This session file creates the new register # defined according to PCL function. Two # registers are added to create a new register. # # Before running this session file run dyna.ses # and import result file dyna.op2 to create # dyna.db with results. For instructions # see file dyna.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_function() # has the following arguments: # # res_data_function # ( register, # location, # register_type, # function ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] STRING s_function[32] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file dyna.db uil_file_open.go ("dyna.db") #--------------------------------------------------------------------# Defining two registers i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "Default", "Mode 1:Freq.=751.31", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "MAG", "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_load_dbresult( 2, "Nodal", "Scalar", @ "Default", "Mode 2:Freq.=1394.7", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "MAG", "AsIs", "", "", "", "", 0. ) #--------------------------------------------------------------------# Argument initialization i_register = 3 s_location = "Nodal" s_register_type = "Scalar" s_function = "$1 + $2"

Main Index

1042 PCL Reference Manual Examples Data Register Definition Functions

#--------------------------------------------------------------------# Creates a new register i_return_value = @ res_data_function @ ( i_register, @ s_location, @ s_register_type, @ s_function ) dump i_return_value #--------------------------------------------------------------------# Creates a plot of new register i_return_value = @ res_display_fringe_create("", "FreeFaces", 0, @ [""], 12, ["Range:Fri_default_Fringe", @ "RangeOverwrite:ON", "FringeStyle:Disc" // @ "rete/Smooth", "Shade:None", "ElemEdge" // @ ":FreeEdge,Blue,Solid,1", "Shrink:0", @ "TitleDisplay:ON", "MinMaxDisplay:ON", @ "ValueDisplay:OFF", "Filter:None ", @ "ScaleFactor:1.", "LabelStyle:Fixed, 8, White, 4"], TRUE ) dump i_return_value i_return_value = @ res_display_fringe_post( "", 3, "Nodal", TRUE, TRUE ) dump i_return_value #--------------------------------------------------------------------.

res_data_scalar_to_vector

()

# # Purpose : This file provides an example of a call to the # function res_data_scalar_to_vector() # # This session file converts three scalar # registers to a vector register. # # Before running this session file run dyna.ses # and import result file dyna.op2 to create # dyna.db with results. For instructions # see file dyna.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_scalar_to_vector() # has the following arguments: # # res_data_scalar_to_vector # ( vector_register, # location, # coordinates, # scalar_registers ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_vector_register STRING s_location[16] STRING s_coordinates[16] INTEGER ia_scalar_registers(3) LOGICAL l_return_value INTEGER i_return_value #--------------------------------------------------------------------# Opens the file "dyna.db" uil_file_open.go( "dyna.db") #---------------------------------------------------------------------

Main Index

Chapter 6: Results Postprocessing Functions 1043 Data Register Definition Functions

# Defining the registers i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Scalar", @ "Default", "Mode 1:Freq.=751.31", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "XX", "Coord 0", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "Default", "Mode 1:Freq.=751.31", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "YY", "Coord 0", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_load_dbresult( 2, "Nodal", "Scalar", @ "Default", "Mode 1:Freq.=751.31", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "ZZ", "Coord 0", "", "", "", "", 0. ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_vector_register = 3 s_location = "Nodal" s_coordinates = "Coord 0" ia_scalar_registers = [0, 1, 2] #--------------------------------------------------------------------# Converting from scalar to vector i_return_value = @ res_data_scalar_to_vector @ ( i_vector_register, @ s_location, @ s_coordinates, @ ia_scalar_registers ) dump i_return_value #--------------------------------------------------------------------# Checking whether vector register is defined or not l_return_value = @ res_data_defined(3, "Nodal", "Vector") dump l_return_value #---------------------------------------------------------------------

()

res_data_scalar_to_tensor # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_data_scalar_to_tensor() This session file converts six scalar registers to a tensor register. Before running this session file run dyna.ses and import result file dyna.op2 to create dyna.db with results. For instructions see file dyna.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_data_scalar_to_tensor() has the following arguments: res_data_scalar_to_tensor ( tensor_register,

1044 PCL Reference Manual Examples Data Register Definition Functions

# location, # coordinates, # scalar_registers ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_tensor_register STRING s_location[16] STRING s_coordinates[16] INTEGER ia_scalar_registers(6) LOGICAL l_return_value INTEGER i_return_value #--------------------------------------------------------------------# Opens the file dyna.db uil_file_open.go("dyna.db") #--------------------------------------------------------------------# Defining the registers i_return_value = @ res_data_load_dbresult(0, "Element", "Scalar",@ "Default", "Mode 1:Freq.=751.31", @ "Stress Tensor", "", "At Z1", "XX", "AsIs",@ "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_load_dbresult(1, "Element", "Scalar",@ "Default", "Mode 1:Freq.=751.31", @ "Stress Tensor", "", "At Z1", "YY", "AsIs",@ "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_load_dbresult(2, "Element", "Scalar",@ "Default", "Mode 1:Freq.=751.31", @ "Stress Tensor", "", "At Z1", "ZZ", "AsIs",@ "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_load_dbresult(3, "Element", "Scalar",@ "Default", "Mode 1:Freq.=751.31", @ "Stress Tensor", "", "At Z1", "XY", "AsIs",@ "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_load_dbresult(4, "Element", "Scalar",@ "Default", "Mode 1:Freq.=751.31", @ "Stress Tensor", "", "At Z1", "YZ", "AsIs",@ "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_load_dbresult(5, "Element", "Scalar",@ "Default", "Mode 1:Freq.=751.31", @ "Stress Tensor", "", "At Z1", "ZX", "AsIs",@ "", "", "", "", 0. ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_tensor_register = 6 s_location = "Element" s_coordinates = "AsIs" ia_scalar_registers = [0, 1, 2, 3, 4, 5] #--------------------------------------------------------------------# Converting from scalar to tensor i_return_value = @ res_data_scalar_to_tensor @

Main Index

Chapter 6: Results Postprocessing Functions 1045 Data Register Definition Functions

(

i_tensor_register, @ s_location, @ s_coordinates, @ ia_scalar_registers ) dump i_return_value #--------------------------------------------------------------------# Checking whether vector register is defined or not l_return_value = @ res_data_defined(6, "Element", "Tensor") dump l_return_value #---------------------------------------------------------------------

res_data_complex_form

()

# # Purpose : This file provides an example of a call to the # function res_data_complex_form() # # This session file specifies the method for # determining the output format. Output format is # changed from Real to Magnitude. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_complex_form() # has the following arguments: # # res_data_complex_form # ( register, # location, # register_type, # form, # angle ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] STRING s_form[16] REAL r_angle STRING s_load_case[32] STRING s_subcase[32] STRING s_primary_result[32] STRING s_secondary_result[32] STRING s_layer[32] STRING s_derivation[16] STRING s_coordinate[16] STRING s_average_method[16] STRING s_average_domain[16] STRING s_extrapolation[16] LOGICAL l_list_flag LOGICAL l_layer_flag STRING s_data_form[16] REAL r_complex_angle INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db

Main Index

1046 PCL Reference Manual Examples Data Register Definition Functions

uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "VONM", @ "Default", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value #--------------------------------------------------------------------# Gets the register information i_return_value = @ res_data_get_dbresult(1, "Nodal", "Scalar", @ s_load_case, s_subcase, s_primary_result, @ s_secondary_result, s_layer, s_derivation, @ s_coordinate, s_average_method, @ s_average_domain, s_extrapolation, @ l_list_flag, l_layer_flag, s_data_form, r_complex_angle ) dump i_return_value dump s_data_form #--------------------------------------------------------------------# Argument initialization i_register = 1 s_location = "Nodal" s_register_type = "Scalar" s_form = "Magnitude" r_angle = 0. #--------------------------------------------------------------------# Changes the output format i_return_value = @ res_data_complex_form @ ( i_register, @ s_location, @ s_register_type, @ s_form, @ r_angle ) dump i_return_value #--------------------------------------------------------------------# Gets the register information i_return_value = @ res_data_get_dbresult(1, "Nodal", "Scalar", @ s_load_case, s_subcase, s_primary_result, @ s_secondary_result, s_layer, s_derivation, @ s_coordinate, s_average_method, @ s_average_domain, s_extrapolation, @ l_list_flag, l_layer_flag, s_data_form, r_complex_angle ) dump i_return_value dump s_data_form #---------------------------------------------------------------------

Main Index

Chapter 6: Results Postprocessing Functions 1047 Data Register Query Functions

Data Register Query Functions This section contains examples of some of the functions used to query the data registers for information. res_data_next

()

# # Purpose : This file provides an example of a call to the # function res_data_next() # # This session file returns the next available # unused register identifier of the specified # location and type. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_next() # has the following arguments: # # res_data_next # ( location, # register_type ) # #--------------------------------------------------------------------# Variable Declarations STRING s_location[16] STRING s_register_type[16] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defines register 1 i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Displacements", "Translational", @ "(NON-LAYERED)", "MAG", "Default", @ "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value #--------------------------------------------------------------------# Argument initialization s_location = "Nodal" s_register_type = "Scalar" #--------------------------------------------------------------------# Gets the unused register identifier i_return_value = @ res_data_next @ ( s_location, @ s_register_type ) dump i_return_value # This value shows next available unused register identifier #---------------------------------------------------------------------

Main Index

1048 PCL Reference Manual Examples Data Register Query Functions

res_data_defined

() # # Purpose : This file provides an example of 2 calls to the # function res_data_defined() # # This session file returns logical value # depending on whether register has been defined # or not. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_defined() # has the following arguments: # # res_data_defined # ( register, # location, # register_type ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] INTEGER i_return_value LOGICAL l_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_register = 1 s_location = "Nodal" s_register_type = "Scalar" #--------------------------------------------------------------------# Checks whether register is defined or not l_return_value = @ res_data_defined @ ( i_register, @ s_location, @ s_register_type ) dump l_return_value #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "VONM", @ "Default", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value #--------------------------------------------------------------------# Checks whether register is defined or not l_return_value = @ res_data_defined @

Main Index

Chapter 6: Results Postprocessing Functions 1049 Data Register Query Functions

(

i_register, @ s_location, @ s_register_type ) dump l_return_value #---------------------------------------------------------------------

res_data_dump

()

# # Purpose : This file provides an example of a call to the # function res_data_dump() # # This session file dumps the data of the # specified register to a file "register". # File can be seen in any text editor. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_dump() # has the following arguments: # # res_data_dump # ( register, # location, # register_type, # file_name, # file_options ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] STRING s_file_name[16] STRING s_file_options[16] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "VONM", @ "Default", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_register = 1 s_location = "Nodal" s_register_type= "Scalar" s_file_name = "register" s_file_options = "WRN" #--------------------------------------------------------------------# Writing data to a file i_return_value = @ res_data_dump @

Main Index

1050 PCL Reference Manual Examples Data Register Query Functions

(

i_register, s_location, s_register_type, s_file_name, s_file_options ) dump i_return_value

@ @ @ @

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

res_data_csys_dump

()

# # Purpose : This file provides an example of a call to the # function res_data_csys_dump() # # This session file dumps the coordinate system # information to a file "coordinate.1" from all # defined registers. File can be seen in any text # editor. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_csys_dump() # has the following arguments: # # res_data_csys_dump # ( file_name, # file_options ) # #--------------------------------------------------------------------# Variable Declarations STRING s_file_name[16] STRING s_file_options[16] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining the registers i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "VONM", @ "Coord 1", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value

Main Index

i_return_value = res_data_load_dbresult( 2, "Nodal", "Scalar", "SPOOL_LOADS", "Static Subcase", "Displacements", "Translational", "(NON-LAYERED)", "MAG", "Coord 0", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value

@ @ @ @ @

i_return_value = res_data_load_dbresult( 3, "Nodal", "Scalar", "SPOOL_LOADS", "Static Subcase", "Constraint Forces", "Translational",

@ @ @ @

Chapter 6: Results Postprocessing Functions 1051 Data Register Query Functions

"(NON-LAYERED)", "MAG", "Coord 1", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value

@

#--------------------------------------------------------------------# Argument initialization s_file_name = "coordinate" s_file_options = "NW" #--------------------------------------------------------------------# Writes information to the file i_return_value = @ res_data_csys_dump @ ( s_file_name, @ s_file_options ) dump i_return_value #---------------------------------------------------------------------

res_data_pattern_dump

()

# # Purpose : This file provides an example of a call to the # function res_data_pattern_dump() # # This session file dumps the register data # pattern information to a file "pattern.1" # from all defined registers. File can be seen # in any text editor # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_pattern_dump() # has the following arguments: # # res_data_pattern_dump # ( file_name, # file_options ) # #--------------------------------------------------------------------# Variable Declarations STRING s_file_name[16] STRING s_file_options[16] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "VONM", @ "Coord 1", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value i_return_value = @ res_data_load_dbresult( 2, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @

Main Index

1052 PCL Reference Manual Examples Data Register Query Functions

"Displacements", "Translational", "(NON-LAYERED)", "MAG", "Coord 0", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value

@ @

i_return_value = res_data_load_dbresult( 3, "Nodal", "Scalar", "SPOOL_LOADS", "Static Subcase", "Constraint Forces", "Translational", "(NON-LAYERED)", "MAG", "Coord 1", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value

@ @ @ @ @

#--------------------------------------------------------------------# Argument initialization s_file_name = "pattern" s_file_options = "NW" #--------------------------------------------------------------------# Writes information to the file i_return_value = @ res_data_pattern_dump @ ( s_file_name, @ s_file_options ) dump i_return_value #---------------------------------------------------------------------

res_data_get_source_type

()

# # Purpose : This file provides an example of a call to the # function res_data_get_source_type() # # This session file returns the registers data # source type. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_get_source_type() # has the following arguments: # # res_data_get_source_type # ( register, # location, # register_type, # source_type ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] STRING s_source_type[16] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #---------------------------------------------------------------------

Main Index

Chapter 6: Results Postprocessing Functions 1053 Data Register Query Functions

# Defining a register i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "VONM", @ "Default", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_register = 1 s_location = "Nodal" s_register_type = "Scalar" #--------------------------------------------------------------------# Gets the source type i_return_value = @ res_data_get_source_type @ ( i_register, @ s_location, @ s_register_type, @ s_source_type ) dump i_return_value dump s_source_type #---------------------------------------------------------------------

()

res_data_get_dbresult # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_data_get_dbresult() This session file returns the stored information regarding a register containing a database result. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_data_get_dbresult() has the following arguments: res_data_get_dbresult ( register, location, register_type, load_case, subcase, primary_result, secondary_result, layer, derivation, coordinate, average_method, average_domain, extrapolation, list_flag, layer_flag, data_form, complex_angle )

1054 PCL Reference Manual Examples Data Register Query Functions

#--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] STRING s_load_case[32] STRING s_subcase[32] STRING s_primary_result[32] STRING s_secondary_result[32] STRING s_layer[32] STRING s_derivation[16] STRING s_coordinate[16] STRING s_average_method[16] STRING s_average_domain[16] STRING s_extrapolation[16] LOGICAL l_list_flag LOGICAL l_layer_flag STRING s_data_form[16] REAL r_complex_angle INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 1, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "VONM", @ "Default", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_register = 1 s_location = "Nodal" s_register_type = "Scalar" #--------------------------------------------------------------------# Gets information regarding register i_return_value = @ res_data_get_dbresult @ ( i_register, @ s_location, @ s_register_type, @ s_load_case, @ s_subcase, @ s_primary_result, @ s_secondary_result, @ s_layer, @ s_derivation, @ s_coordinate, @ s_average_method, @ s_average_domain, @ s_extrapolation, @ l_list_flag, @ l_layer_flag, @ s_data_form, @ r_complex_angle ) dump i_return_value dump s_load_case dump s_subcase dump s_primary_result dump s_secondary_result dump s_layer dump s_derivation dump s_coordinate dump s_average_method dump s_average_domain dump s_extrapolation

Main Index

Chapter 6: Results Postprocessing Functions 1055 Data Register Query Functions

dump l_list_flag dump l_layer_flag dump s_data_form dump r_complex_angle #---------------------------------------------------------------------

()

res_data_get_subcase_name

# # Purpose : This file provides an example of a call to the # function res_data_get_subcase_name() # # This session file returns the name of the # subcase related to the specified loadcase. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_get_subcase_name() # has the following arguments: # # res_data_get_subcase_name # ( load_case, # subcase, # subcase_name ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_load_case INTEGER i_subcase STRING s_subcase_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_load_case = 4 i_subcase = 2 #--------------------------------------------------------------------# Gets the name of subcase i_return_value = @ res_data_get_subcase_name @ ( i_load_case, @ i_subcase, @ s_subcase_name ) dump i_return_value dump s_subcase_name #---------------------------------------------------------------------

()

res_data_get_subcase_id # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_data_get_subcase_id() This session file returns the subcase

1056 PCL Reference Manual Examples Data Register Query Functions

# identifier related to the specified loadcase. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_get_subcase_id() # has the following arguments: # # res_data_get_subcase_id # ( load_case, # subcase, # subcase_id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_load_case[32] STRING s_subcase[32] INTEGER i_subcase_id INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization s_load_case = "SPOOL_LOADS" s_subcase = "Static Subcase" #--------------------------------------------------------------------# Gets the subcase id i_return_value = @ res_data_get_subcase_id @ ( s_load_case, @ s_subcase, @ i_subcase_id ) dump i_return_value dump i_subcase_id #---------------------------------------------------------------------

()

res_data_get_result_names # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_data_get_result_names() This session file returns the primary and secondary result names. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_data_get_result_names() has the following arguments:

Chapter 6: Results Postprocessing Functions 1057 Data Register Query Functions

# # res_data_get_result_names # ( primary_result, # secondary_result, # primary_name, # secondary_name ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_primary_result INTEGER i_secondary_result STRING s_primary_name[32] STRING s_secondary_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_primary_result = 2 i_secondary_result = 1 #--------------------------------------------------------------------# Gets the names of result i_return_value = @ res_data_get_result_names @ ( i_primary_result, @ i_secondary_result, @ s_primary_name, @ s_secondary_name ) dump i_return_value dump s_primary_name dump s_secondary_name #---------------------------------------------------------------------

res_data_get_result_ids

()

# # Purpose : This file provides an example of a call to the # function res_data_get_result_ids() # # This session file returns the primary and # secondary result identifiers. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_get_result_ids() # has the following arguments: # # res_data_get_result_ids # ( primary_name, # secondary_name, # primary_result, # secondary_result ) # #--------------------------------------------------------------------# Variable Declarations STRING s_primary_name[32] STRING s_secondary_name[32]

Main Index

1058 PCL Reference Manual Examples Data Register Query Functions

INTEGER i_primary_result INTEGER i_secondary_result INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization s_primary_name = "Displacements" s_secondary_name = "Translational" #--------------------------------------------------------------------# Gets the result ids i_return_value = @ res_data_get_result_ids @ ( s_primary_name, @ s_secondary_name, @ i_primary_result, @ i_secondary_result ) dump i_return_value dump i_primary_result dump i_secondary_result #---------------------------------------------------------------------

res_data_get_layerpos_name

()

# # Purpose : This file provides an example of a call to the # function res_data_get_layerpos_name() # # This session file returns the name of the layer # position. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_get_layerpos_name() # has the following arguments: # # res_data_get_layerpos_name # ( layer_id, # layer_name ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_layer_id STRING s_layer_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_layer_id = 2 #--------------------------------------------------------------------# Gets the name of layer position i_return_value = @ res_data_get_layerpos_name @ ( i_layer_id, @ s_layer_name )

Main Index

Chapter 6: Results Postprocessing Functions 1059 Data Register Query Functions

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

()

res_data_get_layerpos_id

# # Purpose : This file provides an example of a call to the # function res_data_get_layerpos_id() # # This session file returns the layer position # identifier. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_get_layerpos_id() # has the following arguments: # # res_data_get_layerpos_id # ( layer_name, # layer_id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_layer_name[32] INTEGER i_layer_id INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization s_layer_name = "At Z1" #--------------------------------------------------------------------# Gets the layer id i_return_value = @ res_data_get_layerpos_id @ ( s_layer_name, @ i_layer_id ) dump i_return_value dump i_layer_id #---------------------------------------------------------------------

()

res_data_bulk_get_loadcases # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_data_bulk_get_loadcases() This session file extracts information regarding loadcases and coordinate ids from the database. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result

1060 PCL Reference Manual Examples Data Register Query Functions

# file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_bulk_get_loadcases() # has the following arguments: # # res_data_bulk_get_loadcases # ( count, # load_case_ids, # subcase_ids, # coordinates, # load_case ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_count INTEGER ia_load_case_ids(4) INTEGER ia_subcase_ids(4) INTEGER ia_coordinates(4) STRING sa_load_case[32](4) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Gets the information regarding loadcases and coordinate ids i_return_value = @ res_data_bulk_get_loadcases @ ( i_count, @ ia_load_case_ids, @ ia_subcase_ids, @ ia_coordinates, @ sa_load_case ) dump i_return_value dump i_count dump ia_load_case_ids dump ia_subcase_ids dump ia_coordinates dump sa_load_case #---------------------------------------------------------------------

()

res_data_get_restype_ids # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_data_get_restype_ids() This session file returns the primary and secondary result ids. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_data_get_restype_ids()

Chapter 6: Results Postprocessing Functions 1061 Data Register Query Functions

# has the following arguments: # # res_data_get_restype_ids # ( restype_id, # primary_result, # secondary_result ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_restype_id INTEGER i_primary_result INTEGER i_secondary_result INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Argument initialization i_restype_id = 2 #--------------------------------------------------------------------# Gets the result ids i_return_value = @ res_data_get_restype_ids @ ( i_restype_id, @ i_primary_result, @ i_secondary_result ) dump i_return_value dump i_primary_result dump i_secondary_result #---------------------------------------------------------------------

Main Index

1062 PCL Reference Manual Examples Data Register Operator Functions

Data Register Operator Functions This section contains examples of some of the functions that operate on the registers themselves. res_data_delete

()

# # Purpose : This file provides an example of a call to the # function res_data_delete() # # This session file deletes the current # definition of the specified register. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_delete() # has the following arguments: # # res_data_delete # ( register, # location, # register_type ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] INTEGER i_return_value LOGICAL l_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Vector", @ "SPOOL_LOADS", "Static Subcase", @ "Displacements", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "", 0. ) dump i_return_value #--------------------------------------------------------------------# Checking whether register is defined or not l_return_value = @ res_data_defined(0, "Nodal", "Vector") dump l_return_value #--------------------------------------------------------------------# Argument initialization i_register = 0 s_location = "Nodal" s_register_type = "Vector" #--------------------------------------------------------------------# Deletes the data i_return_value = @ res_data_delete @

Main Index

Chapter 6: Results Postprocessing Functions 1063 Data Register Operator Functions

(

i_register, @ s_location, @ s_register_type ) dump i_return_value #--------------------------------------------------------------------# Checking whether register is defined or not l_return_value = @ res_data_defined(0, "Nodal", "Vector") dump l_return_value #---------------------------------------------------------------------

res_data_save

()

# # Purpose : This file provides an example of a call to the # function res_data_save() # # This session file creates new result case and # saves it. # # Before running this session file run dyna.ses # and import result file dyna.op2 to create # dyna.db with results. For instructions # see file dyna.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_data_save() # has the following arguments: # # res_data_save # ( register, # location, # register_type, # load_case, # subcase, # layer, # primary_result, # secondary_result ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_register STRING s_location[16] STRING s_register_type[16] STRING s_load_case[16] STRING s_subcase[16] STRING s_layer[16] STRING s_primary_result[16] STRING s_secondary_result[16] INTEGER res_create_drv_maxmin_new_lcid INTEGER res_create_drv_maxmin_new_scid INTEGER res_create_drv_maxmin_new_rcid INTEGER i_return_value #--------------------------------------------------------------------# Opens the file dyna.db uil_file_open.go ("dyna.db") #--------------------------------------------------------------------# Register definition i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Mode 1:Freq.=751.31", @ "Eigenvectors", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "" , 0. )

Main Index

1064 PCL Reference Manual Examples Data Register Operator Functions

dump i_return_value #--------------------------------------------------------------------# Associates series of result with specified register i_return_value = @ res_data_dbres_list(0, "Nodal", "Vector", 2, @ ["Default", "Default"], ["Mode 1:Freq." // @ "=751.31", "Mode 2:Freq.=1394.7"], @ ["Eigenvectors", "Eigenvectors"], @ ["Translational", "Translational"], @ ["(NON-LAYERED)", "(NON-LAYERED)"]) dump i_return_value #--------------------------------------------------------------------# Creating loadcase and subcase i_return_value = @ res_db_create_loadcase_c( "Derived Results", @ 1, "Created by Results Derive", res_create_drv_maxmin_new_lcid ) dump i_return_value i_return_value = @ res_db_create_subcase_c( 2, "Subcase 1", @ res_create_drv_maxmin_new_scid, res_create_drv_maxmin_new_rcid ) dump i_return_value #--------------------------------------------------------------------# Argument initialization i_register = 0 s_location = "Nodal" s_register_type = "Vector" s_load_case = "Derived Results" s_subcase = "Subcase 1" s_layer = "" s_primary_result = "Eigenvectors" s_secondary_result = "" #--------------------------------------------------------------------# Saves the new result case i_return_value = @ res_data_save @ ( i_register, @ s_location, @ s_register_type, @ s_load_case, @ s_subcase, @ s_layer, @ s_primary_result, @ s_secondary_result ) dump i_return_value #--------------------------------------------------------------------# Plots the fringe plot of new result case i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Scalar", @ "Derived Results", "Subcase 1", @ "Eigenvectors", "", "(NON-LAYERED)", "MAG",@ "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_title( 0, "Nodal", "Scalar", 1, @ ["Derived Results, Subcase 1, Eigenvectors,@ - Magnitude, (NON-LAYERED)"] ) dump i_return_value i_return_value = @ res_display_fringe_create( "", "FreeFaces", 0 @ , [""], 12, ["Range:Fri_default_Fringe", @ "RangeOverwrite:ON", "FringeStyle:Disc" // @ "rete/Smooth", "Shade:None", "ElemEdge:" //@ "FreeEdge,Blue,Solid,1", "Shrink:0", @ "TitleDisplay:ON", "MinMaxDisplay:ON", @ "ValueDisplay:OFF", "Filter:None", @

Main Index

Chapter 6: Results Postprocessing Functions 1065 Data Register Operator Functions

"ScaleFactor:1.", "LabelStyle:Fixed, 8, White, 4"], TRUE ) dump i_return_value i_return_value = @ res_display_fringe_post( "", 0, "Nodal", TRUE, TRUE ) dump i_return_value #---------------------------------------------------------------------

Main Index

1066 PCL Reference Manual Examples Plot Tool Creation and Modification Functions

Plot Tool Creation and Modification Functions This section contains examples of some of the functions used to create display tools in the database. res_display_fringe_create

()

# # Purpose : This file provides an example of a call to the # function res_display_fringe_create() # # This session file creates a fringe plot tool # definition. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_fringe_create() # has the following arguments: # # res_display_fringe_create # ( plot_name, # entity_type, # ntargets, # targets, # nattribs, # attributes, # deformed_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[16] STRING s_entity_type[16] INTEGER i_ntargets STRING sa_targets[2](1) INTEGER i_nattribs STRING sa_attributes[64](12) LOGICAL l_deformed_flag INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "VONM", @ "Default", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value i_return_value = @ res_data_title( 0, "Nodal", "Scalar", 1, @ ["SPOOL_LOADS, Static Subcase: Stress Tensor, -At Z1 (VONM)"] ) dump i_return_value #--------------------------------------------------------------------# Argument initialization

Main Index

Chapter 6: Results Postprocessing Functions 1067 Plot Tool Creation and Modification Functions

s_plot_name = "" s_entity_type = "FreeFaces" i_ntargets = 0 sa_targets = [""] i_nattribs = 12 sa_attributes(1) = "Range:Fri_default_Fringe" sa_attributes(2) = "RangeOverwrite:ON" sa_attributes(3) = "FringeStyle:Discrete/Smooth" sa_attributes(4) = "Shade:None" sa_attributes(5) = "ElemEdge:FreeEdge,Blue,Solid,1" sa_attributes(6) = "Shrink:0" sa_attributes(7) = "TitleDisplay:ON" sa_attributes(8) = "MinMaxDisplay:ON" sa_attributes(9) = "ValueDisplay:OFF" sa_attributes(10) = "Filter:None" sa_attributes(11) = "ScaleFactor:1." sa_attributes(12) = "LabelStyle:Fixed, 12, LtOrange, 4" l_deformed_flag = TRUE #--------------------------------------------------------------------# Creating a fringe plot tool i_return_value = @ res_display_fringe_create @ ( s_plot_name, @ s_entity_type, @ i_ntargets, @ sa_targets, @ i_nattribs, @ sa_attributes, @ l_deformed_flag ) dump i_return_value #--------------------------------------------------------------------# Displays the plot i_return_value = @ res_display_fringe_post( "", 0, "Nodal", TRUE, TRUE ) dump i_return_value #---------------------------------------------------------------------

()

res_display_fringe_modify # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_fringe_modify() This session file modifies a fringe plot tool definition. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_display_fringe_modify() has the following arguments: res_display_fringe_modify ( plot_name, new_name, entity_type, ntargets, targets, nattribs,

1068 PCL Reference Manual Examples Plot Tool Creation and Modification Functions

# attributes, # deformed_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[16] STRING s_new_name[16] STRING s_entity_type[16] INTEGER i_ntargets STRING sa_targets[2](1) INTEGER i_nattribs STRING sa_attributes[64](12) LOGICAL l_deformed_flag INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defines a register i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "VONM", @ "Default", "DeriveAverage", "All", "ShapeFunc" ) dump i_return_value i_return_value = @ res_data_title( 0, "Nodal", "Scalar", 1, @ ["SPOOL_LOADS, Static Subcase: Stress Tensor, -At Z1 (VONM)"] ) dump i_return_value #--------------------------------------------------------------------# Creates a plot i_return_value = @ res_display_fringe_create( "old_fringe_plot", @ "FreeFaces", 0, [""], 12, @ ["Range:Fri_default_Fringe", @ "RangeOverwrite:ON", @ "FringeStyle:Discrete/Smooth", "Shade:None"@ , "ElemEdge:FreeEdge,Blue,Solid,1", @ "Shrink:0", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ValueDisplay:OFF", @ "Filter:None", "ScaleFactor:1.", @ "LabelStyle:Exponential, 12, White, 3"], TRUE ) dump i_return_value i_return_value = @ res_display_fringe_post( "old_fringe_plot", 0, "Nodal", TRUE, TRUE) dump i_return_value #--------------------------------------------------------------------sf_pause() # Press Resume to continue #--------------------------------------------------------------------# Argument initialization s_plot_name = "old_fringe_plot" s_new_name = "new_fringe_plot" s_entity_type = "FreeFaces" i_ntargets = 0 sa_targets = [""] i_nattribs = 12 sa_attributes(1) = "Range:Fri_new_Fringe_plot" sa_attributes(2) = "RangeOverwrite:ON" sa_attributes(3) = "FringeStyle:Discrete/Smooth" sa_attributes(4) = "Shade:None" sa_attributes(5) = "ElemEdge:FreeEdge,Red,Solid,1" sa_attributes(6) = "Shrink:0" sa_attributes(7) = "TitleDisplay:ON" sa_attributes(8) = "MinMaxDisplay:ON" sa_attributes(9) = "ValueDisplay:OFF"

Main Index

Chapter 6: Results Postprocessing Functions 1069 Plot Tool Creation and Modification Functions

sa_attributes(10) = "Filter:None" sa_attributes(11) = "ScaleFactor:1." sa_attributes(12) = "LabelStyle:Fixed, 12, White, 3" l_deformed_flag = TRUE #--------------------------------------------------------------------# Modifies the fringe plot i_return_value = @ res_display_fringe_modify @ ( s_plot_name, @ s_new_name, @ s_entity_type, @ i_ntargets, @ sa_targets, @ i_nattribs, @ sa_attributes, @ l_deformed_flag ) dump i_return_value #--------------------------------------------------------------------# Displays the modified plot i_return_value = @ res_display_fringe_post( "new_fringe_plot", 0, "Nodal", TRUE, TRUE) dump i_return_value #---------------------------------------------------------------------

res_display_vector_create

()

# # Purpose : This file provides an example of a call to the # function res_display_vector_create() # # This session file creates a vector plot tool # definition. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_vector_create() # has the following arguments: # # res_display_vector_create # ( plot_name, # entity_type, # ntargets, # targets, # nattribs, # attributes, # deformed_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[32] STRING s_entity_type[32] INTEGER i_ntargets STRING sa_targets[2](1) INTEGER i_nattribs STRING sa_attributes[64](16) LOGICAL l_deformed_flag INTEGER i_return_value

Main Index

1070 PCL Reference Manual Examples Plot Tool Creation and Modification Functions

#--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Vector", @ "SPOOL_LOADS", "Static Subcase", @ "Displacements", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "", 0.) dump i_return_value i_return_value = @ res_data_title( 0, "Nodal", "Vector", 1, @ ["SPOOL_LOADS, Static Subcase, @ Displacements, Translational, (NON-LAYERED)"] ) dump i_return_value #--------------------------------------------------------------------# Argument initialization s_plot_name = "Vector_plot" s_entity_type = "Nodes" i_ntargets = 0 sa_targets = [""] i_nattribs = 16 sa_attributes(1) = "Range:Vec_Vector_plot" sa_attributes(2) = "RangeOverwrite:ON" sa_attributes(3) = "VectorDisplay:Resultant" sa_attributes(4) = "VectorComps:ON" sa_attributes(5) = "VectorColors:Spectrum" sa_attributes(6) = "VectorScale:ScreenConstant=0.1" sa_attributes(7) = "VectorAttachment:Tail" sa_attributes(8) = "HeadStyle:Single" sa_attributes(9) = "VectorStyle:Solid" sa_attributes(10)= "TailDisplay:ON" sa_attributes(11)= "TitleDisplay:ON" sa_attributes(12)= "MinMaxDisplay:OFF" sa_attributes(13)= "LabelStyle:Fixed, 12, White, 4" sa_attributes(14)= "ValueDisplay:OFF" sa_attributes(15)= "Filter:Exclude=-1e-36,1e-36" sa_attributes(16)= "ScaleFactor:1." l_deformed_flag = TRUE #--------------------------------------------------------------------# Creates a vector plot tool i_return_value = @ res_display_vector_create @ ( s_plot_name, @ s_entity_type, @ i_ntargets, @ sa_targets, @ i_nattribs, @ sa_attributes, @ l_deformed_flag ) dump i_return_value #--------------------------------------------------------------------# Displays the plot i_return_value = @ res_display_vector_post( "Vector_plot", 0, "Nodal", TRUE, TRUE ) dump i_return_value #---------------------------------------------------------------------

()

res_display_vector_modify # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_vector_modify() This session file modifies a vector plot tool

Chapter 6: Results Postprocessing Functions 1071 Plot Tool Creation and Modification Functions

# definition. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_vector_modify() # has the following arguments: # # res_display_vector_modify # ( plot_name, # new_name, # entity_type, # ntargets, # targets, # nattribs, # attributes, # deformed_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[32] STRING s_new_name[32] STRING s_entity_type[16] INTEGER i_ntargets STRING sa_targets[2](1) INTEGER i_nattribs STRING sa_attributes[64](16) LOGICAL l_deformed_flag INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Vector", @ "SPOOL_LOADS", "Static Subcase", @ "Displacements", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "", 0.) dump i_return_value i_return_value = @ res_data_title( 0, "Nodal", "Vector", 1, @ ["SPOOL_LOADS, Static Subcase, @ Displacements, Translational, (NON-LAYERED)"] ) dump i_return_value #--------------------------------------------------------------------# Creates a vector plot i_return_value = @ res_display_vector_create( "Vector_plot", @ "Nodes", 0, [""], 16, @ ["Range:Vec_default_Vector", @ "RangeOverwrite:ON", @ "VectorDisplay:Resultant", "VectorComps:ON"@ , "VectorColors:Spectrum", @ "VectorScale:ScreenConstant=0.1", @ "VectorAttachment:Tail", "HeadStyle:Single"@ , "VectorStyle:Solid", "TailDisplay:ON", @ "TitleDisplay:ON", "MinMaxDisplay:ON", @ "LabelStyle:Exponential, 12, White, 3", @

Main Index

1072 PCL Reference Manual Examples Plot Tool Creation and Modification Functions

"ValueDisplay:OFF", @ "Filter:Exclude=-1e-36,1e-36", "ScaleFactor:1."], TRUE ) dump i_return_value i_return_value = @ res_display_vector_post( "Vector_plot", 0, "Nodal", TRUE, TRUE ) dump i_return_value #--------------------------------------------------------------------# Press Resume to continue sf_pause() #--------------------------------------------------------------------# Argument initialization s_plot_name = "Vector_plot" s_new_name = "New_vector_plot" s_entity_type = "Nodes" i_ntargets = 0 sa_targets = [""] i_nattribs = 16 sa_attributes(1) = "Range:Vec_Vector_plot" sa_attributes(2) = "RangeOverwrite:ON" sa_attributes(3) = "VectorDisplay:Resultant" sa_attributes(4) = "VectorComps:ON" sa_attributes(5) = "VectorColors:Spectrum" sa_attributes(6) = "VectorScale:ScreenConstant=0.1" sa_attributes(7) = "VectorAttachment:Tail" sa_attributes(8) = "HeadStyle:Double" sa_attributes(9) = "VectorStyle:Solid" sa_attributes(10)= "TailDisplay:ON" sa_attributes(11)= "TitleDisplay:ON" sa_attributes(12)= "MinMaxDisplay:ON" sa_attributes(13)= "LabelStyle:Fixed, 12, Green, 4" sa_attributes(14)= "ValueDisplay:OFF" sa_attributes(15)= "Filter:Exclude=-1e-36,1e-36" sa_attributes(16)= "ScaleFactor:1." l_deformed_flag = TRUE #--------------------------------------------------------------------# Modifies the vector plot i_return_value = @ res_display_vector_modify @ ( s_plot_name, @ s_new_name, @ s_entity_type, @ i_ntargets, @ sa_targets, @ i_nattribs, @ sa_attributes, @ l_deformed_flag ) dump i_return_value #--------------------------------------------------------------------# Displays the plot i_return_value = @ res_display_vector_post("New_vector_plot", 0, "Nodal", TRUE, TRUE) dump i_return_value #---------------------------------------------------------------------

()

res_display_tensor_create # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_tensor_create() This session file creates a tensor plot tool definition Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result

Chapter 6: Results Postprocessing Functions 1073 Plot Tool Creation and Modification Functions

# file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_tensor_create() # has the following arguments: # # res_display_tensor_create # ( plot_name, # entity_type, # ntargets, # targets, # nattribs, # attributes, # deformed_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[16] STRING s_entity_type[16] INTEGER i_ntargets STRING sa_targets[2](1) INTEGER i_nattribs STRING sa_attributes[64](17) LOGICAL l_deformed_flag INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 0, "Centroidal", @ "Tensor", "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "", "AsIs", @ "DeriveAverage", "All", "ShapeFunc", "", 0. ) dump i_return_value i_return_value = @ res_data_title( 0, "Centroidal", "Tensor", 1, @ ["SPOOL_LOADS, Static Subcase, Stress Tensor,, At Z1"] ) dump i_return_value #--------------------------------------------------------------------# Argument initialization s_plot_name = "Tensor_plot" s_entity_type = "Elements" i_ntargets = 0 sa_targets = [""] i_nattribs = 17 sa_attributes(1) = "Range:Ten_Tensor_plot" sa_attributes(2) = "RangeOverwrite:ON" sa_attributes(3) = "TensorDisplay:Component" sa_attributes(4) = "TensorComps:ON,ON,ON,OFF,OFF,OFF" sa_attributes(5) = "TensorColors:spectrum" sa_attributes(6) = "VectorScale:ScreenConstant=0.1" sa_attributes(7) = "HeadStyle:Single" sa_attributes(8) = "VectorStyle:Solid" sa_attributes(9) = "BoxStyle:OFF,Wireframe" sa_attributes(10)= "BoxColor:Yellow" sa_attributes(11)= "BoxScale:ScreenConstant=0.1" sa_attributes(12)= "TitleDisplay:ON" sa_attributes(13)= "MinMaxDisplay:OFF" sa_attributes(14)= "LabelStyle:Fixed, 12, White, 4" sa_attributes(15)= "ValueDisplay:OFF"

Main Index

1074 PCL Reference Manual Examples Plot Tool Creation and Modification Functions

sa_attributes(16)= "Filter:None" sa_attributes(17)= "ScaleFactor:1." l_deformed_flag = TRUE #--------------------------------------------------------------------# Creating a tensor plot i_return_value = @ res_display_tensor_create @ ( s_plot_name, @ s_entity_type, @ i_ntargets, @ sa_targets, @ i_nattribs, @ sa_attributes, @ l_deformed_flag ) dump i_return_value #--------------------------------------------------------------------# Displays the plot i_return_value = @ res_display_tensor_post("Tensor_plot", 0, "Centroidal", TRUE, TRUE) dump i_return_value #---------------------------------------------------------------------

res_display_tensor_modify

()

# # Purpose : This file provides an example of a call to the # function res_display_tensor_modify() # # This session file modifies a tensor plot tool # definition. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_tensor_modify() # has the following arguments: # # res_display_tensor_modify # ( plot_name, # new_name, # entity_type, # ntargets, # targets, # nattribs, # attributes, # deformed_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[16] STRING s_new_name[16] STRING s_entity_type[16] INTEGER i_ntargets STRING sa_targets[2](1) INTEGER i_nattribs STRING sa_attributes[64](17) LOGICAL l_deformed_flag INTEGER i_return_value #---------------------------------------------------------------------

Main Index

Chapter 6: Results Postprocessing Functions 1075 Plot Tool Creation and Modification Functions

# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 0, "Centroidal", @ "Tensor", "SPOOL_LOADS", "Static Subcase", @ "Stress Tensor", "", "At Z1", "", "AsIs", @ "DeriveAverage", "All", "ShapeFunc", "", 0. ) dump i_return_value i_return_value = @ res_data_title( 0, "Centroidal", "Tensor", 1, @ ["SPOOL_LOADS, Static Subcase, Stress Tensor,, At Z1"] ) dump i_return_value #--------------------------------------------------------------------# Creating a plot i_return_value = @ res_display_tensor_create( "", "Elements", 0, @ [""], 17, ["Range:Ten_default_Tensor", @ "RangeOverwrite:ON", @ "TensorDisplay:Component", @ "TensorComps:ON,ON,ON,OFF,OFF,OFF", @ "TensorColors:Spectrum", @ "VectorScale:ScreenConstant=0.1", @ "HeadStyle:Single", "VectorStyle:Solid", @ "BoxStyle:OFF,Wireframe", "BoxColor:Yellow"@ , "BoxScale:ScreenConstant=0.1", @ "TitleDisplay:ON", "MinMaxDisplay:OFF", @ "LabelStyle:Fixed, 12, White, 4", @ "ValueDisplay:OFF", "Filter:None", "ScaleFactor:1."], TRUE ) dump i_return_value i_return_value = @ res_display_tensor_post( "", 0, "Centroidal", TRUE, TRUE ) dump i_return_value #--------------------------------------------------------------------# Press Resume to continue sf_pause() #-------------------------------------------------------------------# Argument initialization s_plot_name = "" s_new_name = "New_tensor_plot" s_entity_type = "Elements" i_ntargets = 0 sa_targets = [""] i_nattribs = 17 sa_attributes(1) = "Range:Ten_Tensor_plot" sa_attributes(2) = "RangeOverwrite:ON" sa_attributes(3) = "TensorDisplay:Component" sa_attributes(4) = "TensorComps:ON,ON,ON,ON,ON,ON" sa_attributes(5) = "TensorColors:spectrum" sa_attributes(6) = "VectorScale:ScreenConstant=0.1" sa_attributes(7) = "HeadStyle:Single" sa_attributes(8) = "VectorStyle:Solid" sa_attributes(9) = "BoxStyle:OFF,Wireframe" sa_attributes(10)= "BoxColor:Yellow" sa_attributes(11)= "BoxScale:ScreenConstant=0.1" sa_attributes(12)= "TitleDisplay:ON" sa_attributes(13)= "MinMaxDisplay:OFF" sa_attributes(14)= "LabelStyle:Fixed, 12, White, 4" sa_attributes(15)= "ValueDisplay:OFF" sa_attributes(16)= "Filter:None" sa_attributes(17)= "ScaleFactor:1." l_deformed_flag = TRUE #-------------------------------------------------------------------# Modifies the tensor plot i_return_value = @

Main Index

1076 PCL Reference Manual Examples Plot Tool Creation and Modification Functions

res_display_tensor_modify @ ( s_plot_name, @ s_new_name, @ s_entity_type, @ i_ntargets, @ sa_targets, @ i_nattribs, @ sa_attributes, @ l_deformed_flag ) dump i_return_value #--------------------------------------------------------------------# Displays the plot i_return_value = @ res_display_tensor_post( "New_tensor_plot", 0,@ "Centroidal", TRUE, TRUE ) dump i_return_value #---------------------------------------------------------------------

res_display_report_create

()

# # Purpose : This file provides an example of a call to the # function res_display_report_create() # # This session file creates a report file # "report.1". X, Y and Z component of # displacement at each node are written in this # file. This file can be opened in vi editor to # see the results. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_report_create() # has the following arguments: # # res_display_report_create # ( report_name, # entity_type, # ntargets, # targets, # nattribs, # attributes ) # #--------------------------------------------------------------------# Variable Declarations STRING s_report_name[2] STRING s_entity_type[16] INTEGER i_ntargets STRING sa_targets[2](1) INTEGER i_nattribs STRING sa_attributes[128](20) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @

Main Index

Chapter 6: Results Postprocessing Functions 1077 Plot Tool Creation and Modification Functions

res_data_load_dbresult( 0, "Nodal", "Vector", @ "SPOOL_LOADS", "Static Subcase", @ "Displacements", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "" , 0. ) dump i_return_value #--------------------------------------------------------------------# Argument initialization s_report_name = "" s_entity_type = "Nodes" i_ntargets = 0 sa_targets = [""] i_nattribs = 20 sa_attributes(1) = "ReportType:Full" sa_attributes(2) = "ReportTitle:$PRODUCT - Analysis Code: $CODE_NAME" sa_attributes(3) = "ReportTitle:Load Case: $LC_NAME, $SC_NAME" sa_attributes(4) = "ReportTitle:Result $PRES" // @ "_NAME, $SRES_NAME - Layer $LYR_NAME" sa_attributes(5) = "ReportTitle:Entity: Node Vector" sa_attributes(6) = "ReportHeader:Page $PAGE" sa_attributes(7) = "ReportFooter:$DATE" sa_attributes(8) = "ReportPage:Height=52,Wid" // @ "th=128,TopMargin=5,LeftMargin=8,BottomMargin=5" sa_attributes(9) = "ReportPagination:OFF" sa_attributes(10)= "ReportPageNumber:1" sa_attributes(11)= "ReportPageAlignment:Left" sa_attributes(12)= "ReportVColumn:1,Entity ID,ID,%I6%" sa_attributes(13)= "ReportVColumn:2,X Component,XX,%F12.6%" sa_attributes(14)= "ReportVColumn:3,Y Component,YY,%F12.6%" sa_attributes(15)= "ReportVColumn:4,Z Component,ZZ,%F12.6%" sa_attributes(16)= "EntitySort:LoadCase" sa_attributes(17)= "ValueSort:1,Ascending,Algebraic" sa_attributes(18)= "ColumnHeaders:ON" sa_attributes(19)= "Filter:None" sa_attributes(20)= "ScaleFactor:1." #--------------------------------------------------------------------# Creating a report i_return_value = @ res_display_report_create @ ( s_report_name, @ s_entity_type, @ i_ntargets, @ sa_targets, @ i_nattribs, @ sa_attributes ) dump i_return_value #--------------------------------------------------------------------# Writing to the file i_return_value = @ res_display_report_write( "", 0, "Vector", @ "Nodal", "Overwrite", "report" ) dump i_return_value #---------------------------------------------------------------------

()

res_display_report_modify # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_report_modify() This session file modifies a report tool definition. It changes the name of the report. Results are written in the file "patran.prt.1" which can be seen in vi editor. In old report only magnitude of displacement was written and in new report all the components of displacement are written.

1078 PCL Reference Manual Examples Plot Tool Creation and Modification Functions

# Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_report_modify() # has the following arguments: # # res_display_report_modify # ( report_name, # new_name, # entity_type, # ntargets, # targets, # nattribs, # attributes ) # #--------------------------------------------------------------------# Variable Declarations STRING s_report_name[16] STRING s_new_name[16] STRING s_entity_type[16] INTEGER i_ntargets STRING sa_targets[16](1) INTEGER i_nattribs STRING sa_attributes[128](20) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Creates a report i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Vector", @ "SPOOL_LOADS", "Static Subcase", @ "Displacements", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "" , 0. ) dump i_return_value i_return_value = @ res_display_report_create( "old_report", @ "Nodes", 1, ["NO:Node 1:50"], 18, @ ["ReportType:Full", "ReportTitle:$PRO" // @ "DUCT - Analysis Code: $CODE_NAME ", @ "ReportTitle:Load Case: $LC_NAME, $SC" // @ "_NAME", "ReportTitle:Result $PRES_NA" // @ "ME, $SRES_NAME - Layer $LYR_NAME ", @ "ReportTitle:Entity: Node Vector", @ "ReportHeader:Page $PAGE", @ "ReportFooter:$DATE", "ReportPage:Hei" // @ "ght=52,Width=128,TopMargin=5,LeftMar" // @ "gin=8,BottomMargin=5", @ "ReportPagination:OFF", @ "ReportPageNumber:1", @ "ReportPageAlignment:Left", @ "ReportVColumn:1,Entity ID,ID,%I6%", @ "ReportVColumn:2,Magnitude,MAG,%F12.6%", @ "EntitySort:LoadCase", @ "ValueSort:1,Ascending,Algebraic", @ "ColumnHeaders:ON", "Filter:None", "ScaleFactor:1."] ) dump i_return_value

Main Index

Chapter 6: Results Postprocessing Functions 1079 Plot Tool Creation and Modification Functions

i_return_value = @ res_display_report_write( "old_report", 0, @ "Vector", "Nodal", "Overwrite", "patran.prt" ) dump i_return_value #--------------------------------------------------------------------# See the file patran.prt.1. sf_pause() #--------------------------------------------------------------------# Argument initialization s_report_name = "old_report" s_new_name = "new_report" s_entity_type = "Nodes" i_ntargets = 1 sa_targets(1) = "NO:Node 1:50" i_nattribs = 20 sa_attributes(1) = "ReportType:Full" sa_attributes(2) = "ReportTitle:$PRODUCT - Analysis Code: $CODE_NAME" sa_attributes(3) = "ReportTitle:Load Case: $LC_NAME, $SC_NAME" sa_attributes(4) = "ReportTitle:Result $PRES" // @ "_NAME, $SRES_NAME - Layer $LYR_NAME" sa_attributes(5) = "ReportTitle:Entity: Node Vector" sa_attributes(6) = "ReportHeader:Page $PAGE" sa_attributes(7) = "ReportFooter:$DATE" sa_attributes(8) = "ReportPage:Height=52,Wid" // @ "th=128,TopMargin=5,LeftMargin=8,BottomMargin=5" sa_attributes(9) = "ReportPagination:OFF" sa_attributes(10)= "ReportPageNumber:1" sa_attributes(11)= "ReportPageAlignment:Left" sa_attributes(12)= "ReportVColumn:1,Entity ID,ID,%I6%" sa_attributes(13)= "ReportVColumn:2,X Component,XX,%F12.6%" sa_attributes(14)= "ReportVColumn:3,Y Component,YY,%F12.6%" sa_attributes(15)= "ReportVColumn:4,Z Component,ZZ,%F12.6%" sa_attributes(16)= "EntitySort:LoadCase" sa_attributes(17)= "ValueSort:1,Ascending,Algebraic" sa_attributes(18)= "ColumnHeaders:ON" sa_attributes(19)= "Filter:None" sa_attributes(20)= "ScaleFactor:1." #--------------------------------------------------------------------# Modifying the report i_return_value = @ res_display_report_modify @ ( s_report_name, @ s_new_name, @ s_entity_type, @ i_ntargets, @ sa_targets, @ i_nattribs, @ sa_attributes ) dump i_return_value #--------------------------------------------------------------------# Writes to the file i_return_value = @ res_display_report_write( "new_report", 0, @ "Vector", "Nodal", "Overwrite", "patran.prt" ) dump i_return_value # See the modified file patran.prt.1. #---------------------------------------------------------------------

()

res_display_graph_create # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_graph_create() This session file creates graph tool. It creates graph between displacement and coordinates of nodes.

1080 PCL Reference Manual Examples Plot Tool Creation and Modification Functions

# # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_graph_create() # has the following arguments: # # res_display_graph_create # ( plot_name, # graph_type, # entity_type, # ntargets, # targets, # nattribs, # attributes ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[32] STRING s_graph_type[32] STRING s_entity_type[16] INTEGER i_ntargets STRING sa_targets[32](1) INTEGER i_nattribs STRING sa_attributes[64](14) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Displacements", "Translational", @ "(NON-LAYERED)", "MAG", "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_title( 0, "Nodal", "Scalar", 1, @ ["Displacements, Translational, MAG"]) dump i_return_value #--------------------------------------------------------------------# Argument initialization s_plot_name = "Displacement_vs_Coordinate" s_graph_type = "DataLocation" s_entity_type = "Nodes" i_ntargets = 1 sa_targets(1) = "NO:Node 1:600" i_nattribs = 14 sa_attributes(1) = "curveFitMethod:Linear" sa_attributes(2) = "curveStyle:Solid" sa_attributes(3) = "symbolDisplay:OFF" sa_attributes(4) = "xAxisLabelDisplay:ON" sa_attributes(5) = "xAxisLabel:Coordinates" sa_attributes(6) = "xAxisScale:Linear" sa_attributes(7) = "xAxisLabelFormat:Fixed, 12, White, 3" sa_attributes(8) = "yAxisLabelDisplay:ON" sa_attributes(9) = "yAxisLabel:Displacement" sa_attributes(10)= "yAxisScale:Linear"

Main Index

Chapter 6: Results Postprocessing Functions 1081 Plot Tool Creation and Modification Functions

sa_attributes(11)= "yAxisLabelFormat:Fixed, 12, White, 3" sa_attributes(12)= "ScaleFactor:1." sa_attributes(13)= "Filter:None" sa_attributes(14)= "LocationCID:Coord 0.1" #-------------------------------------------------------------------# Creating a graph i_return_value = @ res_display_graph_create @ ( s_plot_name, @ s_graph_type, @ s_entity_type, @ i_ntargets, @ sa_targets, @ i_nattribs, @ sa_attributes ) dump i_return_value #--------------------------------------------------------------------# Displays the graph i_return_value = @ res_display_graph_post( "Displacement_vs_" // @ "Coordinate", "Nodal", 0, -1, "Displacement Graph", FALSE ) dump i_return_value #---------------------------------------------------------------------

res_display_graph_modify

()

# # Purpose : This file provides an example of a call to the # function res_display_graph_modify() # # This session file modifies a graph plot # definition. It changes the name of graph and # xy window name. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_graph_modify() # has the following arguments: # # res_display_graph_modify # ( plot_name, # new_name, # graph_type, # entity_type, # ntargets, # targets, # nattribs, # attributes ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[32] STRING s_new_name[32] STRING s_graph_type[16] STRING s_entity_type[16] INTEGER i_ntargets STRING sa_targets[32](1) INTEGER i_nattribs

Main Index

1082 PCL Reference Manual Examples Plot Tool Creation and Modification Functions

STRING sa_attributes[64](14) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Creates a graph i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Scalar", @ "SPOOL_LOADS", "Static Subcase", @ "Displacements", "Translational", @ "(NON-LAYERED)", "MAG", "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Scalar", 1, ["Displacements, Translational, MAG"] ) dump i_return_value

@ @

i_return_value = @ res_display_graph_create( "old_graph", @ "DataLocation", "Nodes", 1, @ ["NO:Node 1:600"], 14, ["curveFitMetho" // @ "d:Linear", "curveStyle:Solid", @ "symbolDisplay:OFF", "xAxisLabelDisplay:ON"@ , "xAxisLabel:Coordinates", @ "xAxisScale:Linear", "xAxisLabelFormat" // @ ":Fixed, 12, White, 2", @ "yAxisLabelDisplay:ON", "yAxisLabel:Di" // @ "splacement", "yAxisScale:Linear", @ "yAxisLabelFormat:Fixed, 12, White, 3", @ "ScaleFactor:1.", "Filter:None", "LocationCID:Coord 0.1"]) dump i_return_value i_return_value = @ res_display_graph_post( "old_graph", "Nodal", @ 0, -1, "Displacement_Graph", FALSE ) dump i_return_value #--------------------------------------------------------------------# Press Resume to continue sf_pause() #--------------------------------------------------------------------# Argument initialization s_plot_name = "old_graph" s_new_name = "new_graph" s_graph_type = "DataLocation" s_entity_type = "Nodes" i_ntargets = 1 sa_targets(1) = "NO:Node 1:300" i_nattribs = 14 sa_attributes(1) = "curveFitMethod:Linear" sa_attributes(2) = "curveStyle:Solid" sa_attributes(3) = "symbolDisplay:OFF" sa_attributes(4) = "xAxisLabelDisplay:ON" sa_attributes(5) = "xAxisLabel:Coordinates" sa_attributes(6) = "xAxisScale:Linear" sa_attributes(7) = "xAxisLabelFormat:Fixed, 12, Yellow, 2" sa_attributes(8) = "yAxisLabelDisplay:ON" sa_attributes(9) = "yAxisLabel:Displacements" sa_attributes(10)= "yAxisScale:Linear" sa_attributes(11)= "yAxisLabelFormat:Fixed, 12, LtGreen, 3" sa_attributes(12)= "ScaleFactor:1." sa_attributes(13)= "Filter:None" sa_attributes(14)= "LocationCID:Coord 0.1" #--------------------------------------------------------------------# Modifies the graph i_return_value = @ res_display_graph_modify @

Main Index

Chapter 6: Results Postprocessing Functions 1083 Plot Tool Creation and Modification Functions

(

s_plot_name, @ s_new_name, @ s_graph_type, @ s_entity_type, @ i_ntargets, @ sa_targets, @ i_nattribs, @ sa_attributes ) dump i_return_value #--------------------------------------------------------------------# Displays the graph i_return_value = @ res_display_graph_post( "new_graph", "Nodal", @ 0, -1, "Displacement_translational", TRUE ) dump i_return_value #---------------------------------------------------------------------

res_display_deformation_create

()

# # Purpose : This file provides an example of a call to the # function res_display_deformation_create() # # This session file creates a deformation plot. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_deformation_create() # has the following arguments: # # res_display_deformation_create # ( plot_name, # entity_type, # ntargets, # targets, # nattribs, # attributes ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[32] STRING s_entity_type[16] INTEGER i_ntargets STRING sa_targets[2](1) INTEGER i_nattribs STRING sa_attributes[64](9) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Defining a register i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Vector", @ "SPOOL_LOADS", "Static Subcase", @ "Displacements", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "", 0. ) dump i_return_value

Main Index

1084 PCL Reference Manual Examples Plot Tool Creation and Modification Functions

i_return_value = @ res_data_title( 0, "Nodal", "Vector", 1, @ ["SPOOL_LOADS, Static Subcase, Displac" // @ "ements, Translational, (NON-LAYERED)"]) dump i_return_value #--------------------------------------------------------------------# Argument initialization s_plot_name = "Deformation_plot" s_entity_type = "Elements" i_ntargets = 0 sa_targets = [""] i_nattribs = 9 sa_attributes(1) = "DeformedStyle:LtBlue,Solid,1,Wireframe" sa_attributes(2) = "DeformedScale:Model=0.1" sa_attributes(3) = "UndeformedStyle:OFF,Blue,Solid,1,Wireframe" sa_attributes(4) = "TitleDisplay:ON" sa_attributes(5) = "MinMaxDisplay:ON" sa_attributes(6) = "ScaleFactor:1." sa_attributes(7) = "LabelStyle:Fixed, 12, White, 4" sa_attributes(8) = "DeformDisplay:Resultant" sa_attributes(9) = "DeformComps:OFF,OFF,OFF" #--------------------------------------------------------------------# Creates a deformed plot i_return_value = @ res_display_deformation_create @ ( s_plot_name, @ s_entity_type, @ i_ntargets, @ sa_targets, @ i_nattribs, @ sa_attributes ) dump i_return_value #--------------------------------------------------------------------# Displays the plot i_return_value = @ res_display_deformation_post( "Deformation_plot", 0 ) dump i_return_value #---------------------------------------------------------------------

()

res_display_deformation_modify # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_deformation_modify() This session file modifies the deformation plot. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_display_deformation_modify() has the following arguments: res_display_deformation_modify ( plot_name, new_name, entity_type,

Chapter 6: Results Postprocessing Functions 1085 Plot Tool Creation and Modification Functions

# ntargets, # targets, # nattribs, # attributes ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[32] STRING s_new_name[32] STRING s_entity_type[16] INTEGER i_ntargets STRING sa_targets[2](1) INTEGER i_nattribs STRING sa_attributes[64](9) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Creates a deformed plot i_return_value = @ res_data_load_dbresult( 0, "Nodal", "Vector", @ "SPOOL_LOADS", "Static Subcase", @ "Displacements", "Translational", @ "(NON-LAYERED)", "", "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_title( 0, "Nodal", "Vector", 1, @ ["SPOOL_LOADS, Static Subcase, Displac" // @ "ements, Translational, (NON-LAYERED)"]) dump i_return_value i_return_value = res_display_deformation_create( "Deformat" // "ion_plot", "Elements", 0, [""], 9, ["DeformedStyle:LtBlue,Solid,1,Wireframe", "DeformedScale:Model=0.1", "Undeformed" // "Style:ON,White,Solid,1,Wireframe", "TitleDisplay:ON", "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:Fixed, 1" // "2, White, 4", "DeformDisplay:Resultant", "DeformComps:OFF,OFF,OFF"] ) dump i_return_value

@ @ @ @ @ @ @ @ @

i_return_value = @ res_display_deformation_post( "Deformation_plot", 0 ) dump i_return_value #--------------------------------------------------------------------# Press Resume to continue sf_pause() #--------------------------------------------------------------------# Argument initialization s_plot_name = "Deformation_plot" s_new_name = "New_Deformation_plot" s_entity_type = "Elements" i_ntargets = 0 sa_targets = [""] i_nattribs = 9 sa_attributes(1) = "DeformedStyle:LtGreen,Solid,1,Wireframe" sa_attributes(2) = "DeformedScale:Model=0.1" sa_attributes(3) = "UndeformedStyle:ON,LtMagenta,Solid,1,Wireframe" sa_attributes(4) = "TitleDisplay:ON" sa_attributes(5) = "MinMaxDisplay:ON" sa_attributes(6) = "ScaleFactor:1." sa_attributes(7) = "LabelStyle:Fixed, 12, White, 4" sa_attributes(8) = "DeformDisplay:Resultant" sa_attributes(9) = "DeformComps:OFF,OFF,OFF"

Main Index

1086 PCL Reference Manual Examples Plot Tool Creation and Modification Functions

#--------------------------------------------------------------------# Modifies the plot i_return_value = @ res_display_deformation_modify @ ( s_plot_name, @ s_new_name, @ s_entity_type, @ i_ntargets, @ sa_targets, @ i_nattribs, @ sa_attributes ) dump i_return_value #--------------------------------------------------------------------# Displays the plot i_return_value = @ res_display_deformation_post( "New_Deformation_plot", 0 ) dump i_return_value #---------------------------------------------------------------------

Main Index

Chapter 6: Results Postprocessing Functions 1087 Plot Tool Manipulation Functions

Plot Tool Manipulation Functions This section contains examples of some of the functions used for posting, unposting, and deleting plot tools. res_display_fringe_post

()

# # Purpose : This file provides an example of a call to the # function res_display_fringe_post() # # In this example field database, containing # the results is opened and a fringe plot # tool definition is created. After a pause # this function is called to post the # fringe plot tool in default viewport. # # Before running this 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 res_display_fringe_post() # has the following arguments: # # res_display_fringe_post # ( plot_name, # register_id, # register_location, # range_flag, # spectrum_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[32] INTEGER i_register_id STRING s_register_location[32] LOGICAL l_range_flag LOGICAL l_spectrum_flag 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 #--------------------------------------------------------------------# Create Fringe Plot tool for Displacement i_return_value = res_data_load_dbresult( 0, "Nodal", "Scalar", @ "Default", "Static Subcase", "Displacements","Translational",@ "(NON-LAYERED)", "MAG", "Default", "DeriveAverage", "All", @ "ShapeFunc" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Scalar", 1, [ "Default, Static Subcase: Displacements, Translational"// "-(NON-LAYERED) (MAG)"] ) dump i_return_value

Main Index

@ @

1088 PCL Reference Manual Examples Plot Tool Manipulation Functions

i_return_value = res_display_fringe_create( "", "FreeFaces", 0, [""], 12, [ "Range:Fri_default_Fringe", "RangeOverwrite:ON", "FringeStyle:Discrete/Smooth" , "Shade:None", "ElemEdge:FreeEdge,Blue,Solid,1", "Shrink:0", "TitleDisplay:ON", "MinMaxDisplay:ON", "ValueDisplay:OFF", "Filter:None", "ScaleFactor:1.", "LabelStyle:Fixed, 8, White, 4"], TRUE ) dump i_return_value

@ @ @ @ @ @

#--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Plot Fringe Plot tool for Displacement s_plot_name i_register_id s_register_location l_range_flag l_spectrum_flag

= = = = =

"" 0 "Nodal" TRUE TRUE

i_return_value = res_display_fringe_post ( s_plot_name, i_register_id, s_register_location, l_range_flag, l_spectrum_flag ) dump i_return_value

@ @ @ @ @ @

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

res_display_vector_post

()

# # Purpose : This file provides an example of a call to the # function res_display_vector_post() # # In this example field database, containing # the results is opened and a Vector Plot # tool definition is created. After a pause # this function is called to post the # Vector Plot in default viewport. # # Before running this 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 res_display_vector_post() # has the following arguments: # # res_display_vector_post # ( plot_name, # register_id, # register_location, # range_flag, # spectrum_flag ) # #--------------------------------------------------------------------# Variable Declarations

Main Index

Chapter 6: Results Postprocessing Functions 1089 Plot Tool Manipulation Functions

STRING s_plot_name[32] INTEGER i_register_id STRING s_register_location[32] LOGICAL l_range_flag LOGICAL l_spectrum_flag 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 #--------------------------------------------------------------------# Create Vector Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements","Translational",@ "(NON-LAYERED)", "", "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase, Displacements,"// " Translational, (NON-LAYERED)"] ) dump i_return_value

@ @

i_return_value = res_display_vector_create( "", "Nodes", 0, [""], 16, [ "Range:Vec_default_Vector", "RangeOverwrite:ON", "VectorDisplay:Component", "VectorComps:OFF,OFF,ON", "VectorColors:Spectrum", "VectorScale:ScreenConstant=0.1", "VectorAttachment:Head", "HeadStyle:Single", "VectorStyle:Solid", "TailDisplay:ON", "TitleDisplay:ON", "MinMaxDisplay:ON", "LabelStyle:Fixed, 8, White, 4", "ValueDisplay:ON", "Filter:None", "ScaleFactor:1."], TRUE ) dump i_return_value

@ @ @ @ @ @ @

#--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #-------------------------------------------------------------------# Post the created Vector Plot tool s_plot_name i_register_id s_register_location l_range_flag l_spectrum_flag

= = = = =

"" 0 "Nodal" TRUE TRUE

i_return_value = res_display_vector_post ( s_plot_name, i_register_id, s_register_location, l_range_flag, l_spectrum_flag ) dump i_return_value

@ @ @ @ @ @

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

()

res_display_tensor_post # # # #

Main Index

Purpose

:

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

1090 PCL Reference Manual Examples Plot Tool Manipulation Functions

# In this example field database, containing # the results is opened and a tensor plot # tool definition is created. After a pause # this function is called to post the # tensor plot in default viewport. # # Before running this 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 res_display_tensor_post() # has the following arguments: # # res_display_tensor_post # ( plot_name, # register_id, # register_location, # range_flag, # spectrum_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[32] INTEGER i_register_id STRING s_register_location[32] LOGICAL l_range_flag LOGICAL l_spectrum_flag 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 #--------------------------------------------------------------------# Create Tensor plot tool i_return_value = res_data_load_dbresult( 0, "Centroidal", @ "Tensor", "Default", "Static Subcase" , "Stress Tensor", "", @ "At Z1", "", "AsIs", "DeriveAverage", "All", "ShapeFunc", "",@ 0. ) dump i_return_value i_return_value = res_data_title( 0, "Centroidal", "Tensor", 1, [ "Default, Static Subcase, Stress Tensor,, At Z1"] ) dump i_return_value

@

i_return_value = res_display_tensor_create( "", "Elements", 0, [""], 17, [ "Range:Ten_default_Tensor", "RangeOverwrite:ON", "TensorDisplay:Component", "TensorComps:ON,ON,ON,ON,ON,ON", "TensorColors:Blue,Green,Yellow,Red,Magenta,White", "VectorScale:ScreenConstant=0.1", "HeadStyle:Single", "VectorStyle:Solid", "BoxStyle:ON,Wireframe", "BoxColor:Yellow", "BoxScale:ScreenConstant=0.1", "TitleDisplay:ON", "MinMaxDisplay:ON", "LabelStyle:Fixed, 8, White, 4", "ValueDisplay:ON", "Filter:None", "ScaleFactor:1."], TRUE ) dump i_return_value

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause()

Main Index

Chapter 6: Results Postprocessing Functions 1091 Plot Tool Manipulation Functions

#-------------------------------------------------------------------# Post the created tensor plot tool s_plot_name i_register_id s_register_location l_range_flag l_spectrum_flag

= = = = =

"" 0 "Centroidal" TRUE FALSE

i_return_value = res_display_tensor_post ( s_plot_name, i_register_id, s_register_location, l_range_flag, l_spectrum_flag ) dump i_return_value

@ @ @ @ @ @

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

res_display_report_write

()

# # Purpose : This file provides an example of a call to the # function res_display_report_write() # # In this example field database, containing # the results is opened and a file named # RESULT_REPORT.prt is created. Then report # tool definition is created and this function # is called to write Z-displacements of node # into file RESULT_REPORT.prt # # Before running this 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 res_display_report_write() # has the following arguments: # # res_display_report_write # ( report_name, # register_id, # register_type, # register_location, # output_method, # file_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_report_name[32] INTEGER i_register_id STRING s_register_type[32] STRING s_register_location[32] STRING s_output_method[32] STRING s_file_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open the database ’field.db’ uil_file_open.go ("field.db") #

Main Index

Open a new file for writing

1092 PCL Reference Manual Examples Plot Tool Manipulation Functions

uil_file_report.open_file( "RESULT_REPORT.prt", 80 ) #--------------------------------------------------------------------# Create report tool definition i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", "Default", "Static Subcase", "Displacements","Translational", "(NON-LAYERED)", "", "AsIs", "", "", "", "", 0. ) dump i_return_value

@ @

i_return_value = res_display_report_create( "","Nodes", 0, [""], @ 18, ["ReportType:Full", "ReportTitle:$PRODUCT - Analysis"// @ " Code: $CODE_NAME","ReportTitle:Load Case: $LC_NAME, $SC_NAME", @ "ReportTitle:Result $PRES_NAME, $SRES_NAME - Layer $LYR_NAME ", @ "ReportTitle:Entity: Node Vector", "ReportHeader:Page $PAGE", @ "ReportFooter:$DATE", "ReportPage:Height=52,Width=70,"// @ "TopMargin=5,LeftMargin=8,BottomMargin=5", @ "ReportPagination:OFF", "ReportPageNumber:1", @ "ReportPageAlignment:Center","ReportVColumn:1,Entity ID,ID,%I6%",@ "ReportVColumn:2,Z Component,ZZ,%F12.6%", "EntitySort:LoadCase", @ "ValueSort:1,Ascending,Algebraic", "ColumnHeaders:ON", @ "Filter:None", "ScaleFactor:1."] ) dump i_return_value #--------------------------------------------------------------------# Write report tool definition to "RESULT_REPORT.prt" s_report_name i_register_id s_register_type s_register_location s_output_method s_file_name

= = = = = =

"" 0 "Vector" "Nodal" "Overwrite" "RESULT_REPORT.prt"

i_return_value = res_display_report_write ( s_report_name, i_register_id, s_register_type, s_register_location, s_output_method, s_file_name ) dump i_return_value

@ @ @ @ @ @ @

# A physical file "RESULT_REPORT.prt" is created in current # directory #---------------------------------------------------------------------

()

res_display_graph_post # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_graph_post() In this example field database, containing the results is opened and a graph plot tool definition is created. After a pause this function is called to post the graph plot. Before running this 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

Chapter 6: Results Postprocessing Functions 1093 Plot Tool Manipulation Functions

# menus on the menu bar. # # The function res_display_graph_post() # has the following arguments: # # res_display_graph_post # ( plot_name, # register_location, # y_register_id, # x_register_id, # plot_title, # append_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[32] STRING s_register_location[32] INTEGER i_y_register_id INTEGER i_x_register_id STRING s_plot_title[32] LOGICAL l_append_flag 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 #--------------------------------------------------------------------# Create Graph Plot tool for Displacement i_return_value = res_data_load_dbresult( 0, "Centroidal", @ "Scalar", "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "MAG", "AsIs", "", "", "", @ "", 0. ) dump i_return_value i_return_value = res_data_title( 0, "Centroidal", "Scalar", 1, ["Displacements, Translational, MAG"] ) dump i_return_value

@

i_return_value = res_display_graph_create( "", "DataLocation", "Elements", 1, [ "EL:Elm 11:13 16:18 21:23"], 14, ["curveFitMethod:Linear", "curveStyle:Solid", "symbolDisplay:OFF", "xAxisLabelDisplay:ON", "xAxisLabel:Coord 0.1", "xAxisScale:Linear", "xAxisLabelFormat:Fixed, 12, White, 4", "yAxisLabelDisplay:ON", "yAxisLabel:Element Tensor,"// " Demo Result1", "yAxisScale:Linear", "yAxisLabelFormat:"// "Fixed, 12, White, 4", "ScaleFactor:1.", "Filter:None", "LocationCID:Coord 0.1", ""] ) dump i_return_value

@ @ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Post Graph Plot tool for Displacement s_plot_name s_register_location i_y_register_id i_x_register_id s_plot_title l_append_flag

Main Index

= = = = = =

"" "Centroidal" 0 -1 "EXAMPLE GRAPH" FALSE

1094 PCL Reference Manual Examples Plot Tool Manipulation Functions

i_return_value = res_display_graph_post ( s_plot_name, s_register_location, i_y_register_id, i_x_register_id, s_plot_title, l_append_flag ) dump i_return_value

@ @ @ @ @ @ @

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

res_display_tool_unpost

()

# # Purpose : This file provides an example of a call to the # function res_display_tool_unpost() # # In this example field database, containing # the results is opened and a Fringe Plot # tool definition is created & posted in # default viewport. After a pause this function # is called to unpost the Fringe Plot tool. # # Before running this 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 res_display_tool_unpost() # has the following arguments: # # res_display_tool_unpost # ( plot_type, # plot_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_type[32] STRING s_plot_name[32] 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 #--------------------------------------------------------------------# Create and Post Fringe Plot tool for Displacement i_return_value = res_data_load_dbresult( 0, "Nodal", "Scalar", @ "Default", "Static Subcase", "Displacements","Translational",@ "(NON-LAYERED)", "MAG", "Default", "DeriveAverage", "All", @ "ShapeFunc" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Scalar", 1, [ "Default, Static Subcase: Displacements, Translational"// "-(NON-LAYERED) (MAG)"] ) dump i_return_value

Main Index

@ @

Chapter 6: Results Postprocessing Functions 1095 Plot Tool Manipulation Functions

i_return_value = res_display_fringe_create( "", "FreeFaces", 0, [""], 12, [ "Range:Fri_default_Fringe", "RangeOverwrite:ON", "FringeStyle:Discrete/Smooth" , "Shade:None", "ElemEdge:FreeEdge,Blue,Solid,1", "Shrink:0", "TitleDisplay:ON", "MinMaxDisplay:ON", "ValueDisplay:OFF", "Filter:None", "ScaleFactor:1.", "LabelStyle:Fixed, 8, White, 4"], TRUE ) dump i_return_value

@ @ @ @ @ @

i_return_value = res_display_fringe_post ( "", 0, "Nodal", TRUE,@ TRUE ) dump i_return_value #--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Unpost the Fringe Plot tool s_plot_type = "Fringe" s_plot_name = "default_Fringe" i_return_value = res_display_tool_unpost ( s_plot_type, s_plot_name ) dump i_return_value

@ @ @

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

res_display_tool_exist

()

# # Purpose : This file provides an example of 2 calls to the # function res_display_tool_exist() # # In this example field database, containing # the results is opened and this function is # called to check the existence of Fringe Plot # tool. After a pasue the Fringe Plot tool # definition is created & posted in default # viewport. Then this function is again called # to check the existence of Fringe Plot tool. # # Before running this 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 res_display_tool_exist() # has the following arguments: # # res_display_tool_exist # ( plot_type, # plot_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_type[32] STRING s_plot_name[32] INTEGER i_return_value LOGICAL l_return_value #---------------------------------------------------------------------

Main Index

1096 PCL Reference Manual Examples Plot Tool Manipulation Functions

# 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 #--------------------------------------------------------------------# Check the existence of mentioned tool s_plot_type = "Fringe" s_plot_name = "default_Fringe" l_return_value = res_display_tool_exist ( s_plot_type, s_plot_name ) dump l_return_value

@ @ @

#--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Create and Post Fringe Plot tool for Displacement i_return_value = res_data_load_dbresult( 0, "Nodal", "Scalar", @ "Default", "Static Subcase", "Displacements","Translational",@ "(NON-LAYERED)", "MAG", "Default", "DeriveAverage", "All", @ "ShapeFunc" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Scalar", 1, [ "Default, Static Subcase: Displacements, Translational"// "-(NON-LAYERED) (MAG)"] ) dump i_return_value

@ @

i_return_value = res_display_fringe_create( "", "FreeFaces", 0, [""], 12, [ "Range:Fri_default_Fringe", "RangeOverwrite:ON", "FringeStyle:Discrete/Smooth" , "Shade:None", "ElemEdge:FreeEdge,Blue,Solid,1", "Shrink:0", "TitleDisplay:ON", "MinMaxDisplay:ON", "ValueDisplay:OFF", "Filter:None", "ScaleFactor:1.", "LabelStyle:Fixed, 8, White, 4"], TRUE ) dump i_return_value

@ @ @ @ @ @

i_return_value = res_display_fringe_post ( "", 0, "Nodal", TRUE,@ TRUE ) dump i_return_value #--------------------------------------------------------------------# Check the existence of mentioned tool l_return_value = res_display_tool_exist ( s_plot_type, s_plot_name ) dump l_return_value

@ @ @

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

()

res_display_tool_delete # # # #

Main Index

Purpose

:

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

Chapter 6: Results Postprocessing Functions 1097 Plot Tool Manipulation Functions

# In this example field database, containing # the results is opened and a Fringe Plot # tool definition is created. Then this # function is called to delete the Fringe Plot # tool. The deletion of the result-tool is # verified by getting the existence of the tool # before and after deletion. # # Before running this 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 res_display_tool_delete() # has the following arguments: # # res_display_tool_delete # ( plot_type, # plot_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_type[32] STRING s_plot_name[32] INTEGER i_return_value LOGICAL l_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 #--------------------------------------------------------------------# Create Fringe Plot tool for Displacement i_return_value = res_data_load_dbresult( 0, "Nodal", "Scalar", @ "Default", "Static Subcase", "Displacements","Translational",@ "(NON-LAYERED)", "MAG", "Default", "DeriveAverage", "All", @ "ShapeFunc" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Scalar", 1, [ "Default, Static Subcase: Displacements, Translational"// "-(NON-LAYERED) (MAG)"] ) dump i_return_value

@ @

i_return_value = res_display_fringe_create( "", "FreeFaces", 0, [""], 12, [ "Range:Fri_default_Fringe", "RangeOverwrite:ON", "FringeStyle:Discrete/Smooth" , "Shade:None", "ElemEdge:FreeEdge,Blue,Solid,1", "Shrink:0", "TitleDisplay:ON", "MinMaxDisplay:ON", "ValueDisplay:OFF", "Filter:None", "ScaleFactor:1.", "LabelStyle:Fixed, 8, White, 4"], TRUE ) dump i_return_value

@ @ @ @ @ @

#--------------------------------------------------------------------# Check the existence of Fringe Plot tool l_return_value = res_display_tool_exist( "Fringe", @ "default_Fringe" ) dump l_return_value #--------------------------------------------------------------------# Delete the Fringe Plot tool

Main Index

1098 PCL Reference Manual Examples Plot Tool Manipulation Functions

s_plot_type = "Fringe" s_plot_name = "default_Fringe" i_return_value = res_display_tool_delete ( s_plot_type, s_plot_name ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Check the existence of Fringe Plot tool l_return_value = res_display_tool_exist( "Fringe", @ "default_Fringe" ) dump l_return_value #---------------------------------------------------------------------

Main Index

Chapter 6: Results Postprocessing Functions 1099 Animation Functions

Animation Functions This section contains examples of some of the functions that are used for animation. res_display_anim_setup_2d

()

# # Purpose : This file provides an example of a call to the # function res_display_anim_setup_2d() # # In this example field database, containing # the results is opened and a Deformation Plot # tool definition is created & posted in # default viewport. Linear Ramp variation is # set for subsequent animation. Then this # function is called to set the number of # frames to be 30 with linear interpolation. # The animation is started in the end. # # Before running this 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 res_display_anim_setup_2d() # has the following arguments: # # res_display_anim_setup_2d # ( number_frames, # interp_method, # file_name ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_number_frames STRING s_interp_method[32] STRING s_file_name[32] 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 #--------------------------------------------------------------------# Create & Post Deformation Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "", "Global", "", "", "" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase: Displacements, Translational-0"// " of 0 layers () "] ) dump i_return_value

@ @

i_return_value = res_display_deformation_create( "", "Elements",@ 0, [""], 9, [ "DeformedStyle:White,Solid,1,Wireframe", @

Main Index

1100 PCL Reference Manual Examples Animation Functions

"DeformedScale:Model=0.1", "UndeformedStyle:ON,"// "Blue,Solid,1,Wireframe", "TitleDisplay:ON", "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:"// "Exponential, 12, White, 3", "DeformDisplay:Resultant", "DeformComps:OFF,OFF,OFF"] ) dump i_return_value

@ @ @ @

i_return_value = res_display_deformation_post( "", 0 ) dump i_return_value #--------------------------------------------------------------------# Use Linear Ramp variation for subsequent animation i_return_value = res_display_tool_animate_scale ( "Ramp", @ "Deformation", "", 0.0 ) dump i_return_value #--------------------------------------------------------------------# Specify number of frames and interpolation for 2D image animation i_number_frames s_interp_method s_file_name

= 30 = "Linear" = ""

i_return_value = res_display_anim_setup_2d ( i_number_frames, s_interp_method, s_file_name ) dump i_return_value

@ @ @ @

# Start running animation with delay of 10 milli-seconds per frame i_return_value = res_display_anim_run( 10 ) dump i_return_value #---------------------------------------------------------------------

()

res_display_anim_setup_3d # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_anim_setup_3d() In this example field database, containing the results is opened and a Deformation Plot tool definition is created & posted in default viewport. Linear Ramp variation is set for subsequent animation. Then this function is called to set the number of frames to be 30 with "Closest" value for frames. The animation is started in the end. Before running this 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 res_display_anim_setup_3d() has the following arguments: res_display_anim_setup_3d ( number_frames, interp_method )

Chapter 6: Results Postprocessing Functions 1101 Animation Functions

#--------------------------------------------------------------------# Variable Declarations INTEGER i_number_frames STRING s_interp_method[32] 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 #--------------------------------------------------------------------# Create & Post Deformation Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "", "Global", "", "", "" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase: Displacements, Translational-0"// " of 0 layers () "] ) dump i_return_value

@ @

i_return_value = res_display_deformation_create( "", "Elements",@ 0, [""], 9, [ "DeformedStyle:White,Solid,1,Wireframe", @ "DeformedScale:Model=0.1", "UndeformedStyle:ON,"// @ "Blue,Solid,1,Wireframe", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:"// @ "Exponential, 12, White, 3", "DeformDisplay:Resultant", @ "DeformComps:OFF,OFF,OFF"] ) dump i_return_value i_return_value = res_display_deformation_post( "", 0 ) dump i_return_value #--------------------------------------------------------------------# Use Linear Ramp variation for subsequent animation i_return_value = res_display_tool_animate_scale ( "Ramp", @ "Deformation", "", 0.0 ) dump i_return_value #--------------------------------------------------------------------# Specify number of frames and interpolation for 3D image animation i_number_frames = 30 s_interp_method = "Closest" i_return_value = res_display_anim_setup_3d ( i_number_frames, s_interp_method ) dump i_return_value

@ @ @

# Start running animation with delay of 10 milli-seconds per frame i_return_value = res_display_anim_run( 10 ) dump i_return_value #---------------------------------------------------------------------

res_display_anim_image_create # # #

Main Index

Purpose

:

()

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

1102 PCL Reference Manual Examples Animation Functions

# # In this example field database, containing # the results is opened and a Deformation Plot # tool definition is created & posted in # default viewport. Parameters like method of # variation, interpolation and number of frames # are set and animation is started. Then # animation is stopped and this function is # called to create the image file of the # current frame. # # Before running this 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 res_display_anim_image_create() # has the following arguments: # # res_display_anim_image_create # ( file_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_file_name[32] 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 #--------------------------------------------------------------------# Create & Post Deformation Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "", "Global", "", "", "" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase: Displacements, Translational-0"// " of 0 layers () "] ) dump i_return_value

@ @

i_return_value = res_display_deformation_create( "", "Elements",@ 0, [""], 9, [ "DeformedStyle:White,Solid,1,Wireframe", @ "DeformedScale:Model=0.1", "UndeformedStyle:ON,"// @ "Blue,Solid,1,Wireframe", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:"// @ "Exponential, 12, White, 3", "DeformDisplay:Resultant", @ "DeformComps:OFF,OFF,OFF"] ) dump i_return_value i_return_value = res_display_deformation_post( "", 0 ) dump i_return_value #--------------------------------------------------------------------# Set animation parameters and start animation i_return_value = res_display_tool_animate_scale( "Ramped", @ "Deformation", "", 0. ) dump i_return_value

Main Index

Chapter 6: Results Postprocessing Functions 1103 Animation Functions

i_return_value = res_display_anim_setup_2d( 8, "Linear", "") dump i_return_value i_return_value = res_display_anim_run( 100 ) dump i_return_value #--------------------------------------------------------------------# Stop the running animation and display the next frame in queue. i_return_value = res_display_anim_step() dump i_return_value #--------------------------------------------------------------------# Create an image file of the current viewport s_file_name = "IMAGE_FILE.img" i_return_value = res_display_anim_image_create ( s_file_name ) dump i_return_value

@ @

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

res_display_anim_setup_image

()

# # Purpose : This file provides an example of a call to the # function res_display_anim_setup_image() # # In this example field database, containing # the results is opened and a Deformation Plot # tool definition is created & posted in # default viewport. Parameters like method of # variation, interpolation and number of frames # are set and animation is started. Then # animation is stopped and 10 image files are # created using function, # res_display_anim_image_create(). Then this # function is called to setup the animation # with the created files. # # Before running this 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 res_display_anim_setup_image() # has the following arguments: # # res_display_anim_setup_image # ( number_frames, # file_name ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_number_frames STRING sa_file_name[32](10) INTEGER i_return_value INTEGER i_count #--------------------------------------------------------------------# Open the database ’field.db’ uil_file_open.go ("field.db")

Main Index

1104 PCL Reference Manual Examples Animation Functions

# Set ISO-1 viewing i_return_value = ga_view_aa_set( 23., -34., 0. ) dump i_return_value #--------------------------------------------------------------------# Create & Post Deformation Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "", "Global", "", "", "" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase: Displacements, Translational-0"// " of 0 layers () "] ) dump i_return_value

@ @

i_return_value = res_display_deformation_create( "", "Elements",@ 0, [""], 9, [ "DeformedStyle:White,Solid,1,Wireframe", @ "DeformedScale:Model=0.1", "UndeformedStyle:ON,"// @ "Blue,Solid,1,Wireframe", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:"// @ "Exponential, 12, White, 3", "DeformDisplay:Resultant", @ "DeformComps:OFF,OFF,OFF"] ) dump i_return_value i_return_value = res_display_deformation_post( "", 0 ) dump i_return_value #--------------------------------------------------------------------# Set animation parameters and start animation i_return_value = res_display_tool_animate_scale( "Ramped", @ "Deformation", "", 0. ) dump i_return_value i_return_value = res_display_anim_setup_2d( 30, "Linear", "") dump i_return_value i_return_value = res_display_anim_run( 100 ) dump i_return_value # Stop animation i_return_value = res_display_anim_step() #--------------------------------------------------------------------# Create 10 image files FOR ( i_count = 1 TO 10 ) dump i_count i_return_value = res_display_anim_frame( i_count ) dump i_return_value sa_file_name(i_count) = "IMAGE.img."//str_from_integer (i_count) dump sa_file_name(i_count) i_return_value = res_display_anim_image_create( sa_file_name(i_count)) dump i_return_value

@

END FOR #--------------------------------------------------------------------# Set the details of animation frame i_number_frames = 10

Main Index

Chapter 6: Results Postprocessing Functions 1105 Animation Functions

i_return_value = res_display_anim_setup_image ( i_number_frames, sa_file_name ) dump i_return_value

@ @ @

# Start animation with modfield frame-set i_return_value = res_display_anim_run(100) #---------------------------------------------------------------------

res_display_anim_bounds

()

# # Purpose : This file provides an example of a call to the # function res_display_anim_bounds() # # In this example field database, containing # the results is opened and a Deformation Plot # tool definition is created & posted in # default viewport. Parameters like method of # variation, interpolation and number of frames # are set and animation is started. After a # pause this function is called to set the # bounds of the animation frames. # # Before running this 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 res_display_anim_bounds() # has the following arguments: # # res_display_anim_bounds # ( current_frame, # start_frame, # end_frame ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_current_frame INTEGER i_start_frame INTEGER i_end_frame 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 #--------------------------------------------------------------------# Create & Post Deformation Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "", "Global", "", "", "" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase: Displacements, Translational-0"// " of 0 layers () "] ) dump i_return_value

Main Index

@ @

1106 PCL Reference Manual Examples Animation Functions

i_return_value = res_display_deformation_create( "", "Elements",@ 0, [""], 9, [ "DeformedStyle:White,Solid,1,Wireframe", @ "DeformedScale:Model=0.1", "UndeformedStyle:ON,"// @ "Blue,Solid,1,Wireframe", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:"// @ "Exponential, 12, White, 3", "DeformDisplay:Resultant", @ "DeformComps:OFF,OFF,OFF"] ) dump i_return_value i_return_value = res_display_deformation_post( "", 0 ) dump i_return_value #--------------------------------------------------------------------# Set animation parameters and start animation i_return_value = res_display_tool_animate_scale( "Ramped", @ "Deformation", "", 0. ) dump i_return_value i_return_value = res_display_anim_setup_2d( 30, "Linear", "" ) dump i_return_value i_return_value = res_display_anim_run( 10 ) dump i_return_value #--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Set the bounds of frames used by a running animation i_current_frame = 20 i_start_frame = 15 i_end_frame = 30 i_return_value = res_display_anim_bounds ( i_current_frame, i_start_frame, i_end_frame ) dump i_return_value

@ @ @ @

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

()

res_display_anim_method # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_anim_method() In this example field database, containing the results is opened and a Deformation Plot tool definition is created & posted in default viewport. Parameters like method of variation, interpolation and number of frames are set and animation is started. After a pause this function is called to modify the method of paging from "Cycle" to "Bounce". Before running this 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.

Chapter 6: Results Postprocessing Functions 1107 Animation Functions

# The function res_display_anim_method() # has the following arguments: # # res_display_anim_method # ( method ) # #--------------------------------------------------------------------# Variable Declarations STRING s_method[16] 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 #--------------------------------------------------------------------# Create & Post Deformation Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "", "Global", "", "", "" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase: Displacements, Translational-0"// " of 0 layers () "] ) dump i_return_value

@ @

i_return_value = res_display_deformation_create( "", "Elements",@ 0, [""], 9, [ "DeformedStyle:White,Solid,1,Wireframe", @ "DeformedScale:Model=0.1", "UndeformedStyle:ON,"// @ "Blue,Solid,1,Wireframe", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:"// @ "Exponential, 12, White, 3", "DeformDisplay:Resultant", @ "DeformComps:OFF,OFF,OFF"] ) dump i_return_value i_return_value = res_display_deformation_post( "", 0 ) dump i_return_value #--------------------------------------------------------------------# Set animation parameters and start animation i_return_value = res_display_tool_animate_scale( "Ramped", @ "Deformation", "", 0. ) dump i_return_value i_return_value = res_display_anim_setup_2d( 30, "Linear", "" ) dump i_return_value i_return_value = res_display_anim_run( 10 ) dump i_return_value #--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Modify the method of paging from "Cycle" to "Bounce" s_method = "Bounce" i_return_value = res_display_anim_method ( s_method ) dump i_return_value

Main Index

@ @

1108 PCL Reference Manual Examples Animation Functions

# Note the change in method of animation #---------------------------------------------------------------------

res_display_anim_run

()

# # Purpose : This file provides an example of a call to the # function res_display_anim_run() # # In this example field database, containing # the results is opened and a Deformation Plot # tool definition is created & posted in # default viewport. Parameters like method of # variation, interpolation and number of frames # are set and animation is started using this # function. After a pause this function is # again called to animate with a increased # delay between frame display. # # Before running this 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 res_display_anim_run() # has the following arguments: # # res_display_anim_run # ( delay ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_delay 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 #--------------------------------------------------------------------# Create & Post Deformation Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "", "Global", "", "", "" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase: Displacements, Translational-0"// " of 0 layers () "] ) dump i_return_value

@ @

i_return_value = res_display_deformation_create( "", "Elements",@ 0, [""], 9, [ "DeformedStyle:White,Solid,1,Wireframe", @ "DeformedScale:Model=0.1", "UndeformedStyle:ON,"// @ "Blue,Solid,1,Wireframe", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:"// @ "Exponential, 12, White, 3", "DeformDisplay:Resultant", @ "DeformComps:OFF,OFF,OFF"] ) dump i_return_value

Main Index

Chapter 6: Results Postprocessing Functions 1109 Animation Functions

i_return_value = res_display_deformation_post( "", 0 ) dump i_return_value #--------------------------------------------------------------------# Use Linear Ramp variation for subsequent animation i_return_value = res_display_tool_animate_scale ( "Ramp", @ "Deformation", "", 0.0 ) dump i_return_value # Specify number of frames and interpolation for 2D image animation i_return_value = res_display_anim_setup_2d ( 30, "Linear", "" ) dump i_return_value #--------------------------------------------------------------------# Start running animation with delay of 10 milli-seconds per frame i_delay = 10 i_return_value = res_display_anim_run ( i_delay ) dump i_return_value

@ @

#--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Start running animation with delay of 10 milli-seconds per frame i_delay = 100 i_return_value = res_display_anim_run ( i_delay ) dump i_return_value

@ @

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

res_display_anim_step

()

# # Purpose : This file provides an example of 2 calls to the # function res_display_anim_step() # # In this example field database, containing # the results is opened and a Deformation Plot # tool definition is created & posted in # default viewport. Parameters like method of # variation, interpolation and number of frames # are set and animation is started. Then this # function is called twice with a pause # between each call to load successive frames. # # Before running this 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 res_display_anim_step() has no arguments. # #--------------------------------------------------------------------# Variable Declarations INTEGER i_return_value

Main Index

1110 PCL Reference Manual Examples Animation Functions

#--------------------------------------------------------------------# 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 #--------------------------------------------------------------------# Create & Post Deformation Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "", "Global", "", "", "" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase: Displacements, Translational-0"// " of 0 layers () "] ) dump i_return_value

@ @

i_return_value = res_display_deformation_create( "", "Elements",@ 0, [""], 9, [ "DeformedStyle:White,Solid,1,Wireframe", @ "DeformedScale:Model=0.1", "UndeformedStyle:ON,"// @ "Blue,Solid,1,Wireframe", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:"// @ "Exponential, 12, White, 3", "DeformDisplay:Resultant", @ "DeformComps:OFF,OFF,OFF"] ) dump i_return_value i_return_value = res_display_deformation_post( "", 0 ) dump i_return_value #--------------------------------------------------------------------# Set animation parameters and start animation i_return_value = res_display_tool_animate_scale( "Ramped", @ "Deformation", "", 0. ) dump i_return_value i_return_value = res_display_anim_setup_2d( 8, "Linear", "" ) dump i_return_value i_return_value = res_display_anim_run( 10 ) dump i_return_value #--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Stop the running animation and display the next frame in queue. i_return_value = res_display_anim_step() dump i_return_value #--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() # Note the change of the deformation plot on the default viewport. #--------------------------------------------------------------------# Display the next frame in queue. i_return_value = res_display_anim_step() dump i_return_value #---------------------------------------------------------------------

Main Index

Chapter 6: Results Postprocessing Functions 1111 Animation Functions

res_display_anim_frame

()

# # Purpose : This file provides an example of 2 calls to the # function res_display_anim_frame() # # In this example field database, containing # the results is opened and a Deformation Plot # tool definition is created & posted in # default viewport. Parameters like method of # variation, interpolation and number of frames # are set and animation is started. Then this # function is called twice with a pause # between each call to load 10th and 25th frame. # # Before running this 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 res_display_anim_frame() # has the following arguments: # # res_display_anim_frame # ( frame_number ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_frame_number 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 #--------------------------------------------------------------------# Create & Post Deformation Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "", "Global", "", "", "" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase: Displacements, Translational-0"// " of 0 layers () "] ) dump i_return_value

@ @

i_return_value = res_display_deformation_create( "", "Elements",@ 0, [""], 9, [ "DeformedStyle:White,Solid,1,Wireframe", @ "DeformedScale:Model=0.1", "UndeformedStyle:ON,"// @ "Blue,Solid,1,Wireframe", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:"// @ "Exponential, 12, White, 3", "DeformDisplay:Resultant", @ "DeformComps:OFF,OFF,OFF"] ) dump i_return_value i_return_value = res_display_deformation_post( "", 0 ) dump i_return_value

Main Index

1112 PCL Reference Manual Examples Animation Functions

#--------------------------------------------------------------------# Set animation parameters and start animation i_return_value = res_display_tool_animate_scale( "Ramped", @ "Deformation", "", 0. ) dump i_return_value i_return_value = res_display_anim_setup_2d( 30, "Linear", "lourdu" ) dump i_return_value i_return_value = res_display_anim_run( 10 ) dump i_return_value #--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Stop running animation and display the specified running frame. i_frame_number = 10 i_return_value = @ res_display_anim_frame @ ( i_frame_number ) dump i_return_value #--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() # Stop animation i_return_value = res_display_anim_step() dump i_return_value #--------------------------------------------------------------------# Display the specified running frame. i_frame_number = 25 i_return_value = res_display_anim_frame ( i_frame_number ) dump i_return_value

@ @

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

()

res_display_anim_clear # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_anim_clear() In this example field database, containing the results is opened and a Deformation Plot tool definition is created & posted in default viewport. Parameters like method of variation, interpolation and number of frames are set and animation is started. After a pause this function is called to stop the running animation and clear any stored animation frames from memory. Before running this 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

Chapter 6: Results Postprocessing Functions 1113 Animation Functions

# menus on the menu bar. # # The function res_display_anim_clear() has no arguments. # #--------------------------------------------------------------------# Variable Declarations 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 #--------------------------------------------------------------------# Create & Post Deformation Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "", "Global", "", "", "" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase: Displacements, Translational-0"// " of 0 layers () "] ) dump i_return_value

@ @

i_return_value = res_display_deformation_create( "", "Elements",@ 0, [""], 9, [ "DeformedStyle:White,Solid,1,Wireframe", @ "DeformedScale:Model=0.1", "UndeformedStyle:ON,"// @ "Blue,Solid,1,Wireframe", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:"// @ "Exponential, 12, White, 3", "DeformDisplay:Resultant", @ "DeformComps:OFF,OFF,OFF"] ) dump i_return_value i_return_value = res_display_deformation_post( "", 0 ) dump i_return_value #--------------------------------------------------------------------# Set animation parameters and start animation i_return_value = res_display_tool_animate_scale( "Ramped", @ "Deformation", "", 0. ) dump i_return_value i_return_value = res_display_anim_setup_2d( 30, "Linear", "lourdu" ) dump i_return_value i_return_value = res_display_anim_run( 10 ) dump i_return_value #--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Stop and clear stored animation frames from memory i_return_value = res_display_anim_clear() dump i_return_value # Refresh Graphics repaint_graphics( ) #---------------------------------------------------------------------

Main Index

1114 PCL Reference Manual Examples Animation Functions

res_display_anim_active

()

# # Purpose : This file provides an example of 2 calls to the # function res_display_anim_active() # # In this example field database, containing # the results is opened and a Deformation Plot # tool definition is created & posted in # default viewport. Then this function is # called before and after animation to check # whether animation is active or not. # # Before running this 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 res_display_anim_active() has no arguments. # #--------------------------------------------------------------------# Variable Declarations INTEGER i_return_value LOGICAL l_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 #--------------------------------------------------------------------# Create & Post Deformation Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "", "Global", "", "", "" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase: Displacements, Translational-0"// " of 0 layers () "] ) dump i_return_value

@ @

i_return_value = res_display_deformation_create( "", "Elements",@ 0, [""], 9, [ "DeformedStyle:White,Solid,1,Wireframe", @ "DeformedScale:Model=0.1", "UndeformedStyle:ON,"// @ "Blue,Solid,1,Wireframe", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:"// @ "Exponential, 12, White, 3", "DeformDisplay:Resultant", @ "DeformComps:OFF,OFF,OFF"] ) dump i_return_value i_return_value = res_display_deformation_post( "", 0 ) dump i_return_value #--------------------------------------------------------------------# Query whether animation is active or not l_return_value = res_display_anim_active() dump l_return_value

Main Index

Chapter 6: Results Postprocessing Functions 1115 Animation Functions

#-------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Set animation parameters and start animation i_return_value = res_display_tool_animate_scale( "Ramped", @ "Deformation", "", 0. ) dump i_return_value i_return_value = res_display_anim_setup_2d( 30, "Linear", "" ) dump i_return_value i_return_value = res_display_anim_run( 10 ) dump i_return_value #--------------------------------------------------------------------# Query whether animation is active or not l_return_value = res_display_anim_active() dump l_return_value #---------------------------------------------------------------------

res_display_cleanup

()

# # Purpose : This file provides an example of a call to the # function res_display_cleanup() # # In this example field database, containing # the results is opened and a Deformation Plot # tool definition is created & posted in # default viewport. After a pause this function # is called to clean the graphical display and # set graphics to wireframe state. # # Before running this 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 res_display_cleanup() has no arguments. # #--------------------------------------------------------------------# Variable Declarations 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 #--------------------------------------------------------------------# Create & Post Deformation Plot tool i_return_value = res_data_load_dbresult( 0, "Nodal", "Vector", @ "Default", "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "", "Global", "", "", "" ) dump i_return_value i_return_value = res_data_title( 0, "Nodal", "Vector", 1, [ "Default, Static Subcase: Displacements, Translational-0"//

Main Index

@ @

1116 PCL Reference Manual Examples Animation Functions

" of 0 layers () "] ) dump i_return_value i_return_value = res_display_deformation_create( "", "Elements",@ 0, [""], 9, [ "DeformedStyle:White,Solid,1,Wireframe", @ "DeformedScale:Model=0.1", "UndeformedStyle:ON,"// @ "Blue,Solid,1,Wireframe", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ScaleFactor:1.", "LabelStyle:"// @ "Exponential, 12, White, 3", "DeformDisplay:Resultant", @ "DeformComps:OFF,OFF,OFF"] ) dump i_return_value i_return_value = res_display_deformation_post( "", 0 ) dump i_return_value #--------------------------------------------------------------------# Session file paused press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Clean the graphical display and set graphics to wireframe state i_return_value = res_display_cleanup() dump i_return_value #---------------------------------------------------------------------

Main Index

Chapter 6: Results Postprocessing Functions 1117 Plot Tool Query Functions

Plot Tool Query Functions This section contains examples of some of the functions used to retrieve information regarding currently defined plot tools. res_display_get_ntools

()

# # Purpose : This file provides an example of two calls to # the function res_display_get_ntools() # # This session file opens the database "spool.db" # This function is then called to get the number # of tools defined. A fringe plot tool is created # and this function is called again to get the # number of tools defined. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_get_ntools() # has the following arguments: # # res_display_get_ntools # ( plot_type ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_type[32] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Get the number of tools defined s_plot_type = "" i_return_value = res_display_get_ntools ( s_plot_type ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create a fringe plot tool i_return_value = res_display_fringe_create ( "new_plot_tool", "FreeFaces", 0, [""], 12, [ "Range:Fri_default_Fringe", "RangeOverwrite:ON", "FringeStyle:Discrete/Smooth", "Shade:None", "ElemEdge:FreeEdge,Green,Solid,1", "Shrink:0", "TitleDisplay:ON",

Main Index

@ @ @ @ @ @ @ @ @

1118 PCL Reference Manual Examples Plot Tool Query Functions

"MinMaxDisplay:ON", "ValueDisplay:OFF", @ "Filter:None", "ScaleFactor:1.", @ "LabelStyle:Exponential, 12, White, 3"], TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the number of tools defined i_return_value = res_display_get_ntools ( s_plot_type ) dump i_return_value

@ @

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

res_display_get_nposted_tools

()

# # Purpose : This file provides an example of two calls to # the function res_display_get_nposted_tools() # # This session file opens the database "spool.db" # A fringe plot tool is created and this function # is called to get the number of posted tools. # The fringe plot is then posted to the viewport # and this function is called again to get the # number of posted tools. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_get_nposted_tools() # has the following arguments: # # res_display_get_nposted_tools # ( plot_type, # view_id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_type[32] INTEGER i_view_id INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Create a fringe plot tool i_return_value = res_display_fringe_create ( "new_plot_tool", "FreeFaces", 0, [""], 12, [ "Range:Fri_default_Fringe", "RangeOverwrite:ON", "FringeStyle:Discrete/Smooth", "Shade:None", "ElemEdge:FreeEdge,Green,Solid,1",

Main Index

@ @ @ @ @ @ @ @

Chapter 6: Results Postprocessing Functions 1119 Plot Tool Query Functions

"Shrink:0", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ValueDisplay:OFF", @ "Filter:None", "ScaleFactor:1.", @ "LabelStyle:Exponential, 12, White, 3"], TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the number of posted tools s_plot_type i_view_id

= "" = 0

i_return_value = res_display_get_nposted_tools ( s_plot_type, i_view_id ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Post the fringe plot to the viewport i_return_value = @ res_data_load_dbresult @ ( 0, "Nodal", "Scalar", "SPOOL_LOADS", @ "Static Subcase", "Stress Tensor", "", @ "At Z1", "VONM", "AsIs", @ "DeriveAverage", "All", "ShapeFunc", "", 0. ) dump i_return_value i_return_value = @ res_data_title @ ( 0, "Nodal", "Scalar", 1, ["SPOOL_LOADS, @ Static Subcase, Stress Tensor, - von Mises, At Z1"] ) dump i_return_value i_return_value = @ res_display_fringe_post @ ( "new_plot_tool", 0, "Nodal", TRUE, TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the number of posted tools i_return_value = res_display_get_nposted_tools ( s_plot_type, i_view_id ) dump i_return_value

@ @ @

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

()

res_display_get_posted_tools # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function res_display_get_posted_tools() This session file opens the database "spool.db" A fringe plot tool is created and this function is called to get the names and types of posted tools. The fringe plot is then posted to the viewport and this function is called again to get the names and types of posted tools.

1120 PCL Reference Manual Examples Plot Tool Query Functions

# # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_get_posted_tools() # has the following arguments: # # res_display_get_posted_tools # ( plot_type, # view_id, # tools, # types ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_type[32] INTEGER i_view_id STRING sav_tools[32](VIRTUAL) STRING sav_types[32](VIRTUAL) INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Create a fringe plot tool i_return_value = @ res_display_fringe_create @ ( "new_plot_tool", "FreeFaces", 0, [""], @ 12, [ "Range:Fri_default_Fringe", @ "RangeOverwrite:ON", @ "FringeStyle:Discrete/Smooth", @ "Shade:None", @ "ElemEdge:FreeEdge,Green,Solid,1", @ "Shrink:0", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ValueDisplay:OFF", @ "Filter:None", "ScaleFactor:1.", @ "LabelStyle:Exponential, 12, White, 3"], TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the names and types of the posted tools s_plot_type i_view_id

= "" = 0

i_return_value = res_display_get_posted_tools ( s_plot_type, i_view_id, sav_tools, sav_types ) dump i_return_value dump sav_tools dump sav_types

@ @ @ @ @

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

Main Index

Chapter 6: Results Postprocessing Functions 1121 Plot Tool Query Functions

#--------------------------------------------------------------------# Post the fringe plot to the viewport i_return_value = @ res_data_load_dbresult @ ( 0, "Nodal", "Scalar", "SPOOL_LOADS", @ "Static Subcase", "Stress Tensor", "", @ "At Z1", "VONM", "AsIs", @ "DeriveAverage", "All", "ShapeFunc", "", 0. ) dump i_return_value i_return_value = @ res_data_title @ ( 0, "Nodal", "Scalar", 1, ["SPOOL_LOADS, @ Static Subcase, Stress Tensor, - von Mises, At Z1"] ) dump i_return_value i_return_value = @ res_display_fringe_post @ ( "new_plot_tool", 0, "Nodal", TRUE, TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the names and types of the posted tools s_plot_type i_view_id

= "" = 0

i_return_value = res_display_get_posted_tools ( s_plot_type, i_view_id, sav_tools, sav_types ) dump i_return_value dump sav_tools dump sav_types

@ @ @ @ @

sys_free_array(sav_tools) sys_free_array(sav_types) #---------------------------------------------------------------------

()

res_display_get_color_id # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_get_color_id() This session file creates a new database by the name "new.db". A line is created. This function is then called to get color identifier for the input color string. Line color is finally changed using the color identifier obtained. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_display_get_color_id() has the following arguments: res_display_get_color_id ( color_str, color_id )

1122 PCL Reference Manual Examples Plot Tool Query Functions

# #--------------------------------------------------------------------# Variable Declarations STRING s_color_str[32] INTEGER i_color_id 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 line curve_color(3) i_return_value = @ asm_const_line_xyz @ ( "1", "<1 0 0>", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Get color identifier for the input color string "Green" # s_color_str = "Green" i_return_value = res_display_get_color_id ( s_color_str, i_color_id ) dump i_return_value dump i_color_id

@ @ @

#--------------------------------------------------------------------# Change color of the line to "Green" using the obtained color id curve_color (i_color_id) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

()

res_display_get_color_str # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_get_color_str() This session file creates a new database by the name "new.db". A line is created. This function is then called to get color string for the input color identifier. Line color is also changed using the same input color identifier. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_display_get_color_str() has the following arguments: res_display_get_color_str ( color_id, color_str )

Chapter 6: Results Postprocessing Functions 1123 Plot Tool Query Functions

# #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_id STRING s_color_str[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 line curve_color(3) i_return_value = @ asm_const_line_xyz @ ( "1", "<1 0 0>", "[0 0 0]", "Coord 0", sv_created_ids) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Get color string for the input color identifier # i_color_id = 2 i_return_value = res_display_get_color_str ( i_color_id, s_color_str ) dump i_return_value dump s_color_str

@ @ @

#--------------------------------------------------------------------# Change color of the line using the same color id curve_color (i_color_id) sys_free_string(sv_created_ids) #---------------------------------------------------------------------

()

res_display_get_tool_size # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_get_tool_size() This session file opens the database "spool.db" A fringe plot tool is created and posted. This function is then called to get the size of the targets and attributes for this plot tool. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function res_display_get_tool_size()

1124 PCL Reference Manual Examples Plot Tool Query Functions

# has the following arguments: # # res_display_get_tool_size # ( plot_type, # plot_name, # ntargets, # target_length, # nattribs ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_type[32] STRING s_plot_name[32] INTEGER i_ntargets INTEGER i_target_length INTEGER i_nattribs INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Create a fringe plot tool and post it to the viewport i_return_value = @ res_data_load_dbresult @ ( 0, "Nodal", "Scalar", "SPOOL_LOADS", @ "Static Subcase", "Stress Tensor", "", @ "At Z1", "VONM", "AsIs", @ "DeriveAverage", "All", "ShapeFunc", "", 0. ) dump i_return_value i_return_value = @ res_data_title @ ( 0, "Nodal", "Scalar", 1, ["SPOOL_LOADS, @ Static Subcase, Stress Tensor, - von Mises, At Z1"] ) dump i_return_value i_return_value = @ res_display_fringe_create @ ( "new_plot_tool", "FreeFaces", 0, [""], @ 12, [ "Range:Fri_default_Fringe", @ "RangeOverwrite:ON", @ "FringeStyle:Discrete/Smooth", @ "Shade:None", @ "ElemEdge:FreeEdge,Green,Solid,1", @ "Shrink:0", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ValueDisplay:OFF", @ "Filter:None", "ScaleFactor:1.", @ "LabelStyle:Exponential, 12, White, 3"], TRUE ) dump i_return_value i_return_value = @ res_display_fringe_post @ ( "new_plot_tool", 0, "Nodal", TRUE, TRUE ) dump i_return_value #--------------------------------------------------------------------# Get size of the targets and attributes for the plot tool # s_plot_type = "Fringe" s_plot_name = "new_plot_tool" i_return_value = res_display_get_tool_size ( s_plot_type, s_plot_name,

Main Index

@ @ @ @

Chapter 6: Results Postprocessing Functions 1125 Plot Tool Query Functions

dump dump dump dump

i_ntargets, i_target_length, i_nattribs ) i_return_value i_ntargets i_target_length i_nattribs

@ @

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

res_display_get_tool

()

# # Purpose : This file provides an example of a call to the # function res_display_get_tool() # # This session file opens the database "spool.db" # A fringe plot tool is created. Size of the # targets and attributes for this plot tool is # obtained. This function is then called to get # the definition of the plot tool. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_get_tool() # has the following arguments: # # res_display_get_tool # ( plot_type, # plot_name, # ent_type, # ntargets, # targets, # nattribs, # attributes, # deformed_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_type[32] STRING s_plot_name[32] STRING s_ent_type[32] INTEGER i_ntargets STRING sav_targets[128](VIRTUAL) INTEGER i_nattribs STRING sav_attributes[128](VIRTUAL) LOGICAL l_deformed_flag INTEGER i_target_length INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Create a fringe plot tool and post it to the viewport

Main Index

1126 PCL Reference Manual Examples Plot Tool Query Functions

i_return_value = @ res_data_load_dbresult @ ( 0, "Nodal", "Scalar", "SPOOL_LOADS", @ "Static Subcase", "Stress Tensor", "", @ "At Z1", "VONM", "AsIs", @ "DeriveAverage", "All", "ShapeFunc", "", 0. ) dump i_return_value i_return_value = @ res_data_title @ ( 0, "Nodal", "Scalar", 1, ["SPOOL_LOADS, @ Static Subcase, Stress Tensor, - von Mises, At Z1"] ) dump i_return_value i_return_value = @ res_display_fringe_create @ ( "new_plot_tool", "FreeFaces", 0, [""], @ 12, [ "Range:Fri_default_Fringe", @ "RangeOverwrite:ON", @ "FringeStyle:Discrete/Smooth", @ "Shade:None", @ "ElemEdge:FreeEdge,Green,Solid,1", @ "Shrink:0", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ValueDisplay:OFF", @ "Filter:None", "ScaleFactor:1.", @ "LabelStyle:Exponential, 12, White, 3"], TRUE ) dump i_return_value i_return_value = @ res_display_fringe_post @ ( "new_plot_tool", 0, "Nodal", TRUE, TRUE ) dump i_return_value #--------------------------------------------------------------------# Get size of the targets and attributes for the specified plot tool # s_plot_type = "Fringe" s_plot_name = "new_plot_tool" i_return_value = res_display_get_tool_size ( s_plot_type, s_plot_name, i_ntargets, i_target_length, i_nattribs ) dump i_return_value dump i_ntargets dump i_nattribs

@ @ @ @ @ @

#--------------------------------------------------------------------# Allocate memory for the arrays and reset the values # IF( i_ntargets > 0 ) THEN sys_allocate_array( sav_targets, 1, i_ntargets) ENDIF IF( i_nattribs > 0 ) THEN sys_allocate_array( sav_attributes, 1, i_nattribs) ENDIF i_ntargets = 100 i_nattribs = 100 #--------------------------------------------------------------------# Get the definition for the specified plot tool # i_return_value = @

Main Index

Chapter 6: Results Postprocessing Functions 1127 Plot Tool Query Functions

res_display_get_tool ( s_plot_type, s_plot_name, s_ent_type, i_ntargets, sav_targets, i_nattribs, sav_attributes, l_deformed_flag ) dump i_return_value dump s_ent_type dump i_ntargets dump sav_targets dump i_nattribs dump sav_attributes dump l_deformed_flag

@ @ @ @ @ @ @ @

sys_free_array(sav_targets) sys_free_array(sav_attributes) #---------------------------------------------------------------------

res_display_get_graph

()

# # Purpose : This file provides an example of a call to the # function res_display_get_graph() # # This session file opens the database "spool.db" # A graph plot tool is created. This function # is then called twice to get the definition of # this graph plot tool. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_get_graph() # has the following arguments: # # res_display_get_graph # ( plot_name, # graph_type, # entity_type, # ntargets, # targets, # nattribs, # attributes ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_name[32] STRING s_graph_type[32] STRING s_entity_type[32] INTEGER i_ntargets STRING saa_targets[64](10) INTEGER i_nattribs STRING saa_attributes[64](20) INTEGER i_return_value #---------------------------------------------------------------------

Main Index

1128 PCL Reference Manual Examples Plot Tool Query Functions

# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Create and post a graph plot tool i_return_value = @ res_data_load_dbresult @ ( 0, "Nodal", "Scalar", "SPOOL_LOADS", @ "Static Subcase", "Displacements", @ "Translational", "(NON-LAYERED)", "MAG",@ "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_title @ ( 0, "Nodal", "Scalar", 1, @ ["Displacements, Translational, MAG"] ) dump i_return_value i_return_value = @ res_data_load_dbresult @ ( -1, "Nodal", "Scalar", "SPOOL_LOADS", @ "Static Subcase", "Stress Tensor", "", @ "At Z1", "VONM", "AsIs", "", "", "", "", 0. ) dump i_return_value i_return_value = @ res_data_title @ ( -1, "Nodal", "Scalar", 1, ["Stress Tensor, VONM"] ) dump i_return_value i_return_value = @ res_display_graph_create @ ( "new_graph_plot_tool", "DataData", @ "Nodes", 1, ["NO:Node 1:100"], @ 13, ["curveFitMethod:Linear", @ "curveStyle:Solid", "symbolDisplay:OFF",@ "xAxisLabelDisplay:ON", @ "xAxisLabel:Stress", @ "xAxisScale:Linear", @ "xAxisLabelFormat:Integer, 9, White, 0",@ "yAxisLabelDisplay:ON", @ "yAxisLabel:Displacement", @ "yAxisScale:Linear", @ "yAxisLabelFormat:Fixed, 9, White, 2", @ "ScaleFactor:1.", "Filter:None", "", ""] ) dump i_return_value i_return_value = res_display_graph_post ( "new_graph_plot_tool", "Nodal", 0, -1, "Results Graph", FALSE ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Get the definition for the specified graph plot tool # s_plot_name = "new_graph_plot_tool" i_return_value = res_display_get_graph ( s_plot_name, s_graph_type, s_entity_type, i_ntargets, saa_targets, i_nattribs,

Main Index

@ @ @ @ @ @ @ @

Chapter 6: Results Postprocessing Functions 1129 Plot Tool Query Functions

dump dump dump dump dump dump dump

saa_attributes ) i_return_value s_graph_type s_entity_type i_ntargets saa_targets i_nattribs saa_attributes

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

res_display_count_tools

()

# # Purpose : This file provides an example of two calls to # the function res_display_count_tools() # # This session file opens the database "spool.db" # A fringe plot tool is created and this function # is called to get the number of unposted tools. # Fringe plot is then posted to the viewport and # this function is called again to get the number # unposted tools. # # Before running this session file run spool.ses # and create result file spool.op2 as per the # instructions given in it. Import this result # file spool.op2 into spool.db. For instructions # see file spool.ses # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function res_display_count_tools() # has the following arguments: # # res_display_count_tools # ( plot_type, # status ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_type[32] INTEGER i_status INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Create a fringe plot tool i_return_value = @ res_data_load_dbresult @ ( 0, "Nodal", "Scalar", "SPOOL_LOADS", @ "Static Subcase", "Stress Tensor", "", @ "At Z1", "VONM", "AsIs", @ "DeriveAverage", "All", "ShapeFunc", "", 0. ) dump i_return_value i_return_value = res_display_fringe_create ( "new_plot_tool", "FreeFaces", 0, [""], 12, [ "Range:Fri_default_Fringe",

Main Index

@ @ @ @

1130 PCL Reference Manual Examples Plot Tool Query Functions

"RangeOverwrite:ON", @ "FringeStyle:Discrete/Smooth", @ "Shade:None", @ "ElemEdge:FreeEdge,Green,Solid,1", @ "Shrink:0", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ValueDisplay:OFF", @ "Filter:None", "ScaleFactor:1.", @ "LabelStyle:Exponential, 12, White, 3"], TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the number of unposted tools s_plot_type = "" i_status = 0 i_return_value = res_display_count_tools ( s_plot_type, i_status ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Post the fringe plot to the viewport i_return_value = @ res_display_fringe_post @ ( "new_plot_tool", 0, "Nodal", TRUE, TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the number of unposted tools i_status = 0 i_return_value = res_display_count_tools ( s_plot_type, i_status ) dump i_return_value

@ @ @

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

()

res_display_get_tool_data # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function res_display_get_tool_data() This session file opens the database "spool.db" A fringe plot tool is created and posted. This function is then called to get the location and type of data associated with the plot tool. Before running this session file run spool.ses and create result file spool.op2 as per the instructions given in it. Import this result file spool.op2 into spool.db. For instructions see file spool.ses This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

Chapter 6: Results Postprocessing Functions 1131 Plot Tool Query Functions

# The function res_display_get_tool_data() # has the following arguments: # # res_display_get_tool_data # ( plot_type, # plot_name, # location, # type ) # #--------------------------------------------------------------------# Variable Declarations STRING s_plot_type[32] STRING s_plot_name[32] STRING s_location[32] STRING s_type[32] INTEGER i_return_value #--------------------------------------------------------------------# Opens the file spool.db uil_file_open.go ("spool.db") #--------------------------------------------------------------------# Create a fringe plot tool and post it to the viewport i_return_value = @ res_data_load_dbresult @ ( 0, "Nodal", "Scalar", "SPOOL_LOADS", @ "Static Subcase", "Stress Tensor", "", @ "At Z1", "VONM", "AsIs", @ "DeriveAverage", "All", "ShapeFunc", "", 0. ) dump i_return_value i_return_value = @ res_data_title @ ( 0, "Nodal", "Scalar", 1, ["SPOOL_LOADS, @ Static Subcase, Stress Tensor, - von Mises, At Z1"] ) dump i_return_value i_return_value = @ res_display_fringe_create @ ( "new_plot_tool", "FreeFaces", 0, [""], @ 12, [ "Range:Fri_default_Fringe", @ "RangeOverwrite:ON", @ "FringeStyle:Discrete/Smooth", @ "Shade:None", @ "ElemEdge:FreeEdge,Green,Solid,1", @ "Shrink:0", "TitleDisplay:ON", @ "MinMaxDisplay:ON", "ValueDisplay:OFF", @ "Filter:None", "ScaleFactor:1.", @ "LabelStyle:Exponential, 12, White, 3"], TRUE ) dump i_return_value i_return_value = @ res_display_fringe_post @ ( "new_plot_tool", 0, "Nodal", TRUE, TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the location and type of data associated with the plot tool # s_plot_type = "Fringe" s_plot_name = "new_plot_tool" i_return_value = res_display_get_tool_data ( s_plot_type, s_plot_name, s_location,

Main Index

@ @ @ @ @

1132 PCL Reference Manual Examples Plot Tool Query Functions

s_type ) dump i_return_value dump s_location dump s_type #---------------------------------------------------------------------

Main Index

Chapter 7: XY Plot Functions PCL Reference Manual Examples

7

Main Index

XY Plot Functions 

Introduction



Create Action



Post Action



Modify Action



Rename Action



Delete Action

1134 1135 1162 1172 1346 1347

1134 PCL Reference Manual Examples Introduction

Introduction This chapter contains examples of some of the functions that are used in the implementation of the “XY Plot” switch bar form. See XY Plot Functions (Ch. 7) in the PCL Reference Manual for a description of these functions.

Main Index

Chapter 7: XY Plot Functions 1135 Create Action

Create Action This section contains examples of some of the functions used to implement the “Create” actions. xy_curve_create

()

# # Purpose : This file provides an example of a call to the # function xy_curve_create() # # This file opens a new database "new.db" and # counts the number of curves in the xy plot. # Later it creates a curve and gets the count # of curves 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 xy_curve_create() # has the following arguments: # # xy_curve_create # ( curve_name, # text, # text_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_ncurves STRING s_window_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 xy window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Get the number of curves. i_return_value = xy_curve_num_get ( i_ncurves )

Main Index

@ @ @ @ @ @

@ @

1136 PCL Reference Manual Examples Create Action

dump i_return_value dump i_ncurves # Session file paused. Press "Resume" to continue. sf_pause() # Create a curve. s_curve_name = "new_curve" s_text = "new_curve" i_text_color = 1 i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

# Get the number of curves. i_return_value = @ xy_curve_num_get @ ( i_ncurves ) dump i_return_value dump i_ncurves #---------------------------------------------------------------------

xy_curve_current_get

()

# # Purpose : This file provides an example of two calls # to the function xy_curve_current_get() # # This file opens a new database "new.db" and # creates a window and two curves. Later it # assigns data points to the curves. It then sets # the current curve and gets it. Finally it sets # and gets the current curve 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 xy_curve_current_get() # has the following arguments: # # xy_curve_current_get # ( curve_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height

Main Index

Chapter 7: XY Plot Functions 1137 Create Action

STRING s_curve_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a xy window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Create a curve. s_curve_name = "curve_1" s_text = "temperature" i_text_color = 1 i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value # Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value # Create a curve. s_curve_name = "curve_2" s_text = "viscosity" i_text_color = 2 i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value # Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [8., 2., 3., 1., 4.] ) dump i_return_value # Set the current curve. s_curve_name = "curve_1" i_return_value = xy_curve_current_set ( s_curve_name ) dump i_return_value #

Main Index

Get the current curve.

@ @ @ @ @ @

@ @ @ @

@ @ @ @

@ @ @ @

@ @ @ @

@ @

1138 PCL Reference Manual Examples Create Action

s_curve_name = "" i_return_value = xy_curve_current_get ( s_curve_name ) dump i_return_value dump s_curve_name

@ @

# Session file paused. Press "Resume" to continue. sf_pause() # Set the current curve. s_curve_name = "curve_2" i_return_value = xy_curve_current_set ( s_curve_name ) dump i_return_value

@ @

# Get the current curve. s_curve_name = "" i_return_value = @ xy_curve_current_get @ ( s_curve_name ) dump i_return_value dump s_curve_name #---------------------------------------------------------------------

xy_curve_current_set

()

# # Purpose : This file provides an example of two calls # to the function xy_curve_current_set() # # This file opens a new database "new.db" and # creates a window and two curves. Later it # assigns data points to the curves. It then sets # the current curve and gets it. Finally it sets # and gets the current curve 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 xy_curve_current_set() # has the following arguments: # # xy_curve_current_set # ( curve_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height STRING s_curve_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

Chapter 7: XY Plot Functions 1139 Create Action

# Create a xy window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Create a curve. s_curve_name = "curve_1" s_text = "temperature" i_text_color = 1 i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value # Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value # Create a curve. s_curve_name = "curve_2" s_text = "viscosity" i_text_color = 2 i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

@ @ @ @

@ @ @ @

# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [8., 2., 3., 1., 4.] ) dump i_return_value

@ @ @ @

# Set the current curve. s_curve_name = "curve_1" i_return_value = xy_curve_current_set ( s_curve_name ) dump i_return_value

@ @

# Get the current curve. s_curve_name = "" i_return_value = xy_curve_current_get ( s_curve_name ) dump i_return_value dump s_curve_name

Main Index

@ @ @ @ @ @

@ @

1140 PCL Reference Manual Examples Create Action

# Session file paused. Press "Resume" to continue. sf_pause() # Set the current curve. s_curve_name = "curve_2" i_return_value = xy_curve_current_set ( s_curve_name ) dump i_return_value

@ @

# Get the current curve. s_curve_name = "" i_return_value = @ xy_curve_current_get @ ( s_curve_name ) dump i_return_value dump s_curve_name #---------------------------------------------------------------------

xy_curve_data_file_get

()

# # Purpose : This file provides an example of a call to the # function xy_curve_data_file_get() # # This file opens a new database "new.db" and # creates a window and a curve. Later it reads # the data for the curve from a file. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. The file "curve.xyd" # should be present in the working directory. # # The function xy_curve_data_file_get() # has the following arguments: # # xy_curve_data_file_get # ( file_name, # curve_name, # set_number ) # #--------------------------------------------------------------------# Variable Declarations STRING s_text[32] INTEGER i_text_color STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height STRING s_file_name[32] STRING s_curve_name[32] INTEGER i_set_number INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a xy window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0

Main Index

Chapter 7: XY Plot Functions 1141 Create Action

r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Create a curve. s_curve_name = "curve_1" s_text = "temperature_curve" i_text_color = 1 i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

# Get the curve data from the file "curve.xyd" s_file_name = "curve.xyd" s_curve_name = "curve_1" i_set_number = 1 i_return_value = @ xy_curve_data_file_get @ ( s_file_name, @ s_curve_name, @ i_set_number ) dump i_return_value #---------------------------------------------------------------------

xy_curve_data_get

()

# # Purpose : This file provides an example of a call to the # function xy_curve_data_get() # # This file opens a new database "new.db" and # creates a window and a curve. Later it reads # the data for the curve from a file. Finally # it gets the curve data. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. The file "curve.xyd" # should be present in the working directory. # # The function xy_curve_data_get() # has the following arguments: # # xy_curve_data_get # ( curve_name, # yonly, # npoints, # x_array, # y_array ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_yonly INTEGER i_npoints REAL ra_x_array(VIRTUAL) REAL ra_y_array(VIRTUAL)

Main Index

1142 PCL Reference Manual Examples Create Action

STRING s_text[32] INTEGER i_text_color STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height STRING s_file_name[32] STRING s_curve_name[32] INTEGER i_set_number INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a xy window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Create a curve. s_curve_name = "curve_1" s_text = "temperature" i_text_color = 1 i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

# Assign data to the curve from file "curve.xyd" s_file_name = "curve.xyd" s_curve_name = "curve_1" i_set_number = 1 i_return_value = @ xy_curve_data_file_get @ ( s_file_name, @ s_curve_name, @ i_set_number ) dump i_return_value # Get the curve data. I_return_value = xy_curve_num_points_get ( s_curve_name, l_yonly, i_npoints )

@ @ @ @

if( I_yonly == false ) then I_return_value = @ sys_allocate_array(ra_x_array,1,i_npoints) I_return_value = @ sys_allocate_array(ra_y_array,1,i_npoints) else I_return_value = @ sys_allocate_array(ra_y_array,1,i_npoints)

Main Index

Chapter 7: XY Plot Functions 1143 Create Action

end if i_return_value = @ xy_curve_data_get @ ( s_curve_name, @ l_yonly, @ i_npoints, @ ra_x_array, @ ra_y_array ) dump i_return_value dump l_yonly dump i_npoints dump ra_x_array dump ra_y_array #---------------------------------------------------------------------

xy_curve_data_set

()

# # Purpose : This file provides an example of a call to the # function xy_curve_data_set() # # This file opens a new database "new.db" and # creates a window and a curve in it. Finally it # assigns data points to 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. # # The function xy_curve_data_set() # has the following arguments: # # xy_curve_data_set # ( curve_name, # yonly, # npoints, # x_array, # y_array ) # #--------------------------------------------------------------------# Variable Declarations STRING s_text[32] INTEGER i_text_color STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height STRING s_curve_name[32] LOGICAL l_yonly INTEGER i_npoints REAL ra_x_array(5) REAL ra_y_array(5) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0

Main Index

1144 PCL Reference Manual Examples Create Action

i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Create a curve. s_curve_name = "curve_1" s_text = "viscosity" i_text_color = 1 i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

# Assign data points to the curve l_yonly = FALSE i_npoints = 5 ra_x_array = [1., 3., 6., 8., 9.] ra_y_array = [2., 8., 4., 9., 5.] i_return_value = @ xy_curve_data_set @ ( s_curve_name, @ l_yonly, @ i_npoints, @ ra_x_array, @ ra_y_array ) dump i_return_value #---------------------------------------------------------------------

xy_curve_list_get

()

# # Purpose : This file provides an example of a call to the # function xy_curve_list_get() # # This file opens a new database "new.db" , # creates a XY window and gets the list of curves # in it. It then creates a curve and gets the # list of curves 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 xy_curve_list_get() # has the following arguments: # # xy_curve_list_get # ( curve_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width

Main Index

Chapter 7: XY Plot Functions 1145 Create Action

REAL r_height STRING sa_curve_list[32](1) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a xy window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Get the list of curves. i_return_value = xy_curve_list_get ( sa_curve_list ) dump i_return_value dump sa_curve_list

@ @

# Session file paused. Press "Resume" to continue. sf_pause() # Create a curve. s_curve_name = "new_curve" s_text = "new_curve" i_text_color = 1 i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

# Get the list of curves. i_return_value = xy_curve_list_get ( sa_curve_list ) dump i_return_value dump sa_curve_list

@ @

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

()

xy_curve_num_get # # #

Main Index

Purpose

:

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

1146 PCL Reference Manual Examples Create Action

# # This file opens a new database "new.db" and # counts the number of curves in the xy plot. # Later it creates a curve and gets the count # of curves 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 xy_curve_num_get() # has the following arguments: # # xy_curve_num_get # ( ncurves ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_ncurves STRING s_window_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 xy window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Get the number of curves. i_return_value = xy_curve_num_get ( i_ncurves ) dump i_return_value dump i_ncurves

@ @ @ @ @ @

@ @

# Session file paused. Press "Resume" to continue. sf_pause() # Create a curve. s_curve_name = "new_curve" s_text = "new_curve" i_text_color = 1 i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color )

Main Index

@ @ @ @

Chapter 7: XY Plot Functions 1147 Create Action

dump i_return_value # Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

# Get the number of curves. i_return_value = @ xy_curve_num_get @ ( i_ncurves ) dump i_return_value dump i_ncurves #---------------------------------------------------------------------

xy_title_create

()

# # Purpose : This file provides an example of a call to the # function xy_title_create() # # This file opens a new database "new.db" and # counts the number of titles in the xy plot. # Later it creates a title and gets the count # of titles 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 xy_title_create() # has the following arguments: # # xy_title_create # ( title_name, # text, # font_size, # location, # text_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_title_name[32] STRING s_text[32] INTEGER i_font_size REAL ra_location(2) INTEGER i_text_color STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_ntitles INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a xy window. s_window_name = "XY_Window" r_x_location = 2.5

Main Index

1148 PCL Reference Manual Examples Create Action

r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Count the number of titles. i_return_value = xy_title_num_get ( i_ntitles ) dump i_return_value dump i_ntitles

@ @

# Session file paused. Press "Resume" to continue. sf_pause() # Create a Title. s_title_name = "NEW_TITLE" s_text = "NEW_TITLE" i_font_size = 12 ra_location(1) = 20 ra_location(2) = 10 i_text_color = 1 i_return_value = xy_title_create ( s_title_name, s_text, i_font_size, ra_location, i_text_color ) dump i_return_value

@ @ @ @ @ @

# Count the number of titles. i_return_value = @ xy_title_num_get @ ( i_ntitles ) dump i_return_value dump i_ntitles #---------------------------------------------------------------------

()

xy_title_list_get # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_title_list_get() This file opens a new database "new.db" , creates a XY window and gets the list of titles in it. Later it creates a title and gets the list of titles 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 xy_title_list_get() has the following arguments: xy_title_list_get

Chapter 7: XY Plot Functions 1149 Create Action

# ( title_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_title_name[32] STRING s_text[32] INTEGER i_font_size REAL ra_location(2) INTEGER i_text_color STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height STRING sa_title_list[32](1) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a xy window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Get the list of titles. i_return_value = xy_title_list_get ( sa_title_list ) dump i_return_value dump sa_title_list

@ @ @ @ @ @

@ @

# Session file paused. Press "Resume" to continue. sf_pause() # Create a Title. s_title_name = "NEW_TITLE" s_text = "NEW_TITLE" i_font_size = 12 ra_location(1) = 20 ra_location(2) = 10 i_text_color = 1 i_return_value = xy_title_create ( s_title_name, s_text, i_font_size, ra_location, i_text_color ) dump i_return_value # Get the list of titles. i_return_value = xy_title_list_get ( sa_title_list ) dump i_return_value dump sa_title_list

Main Index

@ @ @ @ @ @

@ @

1150 PCL Reference Manual Examples Create Action

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

xy_title_num_get

()

# # Purpose : This file provides an example of a call to the # function xy_title_num_get() # # This file opens a new database "new.db" and # counts the number of titles in the xy plot. # Later it creates a title and gets the count # of titles 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 xy_title_num_get() # has the following arguments: # # xy_title_num_get # ( ntitles ) # #--------------------------------------------------------------------# Variable Declarations STRING s_title_name[32] STRING s_text[32] INTEGER i_font_size REAL ra_location(2) INTEGER i_text_color STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_ntitles INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a xy window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Count the number of titles. i_return_value = xy_title_num_get ( i_ntitles ) dump i_return_value dump i_ntitles #

Main Index

@ @ @ @ @ @

@ @

Session file paused. Press "Resume" to continue.

Chapter 7: XY Plot Functions 1151 Create Action

sf_pause() # Create a Title. s_title_name = "NEW_TITLE" s_text = "NEW_TITLE" i_font_size = 12 ra_location(1) = 20 ra_location(2) = 10 i_text_color = 1 i_return_value = xy_title_create ( s_title_name, s_text, i_font_size, ra_location, i_text_color ) dump i_return_value

@ @ @ @ @ @

# Count the number of titles. i_return_value = @ xy_title_num_get @ ( i_ntitles ) dump i_return_value dump i_ntitles #---------------------------------------------------------------------

xy_window_create

()

# # Purpose : This file provides an example of a call to the # function xy_window_create() # # This file opens a new database "new.db" and # counts the number of windows. Later it creates # a new XY window and counts the number of # windows 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 xy_window_create() # has the following arguments: # # xy_window_create # ( window_name, # x_location, # y_location, # width, # height ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

1152 PCL Reference Manual Examples Create Action

# Count the number of windows. i_return_value = xy_window_num_get ( i_nwindows ) dump i_return_value dump i_nwindows

@ @

# Session file paused. Press "Resume" to continue. sf_pause() # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Count the number of windows. i_return_value = @ xy_window_num_get @ ( i_nwindows ) dump i_return_value dump i_nwindows #---------------------------------------------------------------------

xy_window_current_get

()

# # Purpose : This file provides an example of two calls to # the function xy_window_current_get() # # This file opens a new database "new.db" and # creates two windows. Later it gets the current # window. Finally it sets the current window and # gets the current window 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 xy_window_current_get() # has the following arguments: # # xy_window_current_get # ( window_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height STRING s_window_name[128] INTEGER i_return_value #---------------------------------------------------------------------

Main Index

Chapter 7: XY Plot Functions 1153 Create Action

# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create two new windows. s_window_name = "XY_Window_1" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

s_window_name = "XY_Window_2" r_x_location = 5. r_y_location = 6. i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Get the current window. s_window_name = "" i_return_value = xy_window_current_get ( s_window_name ) dump i_return_value dump s_window_name

@ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the current window. s_window_name = "XY_Window_1" i_return_value = xy_window_current_set ( s_window_name ) dump i_return_value

@ @

# Get the current window. s_window_name = "" i_return_value = @ xy_window_current_get @ ( s_window_name ) dump i_return_value dump s_window_name #---------------------------------------------------------------------

()

xy_window_current_set # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_window_current_set() This file opens a new database "new.db" and creates two windows. Later it gets the current

1154 PCL Reference Manual Examples Create Action

# window. Finally it sets the current window and # gets the current window 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 xy_window_current_set() # has the following arguments: # # xy_window_current_set # ( window_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height STRING s_window_name[128] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create two new windows. s_window_name = "XY_Window_1" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value s_window_name = "XY_Window_2" r_x_location = 5. r_y_location = 6. i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Get the current window. s_window_name = "" i_return_value = xy_window_current_get ( s_window_name ) dump i_return_value dump s_window_name

@ @ @ @ @ @

@ @ @ @ @ @

@ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Set the current window. s_window_name = "XY_Window_1"

Main Index

Chapter 7: XY Plot Functions 1155 Create Action

i_return_value = xy_window_current_set ( s_window_name ) dump i_return_value

@ @

# Get the current window. s_window_name = "" i_return_value = @ xy_window_current_get @ ( s_window_name ) dump i_return_value dump s_window_name #---------------------------------------------------------------------

xy_window_list_get

()

# # Purpose : This file provides an example of a call to the # function xy_window_list_get() # # This file opens a new database "new.db" and # gets the list of XY windows. Later it creates # a new XY window and gets the list of windows # 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 xy_window_list_get() # has the following arguments: # # xy_window_list_get # ( window_list ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height STRING sa_window_list[32](1) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Get the names of windows. i_return_value = xy_window_list_get ( sa_window_list ) dump i_return_value dump sa_window_list

@ @

# Session file paused. Press "Resume" to continue. sf_pause() # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0

Main Index

1156 PCL Reference Manual Examples Create Action

i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Get the names of windows. i_return_value = @ xy_window_list_get @ ( sa_window_list ) dump i_return_value dump sa_window_list #---------------------------------------------------------------------

xy_window_nposted_get

()

# # Purpose : This file provides an example of two calls to # the function xy_window_nposted_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the count of # posted windows. Finally it unposts the window # and gets the count of posted windows. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function xy_window_nposted_get() # has the following arguments: # # xy_window_nposted_get # ( nposted ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nposted INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height )

Main Index

@ @ @ @ @ @

Chapter 7: XY Plot Functions 1157 Create Action

dump i_return_value # Get the number of posted windows. i_return_value = xy_window_nposted_get ( i_nposted ) dump i_return_value dump i_nposted

@ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Unpost the window. i_return_value = xy_window_unpost ( s_window_name ) dump i_return_value

@ @

# Get the number of posted windows. i_return_value = @ xy_window_nposted_get @ ( i_nposted ) dump i_return_value dump i_nposted #---------------------------------------------------------------------

xy_window_num_get

()

# # Purpose : This file provides an example of a call to the # function xy_window_num_get() # # This file opens a new database "new.db" and # counts the number of windows. Later it creates # a new XY window and counts the number of # windows 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 xy_window_num_get() # has the following arguments: # # xy_window_num_get # ( nwindows ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Count the number of windows. i_return_value = xy_window_num_get ( i_nwindows )

Main Index

@ @

1158 PCL Reference Manual Examples Create Action

dump i_return_value dump i_nwindows # Session file paused. Press "Resume" to continue. sf_pause() # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Count the number of windows. i_return_value = @ xy_window_num_get @ ( i_nwindows ) dump i_return_value dump i_nwindows #---------------------------------------------------------------------

xy_window_post

()

# # Purpose : This file provides an example of a call to the # function xy_window_post() # # This file opens a new database "new.db" and # creates a window. Later it unposts the window # and then posts 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 xy_window_post() # has the following arguments: # # xy_window_post # ( window_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[128] 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 window. s_window_name = "XY_Window" r_x_location = 2.5

Main Index

Chapter 7: XY Plot Functions 1159 Create Action

r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_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 window. i_return_value = xy_window_unpost ( s_window_name ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Post the window. i_return_value = @ xy_window_post @ ( s_window_name ) dump i_return_value #---------------------------------------------------------------------

xy_window_posted_get

()

# # Purpose : This file provides an example of a call to the # function xy_window_posted_get() # # This file opens a new database "new.db" and # creates two new windows and gets the posted # window names. Later it unpost one of the # windows and gets the posted window names 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 xy_window_posted_get() # has the following arguments: # # xy_window_posted_get # ( posted_list ) # #--------------------------------------------------------------------# Variable Declarations STRING sa_posted_list[32](2) STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nposted INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db")

Main Index

1160 PCL Reference Manual Examples Create Action

$? YES 36000002 # Create two new windows. s_window_name = "XY_Window_1" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

s_window_name = "XY_Window_2" r_x_location = 5. r_y_location = 6. i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Get the names of the posted windows. i_return_value = xy_window_posted_get ( sa_posted_list ) dump i_return_value dump sa_posted_list

@ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Unpost the window "XY_Window_1" s_window_name = "XY_Window_1" i_return_value = xy_window_unpost ( s_window_name ) dump i_return_value

@ @

# Get the names of the posted windows. sa_posted_list(1) = "" sa_posted_list(2) = "" i_return_value = @ xy_window_posted_get @ ( sa_posted_list ) dump i_return_value dump sa_posted_list #---------------------------------------------------------------------

()

xy_window_unpost # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_window_unpost() This file opens a new database "new.db" and creates a window. Later it gets the count of posted windows. Finally it unposts the window and gets the count of posted windows.

Chapter 7: XY Plot Functions 1161 Create Action

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function xy_window_unpost() # has the following arguments: # # xy_window_unpost # ( window_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nposted INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Get the number of posted windows. i_return_value = xy_window_nposted_get ( i_nposted ) dump i_return_value dump i_nposted

@ @ @ @ @ @

@ @

# Session file paused. Press "Resume" to continue.. sf_pause() # Unpost the window. i_return_value = xy_window_unpost ( s_window_name ) dump i_return_value

@ @

# Get the number of posted windows. i_return_value = @ xy_window_nposted_get @ ( i_nposted ) dump i_return_value dump i_nposted #---------------------------------------------------------------------

Main Index

1162 PCL Reference Manual Examples Post Action

Post Action This section contains examples of some of the functions used to implement the “Post” actions. xy_curve_nposted_get

()

# # Purpose : This file provides example of two calls to the # function xy_curve_nposted_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the number of # posted curves in the database. Finally it # creates a curve and gets the number of posted # curves again. # # This file can be run by starting a session of # Patran, opening a new or existing database, # and running this session file through the # "File","Session","Play" pulldown menus # on the menu bar. # # The function xy_curve_nposted_get() # has the following arguments: # # xy_curve_nposted_get # ( nposted ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_nposted INTEGER i_return_value STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height #--------------------------------------------------------------------# Opening new database new.db uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Get the number of posted curves i_return_value = @ xy_curve_nposted_get( i_nposted) dump i_return_value dump i_nposted #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue..

Main Index

Chapter 7: XY Plot Functions 1163 Post Action

sf_pause() #--------------------------------------------------------------------# Create a curve i_return_value = @ xy_curve_create( "curve_1", "data of x vs y", 1) dump i_return_value i_return_value = @ xy_curve_data_set @ ( "curve_1", FALSE, 10, [1., 2., 3., 4., @ 5., 6., 7., 8., 9., 10.], [-5., 6., 4., @ -10., -7., 10., 15., 23., -20., -11.]) dump i_return_value #--------------------------------------------------------------------# Get the number of posted curves i_return_value = @ xy_curve_nposted_get( i_nposted) dump i_return_value dump i_nposted #---------------------------------------------------------------------

xy_curve_posted_get

()

# # Purpose : This file provides an example of a call to the # function xy_curve_posted_get() # # This file opens a new database "new.db" and # creates a window and a curve in it. The above # mentioned function is called to get the list of # posted curves from the database. # # This file can be run by starting a session of # Patran, opening a new or existing database, # and running this session file through the # "File","Session","Play" pulldown menus # on the menu bar. # # The function xy_curve_posted_get() # has the following arguments: # # xy_curve_posted_get # ( posted_list ) # #--------------------------------------------------------------------# Variable Declarations STRING sav_posted_list[32](VIRTUAL) INTEGER i_return_value STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nposted #--------------------------------------------------------------------# Opening new database new.db uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value =

Main Index

@

1164 PCL Reference Manual Examples Post Action

xy_window_create @ ( s_window_name, @ r_x_location, @ r_y_location, @ r_width, @ r_height ) dump i_return_value #--------------------------------------------------------------------# Create a curve i_return_value = @ xy_curve_create("curve_1", "data of x vs y", 1) dump i_return_value i_return_value = @ xy_curve_data_set @ ( "curve_1", FALSE, 10, [1., 2., 3., 4., @ 5., 6., 7., 8., 9., 10.], [-5., 6., 4., @ -10., -7., 10., 15., 23., -20., -11.]) dump i_return_value #--------------------------------------------------------------------# Get the number of posted curves i_return_value = @ xy_curve_nposted_get( i_nposted) dump i_return_value # Get the list of posted curves sys_allocate_array( sav_posted_list, 1, i_nposted) i_return_value = xy_curve_posted_get ( sav_posted_list) dump i_return_value dump sav_posted_list

@ @

sys_free_array(sav_posted_list) #---------------------------------------------------------------------

xy_title_nposted_get

()

# # Purpose : This file provides an example of two call to # the function xy_title_nposted_get() # # This session file opens a new database ’new.db’ # and creates a xy window. The above mentioned # function is called to get the number of posted # titles in the database. A new title is then # created and again the above mentioned function # is called to get the number of posted titles. # # This file can be run by starting a session of # Patran, opening a new or existing database, # and running this session file through the # "File","Session","Play" pulldown menus # on the menu bar. # # The function xy_title_nposted_get() # has the following arguments: # # xy_title_nposted_get # ( nposted ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_nposted INTEGER i_return_value

Main Index

Chapter 7: XY Plot Functions 1165 Post Action

STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height #--------------------------------------------------------------------# Opening new database new.db uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Get the number of posted titles i_return_value = @ xy_title_nposted_get @ (i_nposted) dump i_return_value dump i_nposted #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Create a title i_return_value = @ xy_title_create @ ( "TITLE_1", "TITLE_1", 14,[5.0, 10.0], 1) dump i_return_value #--------------------------------------------------------------------# Get the number of posted titles i_return_value = @ xy_title_nposted_get @ ( i_nposted ) dump i_return_value dump i_nposted #---------------------------------------------------------------------

()

xy_title_posted_get # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_title_posted_get() This session file opens a new database ’new.db’ and creates a new xy window. Two new titles are created and posted to the xy window. The above mentioned function is called to get the list of posted titles. This file can be run by starting a session of Patran, opening a new or existing database, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

1166 PCL Reference Manual Examples Post Action

# # The function xy_title_posted_get() # has the following arguments: # # xy_title_posted_get # ( posted_list ) # #--------------------------------------------------------------------# Variable Declarations STRING sav_posted_list[32](VIRTUAL) INTEGER i_return_value STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nposted #--------------------------------------------------------------------# Opening new database new.db uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

#--------------------------------------------------------------------# Create two titles i_return_value = @ xy_title_create @ ( "TITLE_1", "TITLE_1", 14,[5.0, 10.0], 1) dump i_return_value i_return_value = @ xy_title_create @ ( "TITLE_2", "TITLE_2", 14,[5.0, 20.0], 1) dump i_return_value #--------------------------------------------------------------------# Get the number of posted titles i_return_value = @ xy_title_nposted_get( i_nposted) dump i_return_value # Get the list of posted titles sys_allocate_array( sav_posted_list, 1, i_nposted) i_return_value = xy_title_posted_get ( sav_posted_list) dump i_return_value dump sav_posted_list

@ @

sys_free_array(sav_posted_list) #---------------------------------------------------------------------

Main Index

Chapter 7: XY Plot Functions 1167 Post Action

xy_window_curve_post

()

# # Purpose : This file provides an example of a call to the # function xy_window_curve_post() # # This session file opens a new database ’new.db’ # and creates two xy windows. A curve is created # in the second xy window. The above mentioned # function is called to post this curve to the # first xy window. # # This file can be run by starting a session of # Patran, opening a new or existing database, # and running this session file through the # "File","Session","Play" pulldown menus # on the menu bar. # # The function xy_window_curve_post() # has the following arguments: # # xy_window_curve_post # ( window_name, # curve_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] STRING s_curve_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Opening new database new.db uil_file_new.go("","new.db") $? YES 36000002 # Create two xy windows s_window_name = "XY_Window1" i_return_value = xy_window_create ( s_window_name, 1.5, 3.5, 5., 5.) dump i_return_value

@ @

s_window_name = "XY_Window2" i_return_value = @ xy_window_create @ ( s_window_name, 6.5, 3.5, 5., 5.) dump i_return_value #--------------------------------------------------------------------# Create a curve in the second window i_return_value = @ xy_curve_create( "curve_1", "data of x vs y", 1) dump i_return_value i_return_value = @ xy_curve_data_set @ ( "curve_1", FALSE, 10, [1., 2., 3., 4., @ 5., 6., 7., 8., 9., 10.], [-5., 6., 4., @ -10., -7., 10., 15., 23., -20., -11.]) dump i_return_value #--------------------------------------------------------------------# Session file paused press ’Resume’ to continue sf_pause() #--------------------------------------------------------------------# Post the curve to the first window s_window_name = "XY_Window1"

Main Index

1168 PCL Reference Manual Examples Post Action

s_curve_name

= "curve_1"

i_return_value = @ xy_window_curve_post @ ( s_window_name, @ s_curve_name ) dump i_return_value #---------------------------------------------------------------------

xy_window_curve_unpost

()

# Purpose : This file provides an example of a call to the # function xy_window_curve_unpost() # # This session file opens a new database ’new.db’ # and a new xy window is created. A new curve is # created and the number of posted curves is get. # The above mentioned function is then called to # unpost the curve from the xy window. The number # of posted curves is get again. # # This file can be run by starting a session of # Patran, opening a new or existing database, # and running this session file through the # "File","Session","Play" pulldown menus # on the menu bar. # # The function xy_window_curve_unpost() # has the following arguments: # # xy_window_curve_unpost # ( window_name, # curve_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] STRING s_curve_name[32] INTEGER i_return_value INTEGER i_nposted #--------------------------------------------------------------------# Opening new database new.db uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window1" i_return_value = @ xy_window_create @ ( s_window_name, 1.5, 3.5, 5., 5.) dump i_return_value #--------------------------------------------------------------------# Create a curve and get the number of posted curves i_return_value = @ xy_curve_create ( "curve_1", "data of x vs y", 1) dump i_return_value

Main Index

i_return_value = xy_curve_data_set ( "curve_1", FALSE, 10, [1., 2., 3., 4., 5., 6., 7., 8., 9., 10.], [-5., 6., 4., -10., -7., 10., 15., 23., -20., -11.]) dump i_return_value

@ @ @ @

i_return_value = xy_curve_nposted_get( i_nposted)

@

Chapter 7: XY Plot Functions 1169 Post Action

dump i_return_value dump i_nposted #--------------------------------------------------------------------# Session file paused press ’Resume’ to continue sf_pause() #--------------------------------------------------------------------# Unpost the current curve from the window s_window_name = "XY_Window1" s_curve_name = "curve_1" i_return_value = xy_window_curve_unpost ( s_window_name, s_curve_name ) dump i_return_value

@ @ @

# Get the number of posted curves again i_return_value = @ xy_curve_nposted_get( i_nposted) dump i_return_value dump i_nposted #---------------------------------------------------------------------

()

xy_window_title_post

# # Purpose : This file provides an example of a call to the # function xy_window_title_post() # # This session file opens a new database ’new.db’ # and creates two xy windows. A title is created # in the second xy window. The above mentioned # function is called to post this title to the # first xy window. # # This file can be run by starting a session of # Patran, opening a new or existing database, # and running this session file through the # "File","Session","Play" pulldown menus # on the menu bar. # # The function xy_window_title_post() # has the following arguments: # # xy_window_title_post # ( window_name, # title_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] STRING s_title_name[256] INTEGER i_return_value #--------------------------------------------------------------------# Opening new database new.db uil_file_new.go("","new.db") $? YES 36000002 # Create two xy windows s_window_name = "XY_Window1" i_return_value = xy_window_create ( s_window_name, 1.5, 3.5, 5., 5.) dump i_return_value s_window_name

Main Index

= "XY_Window2"

@ @

1170 PCL Reference Manual Examples Post Action

i_return_value = xy_window_create ( s_window_name, 6.5, 3.5, 5., 5.) dump i_return_value

@ @

#--------------------------------------------------------------------# Create a title i_return_value = @ xy_title_create @ ( "TITLE_1", "TITLE_1", 40,[5.0, 20.0], 1) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Post the title to the first window s_window_name = "XY_Window1" s_title_name = "TITLE_1" i_return_value = xy_window_title_post ( s_window_name, s_title_name ) dump i_return_value

@ @ @

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

xy_window_title_unpost

()

# # Purpose : This file provides an example of a call to the # function xy_window_title_unpost() # # This session file opens a new database ’new.db’ # and a new xy window is created. A new title is # created and the number of posted titles is get. # The above mentioned function is then called to # unpost the title from the xy window. The number # of posted titles is get again. # # This file can be run by starting a session of # Patran, opening a new or existing database, # and running this session file through the # "File","Session","Play" pulldown menus # on the menu bar. # # The function xy_window_title_unpost() # has the following arguments: # # xy_window_title_unpost # ( window_name, # title_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] STRING s_title_name[256] INTEGER i_return_value INTEGER i_nposted #--------------------------------------------------------------------# Opening new database new.db uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window1"

Main Index

Chapter 7: XY Plot Functions 1171 Post Action

i_return_value = @ xy_window_create @ ( s_window_name, 1.5, 3.5, 5., 5.) dump i_return_value #--------------------------------------------------------------------# Create a title and get the number of posted titles i_return_value = @ xy_title_create @ ( "TITLE_1", "TITLE_1", 40,[5.0, 20.0], 1) dump i_return_value i_return_value = @ xy_title_nposted_get( i_nposted) dump i_return_value dump i_nposted #--------------------------------------------------------------------# Session file paused press ’Resume’ to continue sf_pause() #--------------------------------------------------------------------# Unpost the current title from the window s_window_name = "XY_Window1" s_title_name = "TITLE_1" i_return_value = xy_window_title_unpost ( s_window_name, s_title_name ) dump i_return_value

@ @ @

# Get the number of posted titles again i_return_value = @ xy_title_nposted_get( i_nposted) dump i_return_value dump i_nposted #---------------------------------------------------------------------

Main Index

1172 PCL Reference Manual Examples Modify Action

Modify Action This section contains examples of some of the functions used to implement the “Modify” actions. xy_axis_assign_method_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_assign_method_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the labels # assignment method. Finally it changes the # assignment method 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 xy_axis_assign_method_get() # has the following arguments: # # xy_axis_assign_method_get # ( axis_name, # method ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] STRING s_method[20] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set

Main Index

@ @ @ @ @ @

@ @

Chapter 7: XY Plot Functions 1173 Modify Action

(

s_axis_name, l_label_flag ) dump i_return_value

@

# Get the labels assignment method. i_return_value = xy_axis_assign_method_get ( s_axis_name, s_method ) dump i_return_value dump s_method

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the labels assignment method. IF ( s_method == "semiauto" ) THEN s_method = "automatic" ELSE s_method = "semiauto" ENDIF i_return_value = @ xy_axis_assign_method_set @ ( s_axis_name, @ s_method ) dump i_return_value dump s_method #--------------------------------------------------------------------# Reset the value. s_method = "" #--------------------------------------------------------------------# Get the labels assignment method. i_return_value = @ xy_axis_assign_method_get @ ( s_axis_name, @ s_method ) dump i_return_value dump s_method #---------------------------------------------------------------------

()

xy_axis_assign_method_set # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_axis_assign_method_set() This file opens a new database "new.db" and creates a window. Later it gets the labels assignment method. Finally it changes the assignment method 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 xy_axis_assign_method_set() has the following arguments: xy_axis_assign_method_set ( axis_name, method )

1174 PCL Reference Manual Examples Modify Action

# #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] STRING s_method[20] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value # Get the labels assignment method. i_return_value = xy_axis_assign_method_get ( s_axis_name, s_method ) dump i_return_value dump s_method

@ @ @ @ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the labels assignment method. IF( s_method == "semiauto" ) THEN s_method = "automatic" ElSE s_method = "semiauto" ENDIF i_return_value = xy_axis_assign_method_set ( s_axis_name, s_method ) dump i_return_value dump s_method

Main Index

@ @ @

Chapter 7: XY Plot Functions 1175 Modify Action

#--------------------------------------------------------------------# Reset the value. s_method = "" #--------------------------------------------------------------------# Get the labels assignment method. i_return_value = @ xy_axis_assign_method_get @ ( s_axis_name, @ s_method ) dump i_return_value dump s_method #---------------------------------------------------------------------

xy_axis_color_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_color_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the color # of the x axis. Finally it sets the color # 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 xy_axis_color_get() # has the following arguments: # # xy_axis_color_get # ( axis_name, # color_index ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] INTEGER i_color_index INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location,

Main Index

@ @ @ @ @

1176 PCL Reference Manual Examples Modify Action

r_width, r_height ) dump i_return_value

@

# Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value

@ @ @

# Get the axis color. i_return_value = @ xy_axis_color_get @ ( s_axis_name, @ i_color_index ) dump i_return_value dump i_color_index #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the axis color. IF( i_color_index == 2 ) THEN i_color_index = 3 ELSE i_color_index = 2 ENDIF i_return_value = xy_axis_color_set ( s_axis_name, i_color_index ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_color_index = 0 #--------------------------------------------------------------------# Get the axis color. i_return_value = @ xy_axis_color_get @ ( s_axis_name, @ i_color_index ) dump i_return_value dump i_color_index #---------------------------------------------------------------------

()

xy_axis_color_set # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_axis_color_set() This file opens a new database "new.db" and creates a window. Later it gets the color of the x axis. Finally it sets the color 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

Chapter 7: XY Plot Functions 1177 Modify Action

# menus on the menu bar. # # The function xy_axis_color_set() # has the following arguments: # # xy_axis_color_set # ( axis_name, # color_index ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] INTEGER i_color_index INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value # Get the axis color. i_return_value = xy_axis_color_get ( s_axis_name, i_color_index ) dump i_return_value dump i_color_index

@ @ @ @ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the axis color. IF( i_color_index == 2 ) THEN i_color_index = 3 ELSE i_color_index = 2

Main Index

1178 PCL Reference Manual Examples Modify Action

ENDIF i_return_value = xy_axis_color_set ( s_axis_name, i_color_index ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_color_index = 0 #--------------------------------------------------------------------# Get the axis color. i_return_value = @ xy_axis_color_get @ ( s_axis_name, @ i_color_index ) dump i_return_value dump i_color_index #---------------------------------------------------------------------

xy_axis_display_labels_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_display_labels_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the display # label flag. Finally it changes the display # flag 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 xy_axis_display_labels_get() # has the following arguments: # # xy_axis_display_labels_get # ( axis_name, # label_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag LOGICAL l_label_flag_c STRING s_axis_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5

Main Index

Chapter 7: XY Plot Functions 1179 Modify Action

r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Get the display label flag. s_axis_name = "X1" i_return_value = @ xy_axis_display_labels_get @ ( s_axis_name, @ l_label_flag ) dump i_return_value dump l_label_flag #--------------------------------------------------------------------# Session file paused press ’Resume’ to continue sf_pause() #--------------------------------------------------------------------# Set the display label flags. IF( l_label_flag = TRUE ) THEN l_label_flag = FALSE ELSE l_label_flag = TRUE ENDIF i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value l_label_flag = TRUE #--------------------------------------------------------------------# Get the display label flag. i_return_value = @ xy_axis_display_labels_get @ ( s_axis_name, @ l_label_flag_c ) dump i_return_value dump l_label_flag_c #---------------------------------------------------------------------

()

xy_axis_display_labels_set # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_axis_display_labels_set() This file opens a new database "new.db" and creates a window. Later it gets the display label flag. Finally it changes the display flag 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.

1180 PCL Reference Manual Examples Modify Action

# # The function xy_axis_display_labels_set() # has the following arguments: # # xy_axis_display_labels_set # ( axis_name, # label_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag LOGICAL l_label_flag_c STRING s_axis_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Get the display label flag. s_axis_name = "X1" i_return_value = @ xy_axis_display_labels_get @ ( s_axis_name, @ l_label_flag ) dump i_return_value dump l_label_flag #--------------------------------------------------------------------# Session file paused press ’Resume’ to continue sf_pause() #--------------------------------------------------------------------# Set the display label flags. IF( l_label_flag = TRUE ) THEN l_label_flag = FALSE ELSE l_label_flag = TRUE ENDIF i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value l_label_flag_c = TRUE

Main Index

Chapter 7: XY Plot Functions 1181 Modify Action

#--------------------------------------------------------------------# Get the display label flag. i_return_value = @ xy_axis_display_labels_get @ ( s_axis_name, @ l_label_flag_c ) dump i_return_value dump l_label_flag_c #---------------------------------------------------------------------

xy_axis_display_title_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_display_title_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the title # display flag. Finally it sets the title # display flag 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 xy_axis_display_title_get() # has the following arguments: # # xy_axis_display_title_get # ( axis_name, # title_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] LOGICAL l_title_flag LOGICAL l_title_flag_c INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

Main Index

@ @ @ @ @ @

1182 PCL Reference Manual Examples Modify Action

# Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value

@ @ @

# Get the display title flag. i_return_value = xy_axis_display_title_get ( s_axis_name, l_title_flag ) dump i_return_value dump l_title_flag

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display title flag. IF( l_title_flag == TRUE ) THEN l_title_flag = FALSE ELSE l_title_flag = TRUE ENDIF i_return_value = xy_axis_display_title_set ( s_axis_name, l_title_flag ) dump i_return_value

@ @ @

# Get the display title flag. i_return_value = @ xy_axis_display_title_get @ ( s_axis_name, @ l_title_flag_c ) dump i_return_value dump l_title_flag_c #---------------------------------------------------------------------

()

xy_axis_display_title_set # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_axis_display_title_set() This file opens a new database "new.db" and creates a window. Later it gets the title display flag. Finally it sets the title display flag 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 xy_axis_display_title_set() has the following arguments: xy_axis_display_title_set ( axis_name,

Chapter 7: XY Plot Functions 1183 Modify Action

# title_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] LOGICAL l_title_flag LOGICAL l_title_flag_c INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value # Get the display title flag. i_return_value = xy_axis_display_title_get ( s_axis_name, l_title_flag ) dump i_return_value dump l_title_flag

@ @ @ @ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display title flag. IF( l_title_flag == TRUE ) THEN l_title_flag = FALSE ELSE l_title_flag = TRUE ENDIF i_return_value = xy_axis_display_title_set ( s_axis_name,

Main Index

@ @ @

1184 PCL Reference Manual Examples Modify Action

l_title_flag ) dump i_return_value # Get the display title flag. i_return_value = @ xy_axis_display_title_get @ ( s_axis_name, @ l_title_flag_c ) dump i_return_value dump l_title_flag_c #---------------------------------------------------------------------

xy_axis_grid_display_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_grid_display_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the grid # display type. Finally it sets the grid display # type 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 xy_axis_grid_display_get() # has the following arguments: # # xy_axis_grid_display_get # ( axis_name, # grid_type ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows STRING s_axis_name[32] STRING s_grid_type[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

Main Index

@ @ @ @ @ @

Chapter 7: XY Plot Functions 1185 Modify Action

# Get the grid display type. s_axis_name = "X1" i_return_value = xy_axis_grid_display_get ( s_axis_name, s_grid_type ) dump i_return_value dump s_grid_type

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the grid display type. IF( s_grid_type == "None" ) THEN s_grid_type = "primarysecondary" ELSE s_grid_type = "None" ENDIF i_return_value = xy_axis_grid_display_set ( s_axis_name, s_grid_type ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value s_grid_type = "" #--------------------------------------------------------------------# Get the grid display type. i_return_value = @ xy_axis_grid_display_get @ ( s_axis_name, @ s_grid_type ) dump i_return_value dump s_grid_type #---------------------------------------------------------------------

xy_axis_grid_display_set

()

# # Purpose : This file provides an example of a call to the # function xy_axis_grid_display_set() # # This file opens a new database "new.db" and # creates a window. Later it gets the grid # display type. Finally it sets the grid display # type 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 xy_axis_grid_display_set() # has the following arguments: # # xy_axis_grid_display_set # ( axis_name, # grid_type ) # #--------------------------------------------------------------------# Variable Declarations

Main Index

1186 PCL Reference Manual Examples Modify Action

STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows STRING s_axis_name[32] STRING s_grid_type[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Get the grid display type. s_axis_name = "X1" i_return_value = xy_axis_grid_display_get ( s_axis_name, s_grid_type ) dump i_return_value dump s_grid_type

@ @ @ @ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the grid display type. IF( s_grid_type == "None" ) THEN s_grid_type = "primarysecondary" ELSE s_grid_type = "None" ENDIF i_return_value = xy_axis_grid_display_set ( s_axis_name, s_grid_type ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value s_grid_type = "" #--------------------------------------------------------------------# Get the grid display type. i_return_value = xy_axis_grid_display_get ( s_axis_name, s_grid_type ) dump i_return_value dump s_grid_type

Main Index

@ @ @

Chapter 7: XY Plot Functions 1187 Modify Action

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

xy_axis_grid_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_grid_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the gridline # attributes. Finally it sets the gridline # attributes 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 xy_axis_grid_get() # has the following arguments: # # xy_axis_grid_get # ( axis_name, # prim_sec, # curvestyle, # thickness, # color_index ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows STRING s_axis_name[32] STRING s_prim_sec[32] STRING s_grid_type[32] STRING s_curvestyle[32] INTEGER i_thickness INTEGER i_color_index INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the grid display type. s_axis_name = "X1" s_grid_type = "PrimarySecondary"

Main Index

@ @ @ @ @ @

1188 PCL Reference Manual Examples Modify Action

i_return_value = xy_axis_grid_display_set ( s_axis_name, s_grid_type ) dump i_return_value # Get the grid line attributes. s_prim_sec = "primary" i_return_value = xy_axis_grid_get ( s_axis_name, s_prim_sec, s_curvestyle, i_thickness, i_color_index ) dump i_return_value dump s_curvestyle dump i_thickness dump i_color_index

@ @ @

@ @ @ @ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the grid line attributes. IF ( s_curvestyle == "Dotted" ) THEN s_curvestyle = "Solid" ELSE s_curvestyle = "Dotted" ENDIF IF ( i_thickness == 6 ) THEN i_thickness = 2 ELSE i_thickness = 6 ENDIF IF ( i_color_index == 2 ) THEN i_color_index = 3 ELSE i_color_index = 2 ENDIF i_return_value = xy_axis_grid_set ( s_axis_name, s_prim_sec, s_curvestyle, i_thickness, i_color_index ) dump i_return_value

@ @ @ @ @ @

#--------------------------------------------------------------------# Reset the value. s_curvestyle = "" i_thickness = 0 i_color_index = 0 #--------------------------------------------------------------------# Get the grid line attributes. i_return_value = xy_axis_grid_get ( s_axis_name, s_prim_sec, s_curvestyle, i_thickness, i_color_index ) dump i_return_value

Main Index

@ @ @ @ @ @

Chapter 7: XY Plot Functions 1189 Modify Action

dump s_curvestyle dump i_thickness dump i_color_index #---------------------------------------------------------------------

xy_axis_grid_set

()

# # Purpose : This file provides an example of a call to the # function xy_axis_grid_set() # # This file opens a new database "new.db" and # creates a window. Later it gets the gridline # attributes. Finally it sets the gridline # attributes 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 xy_axis_grid_set() # has the following arguments: # # xy_axis_grid_set # ( axis_name, # prim_sec, # curvestyle, # thickness, # color_index ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows STRING s_axis_name[32] STRING s_prim_sec[32] STRING s_grid_type[32] STRING s_curvestyle[32] INTEGER i_thickness INTEGER i_color_index INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

Main Index

@ @ @ @ @ @

1190 PCL Reference Manual Examples Modify Action

# Set the grid display type. s_axis_name = "X1" s_grid_type = "PrimarySecondary" i_return_value = xy_axis_grid_display_set ( s_axis_name, s_grid_type ) dump i_return_value # Get the grid line attributes. s_prim_sec = "primary" i_return_value = xy_axis_grid_get ( s_axis_name, s_prim_sec, s_curvestyle, i_thickness, i_color_index ) dump i_return_value dump s_curvestyle dump i_thickness dump i_color_index

@ @ @

@ @ @ @ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the grid line attributes. IF ( s_curvestyle == "Dotted" ) THEN s_curvestyle = "Solid" ELSE s_curvestyle = "Dotted" ENDIF IF ( i_thickness == 6 ) THEN i_thickness = 2 ELSE i_thickness = 6 ENDIF IF ( i_color_index == 2 ) THEN i_color_index = 3 ELSE i_color_index = 2 ENDIF i_return_value = xy_axis_grid_set ( s_axis_name, s_prim_sec, s_curvestyle, i_thickness, i_color_index ) dump i_return_value

@ @ @ @ @ @

#--------------------------------------------------------------------# Reset the value. s_curvestyle = "" i_thickness = 0 i_color_index = 0 #--------------------------------------------------------------------# Get the grid line attributes. i_return_value = xy_axis_grid_get ( s_axis_name, s_prim_sec, s_curvestyle,

Main Index

@ @ @ @ @

Chapter 7: XY Plot Functions 1191 Modify Action

i_thickness, @ i_color_index ) dump i_return_value dump s_curvestyle dump i_thickness dump i_color_index #---------------------------------------------------------------------

xy_axis_label_color_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_label_color_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the color # of the label for a specified axis. Finally # it sets the color of the label 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 xy_axis_label_color_get() # has the following arguments: # # xy_axis_label_color_get # ( axis_name, # label_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] INTEGER i_label_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE

Main Index

@ @ @ @ @ @

1192 PCL Reference Manual Examples Modify Action

i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value

@ @ @

# Get the label color. i_return_value = xy_axis_label_color_get ( s_axis_name, i_label_color ) dump i_return_value dump i_label_color

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the label color. IF ( i_label_color == 7 )THEN i_label_color = 3 ELSE i_label_color = 2 ENDIF i_return_value = xy_axis_label_color_set ( s_axis_name, i_label_color ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_label_color = 0 #--------------------------------------------------------------------# Get the label color. i_return_value = @ xy_axis_label_color_get @ ( s_axis_name, @ i_label_color ) dump i_return_value dump i_label_color #---------------------------------------------------------------------

()

xy_axis_label_color_set # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_axis_label_color_set() This file opens a new database "new.db" and creates a window. Later it gets the color of the label for a specified axis. Finally it sets the color of the label 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 xy_axis_label_color_set() has the following arguments: xy_axis_label_color_set

Chapter 7: XY Plot Functions 1193 Modify Action

# ( axis_name, # label_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] INTEGER i_label_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value # Get the label color. i_return_value = xy_axis_label_color_get ( s_axis_name, i_label_color ) dump i_return_value dump i_label_color

@ @ @ @ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the label color. IF ( i_label_color == 2 )THEN i_label_color = 3 ELSE i_label_color = 2 ENDIF i_return_value = xy_axis_label_color_set ( s_axis_name,

Main Index

@ @ @

1194 PCL Reference Manual Examples Modify Action

i_label_color ) dump i_return_value # Reset the value. i_label_color = 0 # Get the label color. i_return_value = @ xy_axis_label_color_get @ ( s_axis_name, @ i_label_color ) dump i_return_value dump i_label_color #---------------------------------------------------------------------

xy_axis_label_format_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_label_format_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the label # format for a specified axis. Finally it sets # the label format 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 xy_axis_label_format_get() # has the following arguments: # # xy_axis_label_format_get # ( axis_name, # label_format ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] STRING s_label_format[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location,

Main Index

@ @ @ @ @

Chapter 7: XY Plot Functions 1195 Modify Action

r_width, r_height ) dump i_return_value

@

# Set the display label flags. s_axis_name = "Y1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value

@ @ @

# Get the label format. i_return_value = xy_axis_label_format_get ( s_axis_name, s_label_format ) dump i_return_value dump s_label_format

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the label format. IF ( s_label_format == "fixed" ) THEN s_label_format = "exponential" ELSE s_label_format = "fixed" ENDIF i_return_value = xy_axis_label_format_set ( s_axis_name, s_label_format ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. s_label_format = "" #--------------------------------------------------------------------# Get the label format. i_return_value = @ xy_axis_label_format_get @ ( s_axis_name, @ s_label_format ) dump i_return_value dump s_label_format #---------------------------------------------------------------------

()

xy_axis_label_format_set # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_axis_label_format_set() This file opens a new database "new.db" and creates a window. Later it gets the label format for a specified axis. Finally it sets the label format and gets it. This file can be run by starting a session of Patran, and running this session file

1196 PCL Reference Manual Examples Modify Action

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function xy_axis_label_format_set() # has the following arguments: # # xy_axis_label_format_set # ( axis_name, # label_format ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] STRING s_label_format[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "Y1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value # Get the label format. i_return_value = xy_axis_label_format_get ( s_axis_name, s_label_format ) dump i_return_value dump s_label_format

@ @ @ @ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the label format. IF ( s_label_format == "fixed" ) THEN s_label_format = "exponential" ELSE

Main Index

Chapter 7: XY Plot Functions 1197 Modify Action

s_label_format ENDIF

= "fixed"

i_return_value = xy_axis_label_format_set ( s_axis_name, s_label_format ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. s_label_format = "" #--------------------------------------------------------------------# Get the label format. i_return_value = @ xy_axis_label_format_get @ ( s_axis_name, @ s_label_format ) dump i_return_value dump s_label_format #---------------------------------------------------------------------

xy_axis_label_type_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_label_type_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the axis label # type. Finally it changes the axis label type # 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 xy_axis_label_type_get() # has the following arguments: # # xy_axis_label_type_get # ( axis_name, # label_type ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] STRING s_label_type[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5

Main Index

1198 PCL Reference Manual Examples Modify Action

r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

@ @ @ @ @ @

# Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value

@ @ @

# Get the label type. i_return_value = xy_axis_label_type_get ( s_axis_name, s_label_type ) dump i_return_value dump s_label_type

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the label type. IF ( s_label_type == "linear" ) THEN s_label_type = "logarithmic" ELSE s_label_type = "linear" ENDIF i_return_value = xy_axis_label_type_set ( s_axis_name, s_label_type ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. s_label_type = "" #--------------------------------------------------------------------# Get the label type. i_return_value = @ xy_axis_label_type_get @ ( s_axis_name, @ s_label_type ) dump i_return_value dump s_label_type #---------------------------------------------------------------------

()

xy_axis_label_type_set # # # #

Main Index

Purpose

:

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

Chapter 7: XY Plot Functions 1199 Modify Action

# This file opens a new database "new.db" and # creates a window. Later it gets the axis label # type. Finally it changes the axis label type # 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 xy_axis_label_type_set() # has the following arguments: # # xy_axis_label_type_set # ( axis_name, # label_type ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] STRING s_label_type[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value # Get the label type. i_return_value = xy_axis_label_type_get ( s_axis_name, s_label_type ) dump i_return_value dump s_label_type

@ @ @ @ @ @

@ @ @

@ @ @

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

Main Index

1200 PCL Reference Manual Examples Modify Action

sf_pause() #--------------------------------------------------------------------# Set the label type. IF ( s_label_type == "linear" ) THEN s_label_type = "logarithmic" ELSE s_label_type = "linear" ENDIF i_return_value = xy_axis_label_type_set ( s_axis_name, s_label_type ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. s_label_type = "" #--------------------------------------------------------------------# Get the label type. i_return_value = @ xy_axis_label_type_get @ ( s_axis_name, @ s_label_type ) dump i_return_value dump s_label_type #---------------------------------------------------------------------

xy_axis_labels_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_labels_get() # # This file opens a new database "new.db" and # creates a window. Later it sets the labels # assignment method to "range" and gets the # labels. Finally it sets the labels 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 xy_axis_labels_get() # has the following arguments: # # xy_axis_labels_get # ( axis_name, # labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_method[32] STRING s_axis_name[32] REAL ra_labels(2) INTEGER i_return_value #---------------------------------------------------------------------

Main Index

Chapter 7: XY Plot Functions 1201 Modify Action

# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value # Set the labels assignment method. s_method = "range" i_return_value = xy_axis_assign_method_set ( s_axis_name, s_method ) dump i_return_value # Get the labels for the X axis. i_return_value = xy_axis_labels_get ( s_axis_name, ra_labels ) dump i_return_value dump ra_labels

@ @ @ @ @ @

@ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the labels ra_labels(1) IF ( ra_labels(2) ra_labels(2) ELSE ra_labels(2) ENDIF

for the X axis. = 1.0 == 10.0 ) THEN = 20.0 = 10.0

i_return_value = xy_axis_labels_set ( s_axis_name, ra_labels ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the Values. ra_labels(1) = 0.0 ra_labels(2) = 0.0 #---------------------------------------------------------------------

Main Index

1202 PCL Reference Manual Examples Modify Action

# Get the labels for the X axis. i_return_value = @ xy_axis_labels_get @ ( s_axis_name, @ ra_labels ) dump i_return_value dump ra_labels #---------------------------------------------------------------------

xy_axis_labels_get_count

()

# # Purpose : This file provides an example of two calls to # the function xy_axis_labels_get_count() # # This file opens a new database "new.db" and # creates a window. Later it sets the labels # assignment method to "range" and gets the # number of labels defined. Finally it sets the # label assignment method to "manual" and gets # the number of defined labels 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 xy_axis_labels_get_count() # has the following arguments: # # xy_axis_labels_get_count # ( axis_name, # nlabels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_axis_name[32] INTEGER i_nlabels INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the display label flags to TRUE s_axis_name = "X1" i_return_value = xy_axis_display_labels_set ( s_axis_name, TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the labels assignment method

Main Index

Chapter 7: XY Plot Functions 1203 Modify Action

i_return_value = xy_axis_assign_method_set ( s_axis_name, "range" ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the number of labels defined for the X axis i_return_value = xy_axis_labels_get_count ( s_axis_name, i_nlabels ) dump i_return_value dump i_nlabels

@ @ @

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

Set the labels assignment method

i_return_value = xy_axis_assign_method_set ( s_axis_name, "manual" ) dump i_return_value

@ @

#--------------------------------------------------------------------# Reset the value. i_nlabels = 0 #--------------------------------------------------------------------# Get the number of labels defined for the X axis i_return_value = xy_axis_labels_get_count ( s_axis_name, i_nlabels ) dump i_return_value dump i_nlabels

@ @ @

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

Main Index

1204 PCL Reference Manual Examples Modify Action

xy_axis_labels_set

()

# # Purpose : This file provides an example of a call to the # function xy_axis_labels_set() # # This file opens a new database "new.db" and # creates a window. Later it sets the labels # assignment method to "range" and gets the # labels. Finally it sets the labels 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 xy_axis_labels_set() # has the following arguments: # # xy_axis_labels_set # ( axis_name, # labels ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_method[32] STRING s_axis_name[32] REAL ra_labels(2) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value

Main Index

@ @ @ @ @ @

@ @ @

Chapter 7: XY Plot Functions 1205 Modify Action

# Set the labels assignment method. s_method = "range" i_return_value = xy_axis_assign_method_set ( s_axis_name, s_method ) dump i_return_value

@ @ @

# Get the labels for the X axis. i_return_value = xy_axis_labels_get ( s_axis_name, ra_labels ) dump i_return_value dump ra_labels

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the labels ra_labels(1) IF ( ra_labels(2) ra_labels(2) ELSE ra_labels(2) ENDIF

for the X axis. = 1.0 == 10.0 ) THEN = 20.0 = 10.0

i_return_value = xy_axis_labels_set ( s_axis_name, ra_labels ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the Values. ra_labels(1) = 0.0 ra_labels(2) = 0.0 #--------------------------------------------------------------------# Get the labels for the X axis. i_return_value = @ xy_axis_labels_get @ ( s_axis_name, @ ra_labels ) dump i_return_value dump ra_labels #---------------------------------------------------------------------

()

xy_axis_linestyle_get # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_axis_linestyle_get() This file opens a new database "new.db" and creates a window. Later it gets the axis curve style. Finally it changes the axis curve style 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.

1206 PCL Reference Manual Examples Modify Action

# The function xy_axis_linestyle_get() # has the following arguments: # # xy_axis_linestyle_get # ( axis_name, # curve_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows STRING s_axis_name[32] STRING s_curve_style[30] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Get the axis curve style. s_axis_name = "X1" i_return_value = xy_axis_linestyle_get ( s_axis_name, s_curve_style ) dump i_return_value dump s_curve_style

@ @ @ @ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the axis curve style. IF ( s_curve_style == "solid" ) THEN s_curve_style = "dotted" ELSE s_curve_style = "solid" ENDIF i_return_value = xy_axis_linestyle_set ( s_axis_name, s_curve_style ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. s_curve_style = ""

Main Index

Chapter 7: XY Plot Functions 1207 Modify Action

#--------------------------------------------------------------------# Get the axis curve style. i_return_value = @ xy_axis_linestyle_get @ ( s_axis_name, @ s_curve_style ) dump i_return_value dump s_curve_style #---------------------------------------------------------------------

xy_axis_linestyle_set

()

# # Purpose : This file provides an example of a call to the # function xy_axis_linestyle_set() # # This file opens a new database "new.db" and # creates a window. Later it gets the axis # curve style. Finally it changes the axis # curve style 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 xy_axis_linestyle_set() # has the following arguments: # # xy_axis_linestyle_set # ( axis_name, # curve_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows STRING s_axis_name[32] STRING s_curve_style[30] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value #

Main Index

Get the axis curve style.

@ @ @ @ @ @

1208 PCL Reference Manual Examples Modify Action

s_axis_name = "X1" i_return_value = xy_axis_linestyle_get ( s_axis_name, s_curve_style ) dump i_return_value dump s_curve_style

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the axis curve style. IF ( s_curve_style == "solid" ) THEN s_curve_style = "dotted" ELSE s_curve_style = "solid" ENDIF i_return_value = xy_axis_linestyle_set ( s_axis_name, s_curve_style ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. s_curve_style = "" #--------------------------------------------------------------------# Get the axis curve style. i_return_value = @ xy_axis_linestyle_get @ ( s_axis_name, @ s_curve_style ) dump i_return_value dump s_curve_style #---------------------------------------------------------------------

xy_axis_location_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_location_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the display # location of the axis. Finally it changes the # display location of the axis 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 xy_axis_location_get() # has the following arguments: # # xy_axis_location_get # ( axis_name, # display_location ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32]

Main Index

Chapter 7: XY Plot Functions 1209 Modify Action

REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows STRING s_axis_name[32] STRING s_display_location[16] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Get the location of the axis. s_axis_name = "X1" i_return_value = xy_axis_location_get ( s_axis_name, s_display_location ) dump i_return_value dump s_display_location

@ @ @ @ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the location of IF( s_display_location s_display_location ELSE s_display_location ENDIF

the axis. == "bottom" ) THEN = "topbottom" = "bottom"

i_return_value = xy_axis_location_set ( s_axis_name, s_display_location ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. s_display_location = "" #--------------------------------------------------------------------# Get the location of the axis. i_return_value = @ xy_axis_location_get @ ( s_axis_name, @ s_display_location ) dump i_return_value dump s_display_location #---------------------------------------------------------------------

Main Index

1210 PCL Reference Manual Examples Modify Action

xy_axis_location_set

()

# # Purpose : This file provides an example of a call to the # function xy_axis_location_set() # # This file opens a new database "new.db" and # creates a window. Later it gets the display # location of the axis. Finally it changes the # display location of the axis 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 xy_axis_location_set() # has the following arguments: # # xy_axis_location_set # ( axis_name, # display_location ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows STRING s_axis_name[32] STRING s_display_location[16] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Get the location of the axis. s_axis_name = "X1" i_return_value = xy_axis_location_get ( s_axis_name, s_display_location ) dump i_return_value dump s_display_location

@ @ @ @ @ @

@ @ @

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

Main Index

Chapter 7: XY Plot Functions 1211 Modify Action

# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the location of IF( s_display_location s_display_location ELSE s_display_location ENDIF

the axis. == "bottom" ) THEN = "topbottom" = "bottom"

i_return_value = xy_axis_location_set ( s_axis_name, s_display_location ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. s_display_location = "" #--------------------------------------------------------------------# Get the location of the axis. i_return_value = @ xy_axis_location_get @ ( s_axis_name, @ s_display_location ) dump i_return_value dump s_display_location #---------------------------------------------------------------------

xy_axis_nvalues_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_nvalues_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the number # of values for the specified axis. Finally # it sets the number of values 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 xy_axis_nvalues_get() # has the following arguments: # # xy_axis_nvalues_get # ( axis_name, # num_vals ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] INTEGER i_num_vals INTEGER i_return_value

Main Index

1212 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "Y1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value

@ @ @ @ @ @

@ @ @

# Get the number of values for the specified axis. i_return_value = @ xy_axis_nvalues_get @ ( s_axis_name, @ i_num_vals ) dump i_return_value dump i_num_vals #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the number of values for the specified axis. IF ( i_num_vals == 7 ) THEN i_num_vals = 12 ELSE i_num_vals = 7 ENDIF i_return_value = xy_axis_nvalues_set ( s_axis_name, i_num_vals ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_num_vals = 0 #--------------------------------------------------------------------# Get the number of values for the specified axis. i_return_value = @ xy_axis_nvalues_get @ ( s_axis_name, @ i_num_vals ) dump i_return_value dump i_num_vals #---------------------------------------------------------------------

Main Index

Chapter 7: XY Plot Functions 1213 Modify Action

xy_axis_nvalues_set

()

# # Purpose : This file provides an example of a call to the # function xy_axis_nvalues_set() # # This file opens a new database "new.db" and # creates a window. Later it gets the number # of values for the specified axis. Finally # it sets the number of values 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 xy_axis_nvalues_set() # has the following arguments: # # xy_axis_nvalues_set # ( axis_name, # num_vals ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] INTEGER i_num_vals INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "Y1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value #

Main Index

@ @ @ @ @ @

@ @ @

Get the number of values for the specified axis.

1214 PCL Reference Manual Examples Modify Action

i_return_value = xy_axis_nvalues_get ( s_axis_name, i_num_vals ) dump i_return_value dump i_num_vals

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the number of values for the specified axis. IF ( i_num_vals == 7 ) THEN i_num_vals = 12 ELSE i_num_vals = 7 ENDIF i_return_value = xy_axis_nvalues_set ( s_axis_name, i_num_vals ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_num_vals = 0 #--------------------------------------------------------------------# Get the number of values for the specified axis. i_return_value = @ xy_axis_nvalues_get @ ( s_axis_name, @ i_num_vals ) dump i_return_value dump i_num_vals #---------------------------------------------------------------------

xy_axis_sig_digits_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_sig_digits_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the number of # significant digits. Finally it sets the number # of significant digits 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 xy_axis_sig_digits_get() # has the following arguments: # # xy_axis_sig_digits_get # ( axis_name, # sig_digits ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location

Main Index

Chapter 7: XY Plot Functions 1215 Modify Action

REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] INTEGER i_sig_digits INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "Y1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value # Get the number of significant digits. i_return_value = xy_axis_sig_digits_get ( s_axis_name, i_sig_digits ) dump i_return_value dump i_sig_digits

@ @ @ @ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the number of significant digits. IF ( i_sig_digits == 3 ) THEN i_sig_digits = 5 ELSE i_sig_digits = 3 ENDIF i_return_value = xy_axis_sig_digits_set ( s_axis_name, i_sig_digits ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_sig_digits = 0 #--------------------------------------------------------------------#

Main Index

Get the number of significant digits.

1216 PCL Reference Manual Examples Modify Action

i_return_value = @ xy_axis_sig_digits_get @ ( s_axis_name, @ i_sig_digits ) dump i_return_value dump i_sig_digits #---------------------------------------------------------------------

xy_axis_sig_digits_set

()

# # Purpose : This file provides an example of a call to the # function xy_axis_sig_digits_set() # # This file opens a new database "new.db" and # creates a window. Later it gets the number of # significant digits. Finally it sets the number # of significant digits 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 xy_axis_sig_digits_set() # has the following arguments: # # xy_axis_sig_digits_set # ( axis_name, # sig_digits ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] INTEGER i_sig_digits INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "Y1" l_label_flag = TRUE

Main Index

@ @ @ @ @ @

Chapter 7: XY Plot Functions 1217 Modify Action

i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value

@ @ @

# Get the number of significant digits. i_return_value = xy_axis_sig_digits_get ( s_axis_name, i_sig_digits ) dump i_return_value dump i_sig_digits

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the number of significant digits. IF ( i_sig_digits == 3 ) THEN i_sig_digits = 5 ELSE i_sig_digits = 3 ENDIF i_return_value = xy_axis_sig_digits_set ( s_axis_name, i_sig_digits ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_sig_digits = 0 #--------------------------------------------------------------------# Get the number of significant digits. i_return_value = @ xy_axis_sig_digits_get @ ( s_axis_name, @ i_sig_digits ) dump i_return_value dump i_sig_digits #---------------------------------------------------------------------

()

xy_axis_thickness_get # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_axis_thickness_get() This file opens a new database "new.db" and creates a window. Later it gets the axis thickness. Finally it sets the axis thickness 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 xy_axis_thickness_get() has the following arguments: xy_axis_thickness_get ( axis_name,

1218 PCL Reference Manual Examples Modify Action

# thickness ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows STRING s_axis_name[32] INTEGER i_thickness INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Get the axis thickness. s_axis_name = "X1" i_return_value = xy_axis_thickness_get ( s_axis_name, i_thickness ) dump i_return_value dump i_thickness

@ @ @ @ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the axis thickness. IF ( i_thickness == 1 ) THEN i_thickness = 5 ELSE i_thickness = 1 ENDIF i_return_value = xy_axis_thickness_set ( s_axis_name, i_thickness ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_thickness = 0 #--------------------------------------------------------------------# Get the axis thickness. i_return_value = xy_axis_thickness_get ( s_axis_name,

Main Index

@ @ @

Chapter 7: XY Plot Functions 1219 Modify Action

i_thickness ) dump i_return_value dump i_thickness #---------------------------------------------------------------------e

xy_axis_thickness_set

()

# # Purpose : This file provides an example of a call to the # function xy_axis_thickness_set() # # This file opens a new database "new.db" and # creates a window. Later it gets the axis # thickness. Finally it sets the axis thickness # 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 xy_axis_thickness_set() # has the following arguments: # # xy_axis_thickness_set # ( axis_name, # thickness ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows STRING s_axis_name[32] INTEGER i_thickness INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Get the axis thickness. s_axis_name = "X1" i_return_value = xy_axis_thickness_get ( s_axis_name, i_thickness ) dump i_return_value

Main Index

@ @ @ @ @ @

@ @ @

1220 PCL Reference Manual Examples Modify Action

dump i_thickness #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the axis thickness. IF ( i_thickness == 1 ) THEN i_thickness = 5 ELSE i_thickness = 1 ENDIF i_return_value = xy_axis_thickness_set ( s_axis_name, i_thickness ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_thickness = 0 #--------------------------------------------------------------------# Get the axis thickness. i_return_value = @ xy_axis_thickness_get @ ( s_axis_name, @ i_thickness ) dump i_return_value dump i_thickness #---------------------------------------------------------------------

xy_axis_tic_display_get

()

# # Purpose : This file provides an example of two calls # to the function xy_axis_tic_display_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the ticmark # display type. Finally it changes the ticmark # display and gets the type 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 xy_axis_tic_display_get() # has the following arguments: # # xy_axis_tic_display_get # ( axis_name, # ticmark_type ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32]

Main Index

Chapter 7: XY Plot Functions 1221 Modify Action

STRING s_ticmark_type[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value # Get the ticmark display type. i_return_value = xy_axis_tic_display_get ( s_axis_name, s_ticmark_type ) dump i_return_value dump s_ticmark_type

@ @ @ @ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the ticmark display type. IF ( s_ticmark_type == "primary" ) THEN s_ticmark_type = "primarysecondary" ELSE s_ticmark_type = "primary" ENDIF i_return_value = xy_axis_tic_display_set ( s_axis_name, s_ticmark_type ) dump i_return_value dump s_ticmark_type

@ @ @

#--------------------------------------------------------------------# Reset the value. s_ticmark_type = "" #--------------------------------------------------------------------# Get the ticmark display type. i_return_value = xy_axis_tic_display_get ( s_axis_name, s_ticmark_type ) dump i_return_value

Main Index

@ @ @

1222 PCL Reference Manual Examples Modify Action

dump s_ticmark_type #---------------------------------------------------------------------

xy_axis_tic_display_set

()

# # Purpose : This file provides an example of a call to the # function xy_axis_tic_display_set() # # This file opens a new database "new.db" and # creates a window. Later it gets the ticmark # display type. Finally it changes the ticmark # display and gets the type 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 xy_axis_tic_display_set() # has the following arguments: # # xy_axis_tic_display_set # ( axis_name, # ticmark_type ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] STRING s_ticmark_type[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value

Main Index

@ @ @ @ @ @

@ @ @

Chapter 7: XY Plot Functions 1223 Modify Action

# Get the ticmark display type. i_return_value = xy_axis_tic_display_get ( s_axis_name, s_ticmark_type ) dump i_return_value dump s_ticmark_type

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the ticmark display type. IF ( s_ticmark_type == "primary" ) THEN s_ticmark_type = "primarysecondary" ELSE s_ticmark_type = "primary" ENDIF i_return_value = xy_axis_tic_display_set ( s_axis_name, s_ticmark_type ) dump i_return_value dump s_ticmark_type

@ @ @

#--------------------------------------------------------------------# Reset the value. s_ticmark_type = "" #--------------------------------------------------------------------# Get the ticmark display type. i_return_value = @ xy_axis_tic_display_get @ ( s_axis_name, @ s_ticmark_type ) dump i_return_value dump s_ticmark_type #---------------------------------------------------------------------

()

xy_axis_tic_get # # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_axis_tic_get() This file opens a new database "new.db" and creates a window. Later it gets the ticmark attributes. Finally it sets the ticmark attributes and gets them 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 xy_axis_tic_get() has the following arguments: xy_axis_tic_get ( axis_name, prim_sec, location, thickness, color_index )

1224 PCL Reference Manual Examples Modify Action

# #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] STRING s_prim_sec[32] STRING s_location[32] INTEGER i_thickness INTEGER i_color_index INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value # Get the ticmark attributes. s_prim_sec = "primary" i_return_value = xy_axis_tic_get ( s_axis_name, s_prim_sec, s_location, i_thickness, i_color_index ) dump i_return_value dump s_location dump i_thickness dump i_color_index

@ @ @ @ @ @

@ @ @

@ @ @ @ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the ticmark attributes. IF ( s_location == "outside" ) THEN s_location = "inside" ELSE

Main Index

Chapter 7: XY Plot Functions 1225 Modify Action

s_location = "outside" ENDIF IF ( i_thickness == 5 ) THEN i_thickness = 1 ELSE i_thickness = 5 ENDIF IF ( i_color_index == 2 ) THEN i_color_index = 1 ELSE i_color_index = 2 ENDIF i_return_value = xy_axis_tic_set ( s_axis_name, s_prim_sec, s_location, i_thickness, i_color_index ) dump i_return_value

@ @ @ @ @ @

#--------------------------------------------------------------------# Reset the value. s_location = "" i_thickness = 0 i_color_index = 0 #--------------------------------------------------------------------# Get the ticmark attributes. i_return_value = @ xy_axis_tic_get @ ( s_axis_name, @ s_prim_sec, @ s_location, @ i_thickness, @ i_color_index ) dump i_return_value dump s_location dump i_thickness dump i_color_index #---------------------------------------------------------------------

xy_axis_tic_numsec_get

()

# # Purpose : This file provides an example of a call to the # function xy_axis_tic_numsec_get() # # This file opens a new database "new.db" and # creates a window. Later it gets the number # of secondary ticmarks. Finally it sets the # number of secondary ticmarks 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 xy_axis_tic_numsec_get() # has the following arguments: # # xy_axis_tic_numsec_get # ( axis_name, # num ) # #---------------------------------------------------------------------

Main Index

1226 PCL Reference Manual Examples Modify Action

# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows STRING s_ticmark_type[32] STRING s_axis_name[32] INTEGER i_num INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the ticmark display type. s_axis_name = "X1" s_ticmark_type = "secondary" i_return_value = xy_axis_tic_display_set ( s_axis_name, s_ticmark_type ) dump i_return_value # Get the number of secondary ticmarks. i_return_value = xy_axis_tic_numsec_get ( s_axis_name, i_num ) dump i_return_value dump i_num

@ @ @ @ @ @

@ @ @

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the number of secondary ticmarks. IF ( i_num == 4 ) THEN i_num = 12 ELSE i_num = 4 ENDIF i_return_value = xy_axis_tic_numsec_set ( s_axis_name, i_num ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_num = 0

Main Index

Chapter 7: XY Plot Functions 1227 Modify Action

#--------------------------------------------------------------------# Get the number of secondary ticmarks. i_return_value = @ xy_axis_tic_numsec_get @ ( s_axis_name, @ i_num ) dump i_return_value dump i_num #---------------------------------------------------------------------

xy_axis_tic_numsec_set

()

# # Purpose : This file provides an example of a call to the # function xy_axis_tic_numsec_set() # # This file opens a new database "new.db" and # creates a window. Later it gets the number # of secondary ticmarks. Finally it sets the # number of secondary ticmarks 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 xy_axis_tic_numsec_set() # has the following arguments: # # xy_axis_tic_numsec_set # ( axis_name, # num ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows STRING s_ticmark_type[32] STRING s_axis_name[32] INTEGER i_num INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value

Main Index

@ @ @ @ @ @

1228 PCL Reference Manual Examples Modify Action

# Set the ticmark display type. s_axis_name = "X1" s_ticmark_type = "secondary" i_return_value = xy_axis_tic_display_set ( s_axis_name, s_ticmark_type ) dump i_return_value

@ @ @

# Get the number of secondary ticmarks. i_return_value = xy_axis_tic_numsec_get ( s_axis_name, i_num ) dump i_return_value dump i_num

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the number of secondary ticmarks. IF ( i_num == 4 ) THEN i_num = 12 ELSE i_num = 4 ENDIF i_return_value = xy_axis_tic_numsec_set ( s_axis_name, i_num ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_num = 0 #--------------------------------------------------------------------# Get the number of secondary ticmarks. i_return_value = @ xy_axis_tic_numsec_get @ ( s_axis_name, @ i_num ) dump i_return_value dump i_num #---------------------------------------------------------------------

()

xy_axis_tic_set # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_axis_tic_set() This file opens a new database "new.db" and creates a window. Later it gets the ticmark attributes. Finally it sets the ticmark attributes and gets them 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 xy_axis_tic_set() has the following arguments:

Chapter 7: XY Plot Functions 1229 Modify Action

# # xy_axis_tic_set # ( axis_name, # prim_sec, # location, # thickness, # color_index ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] REAL r_x_location REAL r_y_location REAL r_width REAL r_height INTEGER i_nwindows LOGICAL l_label_flag STRING s_axis_name[32] STRING s_prim_sec[32] STRING s_location[32] INTEGER i_thickness INTEGER i_color_index INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display label flags. s_axis_name = "X1" l_label_flag = TRUE i_return_value = xy_axis_display_labels_set ( s_axis_name, l_label_flag ) dump i_return_value # Get the ticmark attributes. s_prim_sec = "primary" i_return_value = xy_axis_tic_get ( s_axis_name, s_prim_sec, s_location, i_thickness, i_color_index ) dump i_return_value dump s_location dump i_thickness dump i_color_index

@ @ @ @ @ @

@ @ @

@ @ @ @ @ @

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

Main Index

1230 PCL Reference Manual Examples Modify Action

sf_pause() #--------------------------------------------------------------------# Set the ticmark attributes. IF ( s_location == "outside" ) THEN s_location = "inside" ELSE s_location = "outside" ENDIF IF ( i_thickness == 4 ) THEN i_thickness = 1 ELSE i_thickness = 4 ENDIF IF ( i_color_index == 2 ) THEN i_color_index = 1 ELSE i_color_index = 2 ENDIF i_return_value = xy_axis_tic_set ( s_axis_name, s_prim_sec, s_location, i_thickness, i_color_index ) dump i_return_value

@ @ @ @ @ @

#--------------------------------------------------------------------# Reset the value. s_location = "" i_thickness = 0 i_color_index = 0 #--------------------------------------------------------------------# Get the ticmark attributes. i_return_value = xy_axis_tic_get ( s_axis_name, s_prim_sec, s_location, i_thickness, i_color_index ) dump i_return_value dump s_location dump i_thickness dump i_color_index

@ @ @ @ @ @

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

()

xy_axis_title_get # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_axis_title_get() This file opens a new database "new.db" and creates a window. Later it gets the title attributes for a specified axis. finally it sets the title attributes 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.

Chapter 7: XY Plot Functions 1231 Modify Action

# The function xy_axis_title_get() # has the following arguments: # # xy_axis_title_get # ( axis_name, # title, # font_size, # title_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_axis_name[32] STRING s_title[256] INTEGER i_font_size INTEGER i_title_color INTEGER i_return_value STRING s_window_name[32] LOGICAL l_axis_title_flag REAL r_x_location REAL r_y_location REAL r_width REAL r_height #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a xy window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display flag for axis title. s_axis_name = "X1" l_axis_title_flag = TRUE i_return_value = xy_axis_display_title_set ( s_axis_name, l_axis_title_flag ) dump i_return_value # Get the title attributes. i_return_value = xy_axis_title_get ( s_axis_name, s_title, i_font_size, i_title_color ) dump i_return_value dump s_title dump i_font_size dump i_title_color

@ @ @ @ @ @

@ @ @

@ @ @ @ @

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

Main Index

1232 PCL Reference Manual Examples Modify Action

# Set the title attributes. s_title = "Pressure" IF

( i_font_size == 8 ) THEN i_font_size = 12 ELSE i_font_size = 8 ENDIF IF ( i_title_color == 7 ) THEN i_title_color = 1 ELSE i_title_color = 7 ENDIF i_return_value = xy_axis_title_set ( s_axis_name, s_title, i_font_size, i_title_color ) dump i_return_value

@ @ @ @ @

#--------------------------------------------------------------------# Reset the value. i_font_size = 0 i_title_color = 0 #--------------------------------------------------------------------# Get the title attributes. i_return_value = @ xy_axis_title_get @ ( s_axis_name, @ s_title, @ i_font_size, @ i_title_color ) dump i_return_value dump s_title dump i_font_size dump i_title_color #---------------------------------------------------------------------

()

xy_axis_title_set # # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_axis_title_set() This file opens a new database "new.db" and creates a window. Later it gets the title attributes for a specified axis. finally it sets the title attributes 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 xy_axis_title_set() has the following arguments: xy_axis_title_set ( axis_name, title, font_size, title_color )

Chapter 7: XY Plot Functions 1233 Modify Action

# #--------------------------------------------------------------------# Variable Declarations STRING s_axis_name[32] STRING s_title[256] INTEGER i_font_size INTEGER i_title_color INTEGER i_return_value STRING s_window_name[32] LOGICAL l_axis_title_flag REAL r_x_location REAL r_y_location REAL r_width REAL r_height #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a xy window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width, r_height ) dump i_return_value # Set the display flag for axis title. s_axis_name = "X1" l_axis_title_flag = TRUE i_return_value = xy_axis_display_title_set ( s_axis_name, l_axis_title_flag ) dump i_return_value # Get the title attributes. i_return_value = xy_axis_title_get ( s_axis_name, s_title, i_font_size, i_title_color ) dump i_return_value dump s_title dump i_font_size dump i_title_color

@ @ @ @ @ @

@ @ @

@ @ @ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the title attributes. s_title = "Pressure" IF

( i_font_size == 8 ) THEN i_font_size = 12 ELSE i_font_size = 8 ENDIF

Main Index

1234 PCL Reference Manual Examples Modify Action

IF ( i_title_color == 7 ) THEN i_title_color = 1 ELSE i_title_color = 7 ENDIF i_return_value = xy_axis_title_set ( s_axis_name, s_title, i_font_size, i_title_color ) dump i_return_value

@ @ @ @ @

#--------------------------------------------------------------------# Reset the value. i_font_size = 0 i_title_color = 0 #--------------------------------------------------------------------# Get the title attributes. i_return_value = @ xy_axis_title_get @ ( s_axis_name, @ s_title, @ i_font_size, @ i_title_color ) dump i_return_value dump s_title dump i_font_size dump i_title_color #---------------------------------------------------------------------

xy_curve_color_get

()

# # Purpose : This file provides an example of two calls to # the function xy_curve_color_get() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the color of the curve. Finally it sets # the color 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 xy_curve_color_get() # has the following arguments: # # xy_curve_color_get # ( curve_name, # color_index ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_color_index INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db"

Main Index

Chapter 7: XY Plot Functions 1235 Modify Action

uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_color_index

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_color_index ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the curve color. i_return_value = xy_curve_color_get ( s_curve_name, i_color_index ) dump i_return_value dump i_color_index

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the curve color. i_color_index = 2 i_return_value = xy_curve_color_set ( s_curve_name, i_color_index ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_color_index = 0 #--------------------------------------------------------------------# Get the curve color. i_return_value = xy_curve_color_get

Main Index

@ @

1236 PCL Reference Manual Examples Modify Action

(

s_curve_name, i_color_index ) dump i_return_value dump i_color_index

@

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

()

xy_curve_color_set

# # Purpose : This file provides an example of a call to the # function xy_curve_color_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the color of the curve. Finally it sets # the color 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 xy_curve_color_set() # has the following arguments: # # xy_curve_color_set # ( curve_name, # color_index ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_color_index INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_color_index

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_color_index ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve

Main Index

Chapter 7: XY Plot Functions 1237 Modify Action

i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the curve color. i_return_value = xy_curve_color_get ( s_curve_name, i_color_index ) dump i_return_value dump i_color_index

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the curve color. i_color_index = 2 i_return_value = xy_curve_color_set ( s_curve_name, i_color_index ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_color_index = 0 #--------------------------------------------------------------------# Get the curve color. i_return_value = xy_curve_color_get ( s_curve_name, i_color_index ) dump i_return_value dump i_color_index

@ @ @

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

()

xy_curve_display_symbol_get # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_curve_display_symbol_get() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the display symbol flag for the curve. Finally it sets the display symbol flag 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 xy_curve_display_symbol_get()

1238 PCL Reference Manual Examples Modify Action

# has the following arguments: # # xy_curve_display_symbol_get # ( curve_name, # symbol_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color LOGICAL l_symbol_flag INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the display symbol flag # i_return_value = @ xy_curve_display_symbol_get @ ( s_curve_name, @ l_symbol_flag ) dump i_return_value dump l_symbol_flag #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display symbol flag

Main Index

Chapter 7: XY Plot Functions 1239 Modify Action

IF( l_symbol_flag == TRUE ) THEN l_symbol_flag = FALSE ELSE l_symbol_flag = TRUE ENDIF i_return_value = xy_curve_display_symbol_set ( s_curve_name, l_symbol_flag ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Get the display symbol flag # i_return_value = @ xy_curve_display_symbol_get @ ( s_curve_name, @ l_symbol_flag ) dump i_return_value dump l_symbol_flag #---------------------------------------------------------------------

xy_curve_display_symbol_set

()

# # Purpose : This file provides an example of a call to the # function xy_curve_display_symbol_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the display symbol flag for the curve. # Finally it sets the display symbol flag 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 xy_curve_display_symbol_set() # has the following arguments: # # xy_curve_display_symbol_set # ( curve_name, # symbol_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color LOGICAL l_symbol_flag INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create

Main Index

@ @

1240 PCL Reference Manual Examples Modify Action

( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value #--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the display symbol flag # i_return_value = @ xy_curve_display_symbol_get @ ( s_curve_name, @ l_symbol_flag ) dump i_return_value dump l_symbol_flag #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display symbol flag IF( l_symbol_flag == TRUE ) THEN l_symbol_flag = FALSE ELSE l_symbol_flag = TRUE ENDIF i_return_value = xy_curve_display_symbol_set ( s_curve_name, l_symbol_flag ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Get the display symbol flag # i_return_value = @ xy_curve_display_symbol_get @ ( s_curve_name, @ l_symbol_flag ) dump i_return_value dump l_symbol_flag #---------------------------------------------------------------------

Main Index

Chapter 7: XY Plot Functions 1241 Modify Action

()

xy_curve_endpt_get

# # Purpose : This file provides an example of two calls to # the function xy_curve_endpt_get() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the last data point to be displayed in the # curve. Finally it sets the last data point to # be displayed 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 xy_curve_endpt_get() # has the following arguments: # # xy_curve_endpt_get # ( curve_name, # end_point ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_end_point INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5,

Main Index

@ @ @

1242 PCL Reference Manual Examples Modify Action

[1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] dump i_return_value

@ )

#--------------------------------------------------------------------# Get the last data point to be displayed in the curve i_return_value = xy_curve_endpt_get ( s_curve_name, i_end_point ) dump i_return_value dump i_end_point

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the last data point to be displayed IF ( i_end_point == 4 ) THEN i_end_point = 5 ELSE i_end_point = 4 ENDIF i_return_value = xy_curve_endpt_set ( s_curve_name, i_end_point ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_end_point = 0 #--------------------------------------------------------------------# Get the last data point to be displayed i_return_value = xy_curve_endpt_get ( s_curve_name, i_end_point ) dump i_return_value dump i_end_point

@ @ @

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

()

xy_curve_endpt_set # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_curve_endpt_set() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the last data point to be displayed in the curve. Finally it sets the last data point to be displayed 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 xy_curve_endpt_set()

Chapter 7: XY Plot Functions 1243 Modify Action

# has the following arguments: # # xy_curve_endpt_set # ( curve_name, # end_point ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_end_point INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the last data point to be displayed in the curve i_return_value = xy_curve_endpt_get ( s_curve_name, i_end_point ) dump i_return_value dump i_end_point

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the last data point to be displayed IF ( i_end_point == 4 ) THEN

Main Index

1244 PCL Reference Manual Examples Modify Action

i_end_point = 5 ELSE i_end_point = 4 ENDIF i_return_value = xy_curve_endpt_set ( s_curve_name, i_end_point ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_end_point = 0 #--------------------------------------------------------------------# Get the last data point to be displayed i_return_value = xy_curve_endpt_get ( s_curve_name, i_end_point ) dump i_return_value dump i_end_point

@ @ @

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

xy_curve_freq_get

()

# # Purpose : This file provides an example of two calls to # the function xy_curve_freq_get() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the frequency of data points for the curve # Finally it sets the frequency 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 xy_curve_freq_get() # has the following arguments: # # xy_curve_freq_get # ( curve_name, # frequency ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_frequency INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window

Main Index

Chapter 7: XY Plot Functions 1245 Modify Action

i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 6., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the frequency of data points for the curve i_return_value = xy_curve_freq_get ( s_curve_name, i_frequency ) dump i_return_value dump i_frequency

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the frequency of data points IF ( i_frequency == 2 ) THEN i_frequency = 1 ELSE i_frequency = 2 ENDIF i_return_value = xy_curve_freq_set ( s_curve_name, i_frequency ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_frequency = 0 #--------------------------------------------------------------------# Get the frequency of data points i_return_value = xy_curve_freq_get ( s_curve_name, i_frequency )

Main Index

@ @ @

1246 PCL Reference Manual Examples Modify Action

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

()

xy_curve_freq_set

# # Purpose : This file provides an example of a call to the # function xy_curve_freq_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the frequency of data points for the curve # Finally it sets the frequency 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 xy_curve_freq_set() # has the following arguments: # # xy_curve_freq_set # ( curve_name, # frequency ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_frequency INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve

Main Index

Chapter 7: XY Plot Functions 1247 Modify Action

i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 6., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the frequency of data points for the curve i_return_value = xy_curve_freq_get ( s_curve_name, i_frequency ) dump i_return_value dump i_frequency

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the frequency of data points IF ( i_frequency == 2 ) THEN i_frequency = 1 ELSE i_frequency = 2 ENDIF i_return_value = xy_curve_freq_set ( s_curve_name, i_frequency ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_frequency = 0 #--------------------------------------------------------------------# Get the frequency of data points i_return_value = xy_curve_freq_get ( s_curve_name, i_frequency ) dump i_return_value dump i_frequency

@ @ @

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

()

xy_curve_func_get # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_curve_func_get() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the curve fit function. Finally it sets the curve fit function 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.

1248 PCL Reference Manual Examples Modify Action

# # The function xy_curve_func_get() # has the following arguments: # # xy_curve_func_get # ( curve_name, # func ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] STRING s_func[30] INTEGER i_text_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the curve fit function # i_return_value = @ xy_curve_func_get @ ( s_curve_name, @ s_func ) dump i_return_value dump s_func #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #---------------------------------------------------------------------

Main Index

Chapter 7: XY Plot Functions 1249 Modify Action

#

Set the curve fit function

IF( s_func == "Linear" ) THEN s_func = "Spline" ELSE s_func = "Linear" ENDIF i_return_value = xy_curve_func_set ( s_curve_name, s_func ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value s_func = "" #--------------------------------------------------------------------# Get the curve fit function # i_return_value = @ xy_curve_func_get @ ( s_curve_name, @ s_func ) dump i_return_value dump s_func #---------------------------------------------------------------------

xy_curve_func_set

()

# # Purpose : This file provides an example of a call to the # function xy_curve_func_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the curve fit function. Finally it sets # the curve fit function 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 xy_curve_func_set() # has the following arguments: # # xy_curve_func_set # ( curve_name, # func ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] STRING s_func[30] INTEGER i_text_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

1250 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the curve fit function # i_return_value = @ xy_curve_func_get @ ( s_curve_name, @ s_func ) dump i_return_value dump s_func #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the curve fit function IF( s_func == "Linear" ) THEN s_func = "Spline" ELSE s_func = "Linear" ENDIF i_return_value = xy_curve_func_set ( s_curve_name, s_func ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value s_func = "" #--------------------------------------------------------------------# Get the curve fit function #

Main Index

Chapter 7: XY Plot Functions 1251 Modify Action

i_return_value = xy_curve_func_get ( s_curve_name, s_func ) dump i_return_value dump s_func

@ @ @

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

()

xy_curve_linestyle_get

# # Purpose : This file provides an example of two calls to # the function xy_curve_linestyle_get() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the linestyle for the curve. Finally it # sets the linestyle 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 xy_curve_linestyle_get() # has the following arguments: # # xy_curve_linestyle_get # ( curve_name, # curve_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] STRING s_curve_style[32] INTEGER i_text_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

Main Index

@ @ @ @

1252 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the linestyle for the curve # i_return_value = @ xy_curve_linestyle_get @ ( s_curve_name, @ s_curve_style ) dump i_return_value dump s_curve_style #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the linestyle for the curve IF( s_curve_style == "Solid" ) THEN s_curve_style = "Dotted" ELSE s_curve_style = "Solid" ENDIF i_return_value = xy_curve_linestyle_set ( s_curve_name, s_curve_style dump i_return_value

@ @ @ )

#--------------------------------------------------------------------# Reset the value s_curve_style = "" #--------------------------------------------------------------------# Get the linestyle for the curve # i_return_value = @ xy_curve_linestyle_get @ ( s_curve_name, @ s_curve_style ) dump i_return_value dump s_curve_style #---------------------------------------------------------------------

()

xy_curve_linestyle_set # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_curve_linestyle_set() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the linestyle for the curve. Finally it sets the linestyle and gets it again.

Chapter 7: XY Plot Functions 1253 Modify Action

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function xy_curve_linestyle_set() # has the following arguments: # # xy_curve_linestyle_set # ( curve_name, # curve_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] STRING s_curve_style[32] INTEGER i_text_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the linestyle for the curve # i_return_value = @ xy_curve_linestyle_get @ ( s_curve_name, @ s_curve_style ) dump i_return_value dump s_curve_style

Main Index

1254 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the linestyle for the curve IF( s_curve_style == "Solid" ) THEN s_curve_style = "Dotted" ELSE s_curve_style = "Solid" ENDIF i_return_value = xy_curve_linestyle_set ( s_curve_name, s_curve_style dump i_return_value

@ @ @ )

#--------------------------------------------------------------------# Reset the value s_curve_style = "" #--------------------------------------------------------------------# Get the linestyle for the curve # i_return_value = @ xy_curve_linestyle_get @ ( s_curve_name, @ s_curve_style ) dump i_return_value dump s_curve_style #---------------------------------------------------------------------

xy_curve_nlppc_get

()

# # Purpose : This file provides an example of two calls to # the function xy_curve_nlppc_get() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the number of curves per parametric cubic # for the curve. Finally it sets the number of # curves per parametric cubic 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 xy_curve_nlppc_get() # has the following arguments: # # xy_curve_nlppc_get # ( curve_name, # value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] STRING s_func[30] INTEGER i_text_color INTEGER i_value

Main Index

Chapter 7: XY Plot Functions 1255 Modify Action

INTEGER

i_return_value

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the curve fit function s_func = "LeastSquares" i_return_value = xy_curve_func_set ( s_curve_name, s_func ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Set the number of parametric cubic curves for more prominent change # in the XY window i_return_value = @ xy_curve_num_pc_set @ ( s_curve_name, 4 ) dump i_return_value #--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the number of curves per parametric cubic i_return_value = xy_curve_nlppc_get ( s_curve_name, i_value ) dump i_return_value dump i_value

Main Index

@ @ @

1256 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the number of curves per parametric cubic IF ( i_value < 3 ) THEN i_value = 100 ELSE i_value = 2 ENDIF i_return_value = xy_curve_nlppc_set ( s_curve_name, i_value ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_value = 0 #--------------------------------------------------------------------# Get the number of curves per parametric cubic i_return_value = xy_curve_nlppc_get ( s_curve_name, i_value ) dump i_return_value dump i_value

@ @ @

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

xy_curve_nlppc_set

()

# # Purpose : This file provides an example of a call to the # function xy_curve_nlppc_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the number of curves per parametric cubic # for the curve. Finally it sets the number of # curves per parametric cubic 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 xy_curve_nlppc_set() # has the following arguments: # # xy_curve_nlppc_set # ( curve_name, # value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] STRING s_func[30] INTEGER i_text_color INTEGER i_value INTEGER i_return_value

Main Index

Chapter 7: XY Plot Functions 1257 Modify Action

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the curve fit function s_func = "LeastSquares" i_return_value = xy_curve_func_set ( s_curve_name, s_func ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Set the number of parametric cubic curves for more prominent change # in the XY window i_return_value = @ xy_curve_num_pc_set @ ( s_curve_name, 4 ) dump i_return_value #--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the number of curves per parametric cubic i_return_value = xy_curve_nlppc_get ( s_curve_name, i_value ) dump i_return_value dump i_value

@ @ @

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

Main Index

1258 PCL Reference Manual Examples Modify Action

# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the number of curves per parametric cubic IF ( i_value < 3 ) THEN i_value = 100 ELSE i_value = 2 ENDIF i_return_value = xy_curve_nlppc_set ( s_curve_name, i_value ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_value = 0 #--------------------------------------------------------------------# Get the number of curves per parametric cubic i_return_value = xy_curve_nlppc_get ( s_curve_name, i_value ) dump i_return_value dump i_value

@ @ @

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

xy_curve_num_pc_get

()

# # Purpose : This file provides an example of two calls to # the function xy_curve_num_pc_get() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the number of parametric cubic curves. # Finally it sets the number of parametric cubic # curves 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 xy_curve_num_pc_get() # has the following arguments: # # xy_curve_num_pc_get # ( curve_name, # value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] STRING s_func[30] INTEGER i_text_color INTEGER i_value INTEGER i_return_value

Main Index

Chapter 7: XY Plot Functions 1259 Modify Action

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the curve fit function s_func = "LeastSquares" i_return_value = xy_curve_func_set ( s_curve_name, s_func ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Set the number of curves per parametric cubic for more prominent # change in the XY window i_return_value = @ xy_curve_nlppc_set @ ( s_curve_name, 2 ) dump i_return_value #--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the number of parametric cubic curves i_return_value = xy_curve_num_pc_get ( s_curve_name, i_value ) dump i_return_value dump i_value

@ @ @

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

Main Index

1260 PCL Reference Manual Examples Modify Action

sf_pause() #--------------------------------------------------------------------# Set the number of parametric cubic curves IF ( i_value < 7 ) THEN i_value = 90 ELSE i_value = 4 ENDIF i_return_value = xy_curve_num_pc_set ( s_curve_name, i_value ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_value = 0 #--------------------------------------------------------------------# Get the number of parametric cubic curves i_return_value = xy_curve_num_pc_get ( s_curve_name, i_value ) dump i_return_value dump i_value

@ @ @

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

xy_curve_num_pc_set

()

# # Purpose : This file provides an example of a call to the # function xy_curve_num_pc_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the number of parametric cubic curves. # Finally it sets the number of parametric cubic # curves 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 xy_curve_num_pc_set() # has the following arguments: # # xy_curve_num_pc_set # ( curve_name, # value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] STRING s_func[30] INTEGER i_text_color INTEGER i_value INTEGER i_return_value #---------------------------------------------------------------------

Main Index

Chapter 7: XY Plot Functions 1261 Modify Action

# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the curve fit function s_func = "LeastSquares" i_return_value = xy_curve_func_set ( s_curve_name, s_func ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Set the number of curves per parametric cubic for more prominent # change in the XY window i_return_value = @ xy_curve_nlppc_set @ ( s_curve_name, 2 ) dump i_return_value #--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the number of parametric cubic curves i_return_value = xy_curve_num_pc_get ( s_curve_name, i_value ) dump i_return_value dump i_value

@ @ @

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

Main Index

1262 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Set the number of parametric cubic curves IF ( i_value < 7 ) THEN i_value = 90 ELSE i_value = 4 ENDIF i_return_value = xy_curve_num_pc_set ( s_curve_name, i_value ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_value = 0 #--------------------------------------------------------------------# Get the number of parametric cubic curves i_return_value = xy_curve_num_pc_get ( s_curve_name, i_value ) dump i_return_value dump i_value

@ @ @

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

xy_curve_rename

()

# # Purpose : This file provides an example of a call to the # function xy_curve_rename() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the list of curves. Finally it renames the # curve and gets the list of curves 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 xy_curve_rename() # has the following arguments: # # xy_curve_rename # ( old_name, # new_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_old_name[32] STRING s_new_name[32] STRING s_text[32] STRING sa_curve_list[32](1) INTEGER i_text_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db")

Main Index

Chapter 7: XY Plot Functions 1263 Modify Action

$? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_old_name s_text i_text_color

= "curve_name" = "xy_curve" = 7

i_return_value = xy_curve_create ( s_old_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the list of curves # i_return_value = @ xy_curve_list_get @ ( sa_curve_list ) dump sa_curve_list dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Rename the curve # s_new_name = "new_curve_name" i_return_value = xy_curve_rename ( s_old_name, s_new_name ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Get the list of curves # i_return_value = @ xy_curve_list_get @ ( sa_curve_list ) dump sa_curve_list dump i_return_value #---------------------------------------------------------------------

()

xy_curve_startpt_get # # # # #

Main Index

Purpose

:

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

1264 PCL Reference Manual Examples Modify Action

# creates a window and a curve in it. Later it # gets the first data point to be displayed in # the curve. Finally it sets the first data point # to be displayed 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 xy_curve_startpt_get() # has the following arguments: # # xy_curve_startpt_get # ( curve_name, # start_point ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_start_point INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the first data point to be displayed in the curve i_return_value = xy_curve_startpt_get ( s_curve_name,

Main Index

@ @ @

Chapter 7: XY Plot Functions 1265 Modify Action

i_start_point ) dump i_return_value dump i_start_point #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the first data point to be displayed IF ( i_start_point == 2 ) THEN i_start_point = 1 ELSE i_start_point = 2 ENDIF i_return_value = xy_curve_startpt_set ( s_curve_name, i_start_point ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. i_start_point = 0 #--------------------------------------------------------------------# Get the first data point to be displayed i_return_value = xy_curve_startpt_get ( s_curve_name, i_start_point ) dump i_return_value dump i_start_point

@ @ @

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

xy_curve_startpt_set

()

# # Purpose : This file provides an example of a call to the # function xy_curve_startpt_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the first data point to be displayed in # the curve. Finally it sets the first data point # to be displayed 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 xy_curve_startpt_set() # has the following arguments: # # xy_curve_startpt_set # ( curve_name, # start_point ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32]

Main Index

1266 PCL Reference Manual Examples Modify Action

INTEGER INTEGER INTEGER

i_text_color i_start_point i_return_value

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the first data point to be displayed in the curve i_return_value = xy_curve_startpt_get ( s_curve_name, i_start_point ) dump i_return_value dump i_start_point

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the first data point to be displayed IF ( i_start_point == 2 ) THEN i_start_point = 1 ELSE i_start_point = 2 ENDIF i_return_value = xy_curve_startpt_set ( s_curve_name, i_start_point ) dump i_return_value

Main Index

@ @ @

Chapter 7: XY Plot Functions 1267 Modify Action

#--------------------------------------------------------------------# Reset the value. i_start_point = 0 #--------------------------------------------------------------------# Get the first data point to be displayed i_return_value = xy_curve_startpt_get ( s_curve_name, i_start_point ) dump i_return_value dump i_start_point

@ @ @

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

xy_curve_symbol_color_get

()

# # Purpose : This file provides an example of two calls to # the function xy_curve_symbol_color_get() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the symbol color. Finally it sets the # symbol color 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 xy_curve_symbol_color_get() # has the following arguments: # # xy_curve_symbol_color_get # ( curve_name, # symbol_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_symbol_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text

Main Index

= "new_xy_curve" = "new_xy_curve"

1268 PCL Reference Manual Examples Modify Action

i_text_color

= 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the disply symbol flag to TRUE i_return_value = @ xy_curve_display_symbol_set @ ( s_curve_name, TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the symbol color # i_return_value = @ xy_curve_symbol_color_get @ ( s_curve_name, @ i_symbol_color ) dump i_return_value dump i_symbol_color #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the symbol color IF( i_symbol_color == 1 ) THEN i_symbol_color = 2 ELSE i_symbol_color = 1 ENDIF i_return_value = xy_curve_symbol_color_set ( s_curve_name, i_symbol_color ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_symbol_color = 0 #--------------------------------------------------------------------# Get the symbol color # i_return_value = @ xy_curve_symbol_color_get @ ( s_curve_name, @ i_symbol_color ) dump i_return_value dump i_symbol_color

Main Index

Chapter 7: XY Plot Functions 1269 Modify Action

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

xy_curve_symbol_color_set

()

# # Purpose : This file provides an example of a call to the # function xy_curve_symbol_color_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the symbol color. Finally it sets the # symbol color 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 xy_curve_symbol_color_set() # has the following arguments: # # xy_curve_symbol_color_set # ( curve_name, # symbol_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_symbol_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set

Main Index

@ @

1270 PCL Reference Manual Examples Modify Action

(

s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the disply symbol flag to TRUE i_return_value = @ xy_curve_display_symbol_set @ ( s_curve_name, TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the symbol color # i_return_value = @ xy_curve_symbol_color_get @ ( s_curve_name, @ i_symbol_color ) dump i_return_value dump i_symbol_color #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the symbol color IF( i_symbol_color == 1 ) THEN i_symbol_color = 2 ELSE i_symbol_color = 1 ENDIF i_return_value = xy_curve_symbol_color_set ( s_curve_name, i_symbol_color ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_symbol_color = 0 #--------------------------------------------------------------------# Get the symbol color # i_return_value = @ xy_curve_symbol_color_get @ ( s_curve_name, @ i_symbol_color ) dump i_return_value dump i_symbol_color #---------------------------------------------------------------------

()

xy_curve_symbol_get # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_curve_symbol_get() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the symbol for the curve. Finally it sets

Chapter 7: XY Plot Functions 1271 Modify Action

# the symbol 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 xy_curve_symbol_get() # has the following arguments: # # xy_curve_symbol_get # ( curve_name, # symbol ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] STRING s_symbol[30] INTEGER i_text_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the disply symbol flag to TRUE i_return_value = @ xy_curve_display_symbol_set @ ( s_curve_name, TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the symbol for the curve

Main Index

1272 PCL Reference Manual Examples Modify Action

# i_return_value = xy_curve_symbol_get ( s_curve_name, s_symbol ) dump i_return_value dump s_symbol

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the symbol for the curve IF( s_symbol == "FillCircle" ) THEN s_symbol = "Fillsquare" ELSE s_symbol = "FillCircle" ENDIF i_return_value = xy_curve_symbol_set ( s_curve_name, s_symbol ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value s_symbol = "" #--------------------------------------------------------------------# Get the symbol for the curve # i_return_value = @ xy_curve_symbol_get @ ( s_curve_name, @ s_symbol ) dump i_return_value dump s_symbol #---------------------------------------------------------------------

()

xy_curve_symbol_set # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_curve_symbol_set() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the symbol for the curve. Finally it sets the symbol 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 xy_curve_symbol_set() has the following arguments: xy_curve_symbol_set ( curve_name, symbol )

Chapter 7: XY Plot Functions 1273 Modify Action

# #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] STRING s_symbol[30] INTEGER i_text_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the disply symbol flag to TRUE i_return_value = @ xy_curve_display_symbol_set @ ( s_curve_name, TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the symbol for the curve # i_return_value = @ xy_curve_symbol_get @ ( s_curve_name, @ s_symbol ) dump i_return_value dump s_symbol #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #---------------------------------------------------------------------

Main Index

1274 PCL Reference Manual Examples Modify Action

#

Set the symbol for the curve

IF( s_symbol == "FillCircle" ) THEN s_symbol = "Fillsquare" ELSE s_symbol = "FillCircle" ENDIF i_return_value = xy_curve_symbol_set ( s_curve_name, s_symbol ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value s_symbol = "" #--------------------------------------------------------------------# Get the symbol for the curve # i_return_value = @ xy_curve_symbol_get @ ( s_curve_name, @ s_symbol ) dump i_return_value dump s_symbol #---------------------------------------------------------------------

xy_curve_symbol_size_get

()

# # Purpose : This file provides an example of two calls to # the function xy_curve_symbol_size_get() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the symbol size. Finally it sets the # symbol size 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 xy_curve_symbol_size_get() # has the following arguments: # # xy_curve_symbol_size_get # ( curve_name, # symbol_size ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_symbol_size INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

Chapter 7: XY Plot Functions 1275 Modify Action

#--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the disply symbol flag to TRUE i_return_value = @ xy_curve_display_symbol_set @ ( s_curve_name, TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the symbol size # i_return_value = @ xy_curve_symbol_size_get @ ( s_curve_name, @ i_symbol_size ) dump i_return_value dump i_symbol_size #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the symbol size IF( i_symbol_size < 12 ) THEN i_symbol_size = 15 ELSE i_symbol_size = 10 ENDIF i_return_value = xy_curve_symbol_size_set ( s_curve_name, i_symbol_size ) dump i_return_value

Main Index

@ @ @

1276 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Reset the value i_symbol_size = 0 #--------------------------------------------------------------------# Get the symbol size # i_return_value = @ xy_curve_symbol_size_get @ ( s_curve_name, @ i_symbol_size ) dump i_return_value dump i_symbol_size #---------------------------------------------------------------------

xy_curve_symbol_size_set

()

# # Purpose : This file provides an example of a call to the # function xy_curve_symbol_size_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the symbol size. Finally it sets the # symbol size 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 xy_curve_symbol_size_set() # has the following arguments: # # xy_curve_symbol_size_set # ( curve_name, # symbol_size ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_symbol_size INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

Main Index

= "new_xy_curve" = "new_xy_curve" = 7

Chapter 7: XY Plot Functions 1277 Modify Action

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the disply symbol flag to TRUE i_return_value = @ xy_curve_display_symbol_set @ ( s_curve_name, TRUE ) dump i_return_value #--------------------------------------------------------------------# Get the symbol size # i_return_value = @ xy_curve_symbol_size_get @ ( s_curve_name, @ i_symbol_size ) dump i_return_value dump i_symbol_size #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the symbol size IF( i_symbol_size < 12 ) THEN i_symbol_size = 15 ELSE i_symbol_size = 10 ENDIF i_return_value = xy_curve_symbol_size_set ( s_curve_name, i_symbol_size ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_symbol_size = 0 #--------------------------------------------------------------------# Get the symbol size # i_return_value = @ xy_curve_symbol_size_get @ ( s_curve_name, @ i_symbol_size ) dump i_return_value dump i_symbol_size

Main Index

1278 PCL Reference Manual Examples Modify Action

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

()

xy_curve_text_get

# # Purpose : This file provides an example of two calls to # the function xy_curve_text_get() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the text attributes for the curve. Finally # it sets the text attributes 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 xy_curve_text_get() # has the following arguments: # # xy_curve_text_get # ( curve_name, # text, # text_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5,

Main Index

@ @ @

Chapter 7: XY Plot Functions 1279 Modify Action

[1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] dump i_return_value

@ )

#--------------------------------------------------------------------# Set the display legend flag to TRUE i_return_value = xy_legend_display_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the text attributes for the curve # i_return_value = @ xy_curve_text_get @ ( s_curve_name, @ s_text, @ i_text_color ) dump i_return_value dump s_text dump i_text_color #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set new text attributes for the curve s_text = "old_xy_curve" i_text_color = 2 i_return_value = xy_curve_text_set ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Reset the values s_text = "" i_text_color = 0 #--------------------------------------------------------------------# Get the text attributes for the curve # i_return_value = @ xy_curve_text_get @ ( s_curve_name, @ s_text, @ i_text_color ) dump i_return_value dump s_text dump i_text_color #---------------------------------------------------------------------

()

xy_curve_text_set # # # #

Main Index

Purpose

:

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

1280 PCL Reference Manual Examples Modify Action

# This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the text attributes for the curve. Finally # it sets the text attributes 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 xy_curve_text_set() # has the following arguments: # # xy_curve_text_set # ( curve_name, # text, # text_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the display legend flag to TRUE i_return_value = xy_legend_display_set ( TRUE )

Main Index

@ @

Chapter 7: XY Plot Functions 1281 Modify Action

dump i_return_value #--------------------------------------------------------------------# Get the text attributes for the curve # i_return_value = @ xy_curve_text_get @ ( s_curve_name, @ s_text, @ i_text_color ) dump i_return_value dump s_text dump i_text_color #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set new text attributes for the curve s_text = "old_xy_curve" i_text_color = 2 i_return_value = xy_curve_text_set ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Reset the values s_text = "" i_text_color = 0 #--------------------------------------------------------------------# Get the text attributes for the curve # i_return_value = @ xy_curve_text_get @ ( s_curve_name, @ s_text, @ i_text_color ) dump i_return_value dump s_text dump i_text_color #---------------------------------------------------------------------

()

xy_curve_thickness_get # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_curve_thickness_get() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the curve thickness. Finally it sets the curve thickness 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.

1282 PCL Reference Manual Examples Modify Action

# The function xy_curve_thickness_get() # has the following arguments: # # xy_curve_thickness_get # ( curve_name, # thickness ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_thickness INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the curve thickness # i_return_value = @ xy_curve_thickness_get @ ( s_curve_name, @ i_thickness ) dump i_return_value dump i_thickness #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the curve thickness

Main Index

Chapter 7: XY Plot Functions 1283 Modify Action

IF( i_thickness < 3 ) THEN i_thickness = 5 ELSE i_thickness = 1 ENDIF i_return_value = xy_curve_thickness_set ( s_curve_name, i_thickness ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_thickness = 0 #--------------------------------------------------------------------# Get the curve thickness # i_return_value = @ xy_curve_thickness_get @ ( s_curve_name, @ i_thickness ) dump i_return_value dump i_thickness #---------------------------------------------------------------------

xy_curve_thickness_set

()

# # Purpose : This file provides an example of a call to the # function xy_curve_thickness_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the curve thickness. Finally it sets the # curve thickness 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 xy_curve_thickness_set() # has the following arguments: # # xy_curve_thickness_set # ( curve_name, # thickness ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color INTEGER i_thickness INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #---------------------------------------------------------------------

Main Index

1284 PCL Reference Manual Examples Modify Action

#

Create a new XY window

i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the curve thickness # i_return_value = @ xy_curve_thickness_get @ ( s_curve_name, @ i_thickness ) dump i_return_value dump i_thickness #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the curve thickness IF( i_thickness < 3 ) THEN i_thickness = 5 ELSE i_thickness = 1 ENDIF i_return_value = xy_curve_thickness_set ( s_curve_name, i_thickness ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_thickness = 0 #--------------------------------------------------------------------# Get the curve thickness # i_return_value = @

Main Index

Chapter 7: XY Plot Functions 1285 Modify Action

xy_curve_thickness_get ( s_curve_name, i_thickness ) dump i_return_value dump i_thickness

@ @

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

()

xy_curve_xdelta_get

# # Purpose : This file provides an example of two calls to # the function xy_curve_xdelta_get() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the value of X increment to be used if # only Y data is given. Finally it sets the value # of X increment 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 xy_curve_xdelta_get() # has the following arguments: # # xy_curve_xdelta_get # ( curve_name, # xdelta ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color REAL r_xdelta INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

Main Index

@ @ @ @

1286 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Assign Y data to the curve i_return_value = xy_curve_data_set ( s_curve_name, TRUE, 5, [0., 0., 0., 0., 0.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the value of X increment for the curve i_return_value = xy_curve_xdelta_get ( s_curve_name, r_xdelta ) dump i_return_value dump r_xdelta

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the value of X increment IF ( r_xdelta < 2. ) THEN r_xdelta = 3. ELSE r_xdelta = 1. ENDIF i_return_value = xy_curve_xdelta_set ( s_curve_name, r_xdelta ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. r_xdelta = 0. #--------------------------------------------------------------------# Get the value of X increment i_return_value = xy_curve_xdelta_get ( s_curve_name, r_xdelta ) dump i_return_value dump r_xdelta

@ @ @

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

()

xy_curve_xdelta_set # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_curve_xdelta_set() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the value of X increment to be used if only Y data is given. Finally it sets the value of X increment and gets it again.

Chapter 7: XY Plot Functions 1287 Modify Action

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function xy_curve_xdelta_set() # has the following arguments: # # xy_curve_xdelta_set # ( curve_name, # xdelta ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color REAL r_xdelta INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign Y data to the curve i_return_value = xy_curve_data_set ( s_curve_name, TRUE, 5, [0., 0., 0., 0., 0.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the value of X increment for the curve i_return_value = xy_curve_xdelta_get ( s_curve_name, r_xdelta ) dump i_return_value dump r_xdelta

Main Index

@ @ @

1288 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the value of X increment IF ( r_xdelta < 2. ) THEN r_xdelta = 3. ELSE r_xdelta = 1. ENDIF i_return_value = xy_curve_xdelta_set ( s_curve_name, r_xdelta ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. r_xdelta = 0. #--------------------------------------------------------------------# Get the value of X increment i_return_value = xy_curve_xdelta_get ( s_curve_name, r_xdelta ) dump i_return_value dump r_xdelta

@ @ @

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

xy_curve_xinit_get

()

# # Purpose : This file provides an example of two calls to # the function xy_curve_xinit_get() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the initial value of X to be used if only # Y data is given. Finally it sets the initial # value of X 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 xy_curve_xinit_get() # has the following arguments: # # xy_curve_xinit_get # ( curve_name, # xinit ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color REAL r_xinit INTEGER i_return_value

Main Index

Chapter 7: XY Plot Functions 1289 Modify Action

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign Y data to the curve i_return_value = xy_curve_data_set ( s_curve_name, TRUE, 5, [0., 0., 0., 0., 0.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the initial value of X for the curve i_return_value = xy_curve_xinit_get ( s_curve_name, r_xinit ) dump i_return_value dump r_xinit

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the initial value of X IF ( r_xinit < 5. ) THEN r_xinit = 8. ELSE r_xinit = 2. ENDIF i_return_value = xy_curve_xinit_set ( s_curve_name, r_xinit ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. r_xinit = 0.

Main Index

1290 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Get the initial value of X i_return_value = xy_curve_xinit_get ( s_curve_name, r_xinit ) dump i_return_value dump r_xinit

@ @ @

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

()

xy_curve_xinit_set

# # Purpose : This file provides an example of a call to the # function xy_curve_xinit_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the initial value of X to be used if only # Y data is given. Finally it sets the initial # value of X 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 xy_curve_xinit_set() # has the following arguments: # # xy_curve_xinit_set # ( curve_name, # xinit ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color REAL r_xinit INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value =

Main Index

@

Chapter 7: XY Plot Functions 1291 Modify Action

xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Assign Y data to the curve i_return_value = xy_curve_data_set ( s_curve_name, TRUE, 5, [0., 0., 0., 0., 0.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the initial value of X for the curve i_return_value = xy_curve_xinit_get ( s_curve_name, r_xinit ) dump i_return_value dump r_xinit

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the initial value of X IF ( r_xinit < 5. ) THEN r_xinit = 8. ELSE r_xinit = 2. ENDIF i_return_value = xy_curve_xinit_set ( s_curve_name, r_xinit ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value. r_xinit = 0. #--------------------------------------------------------------------# Get the initial value of X i_return_value = xy_curve_xinit_get ( s_curve_name, r_xinit ) dump i_return_value dump r_xinit

@ @ @

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

()

xy_curve_xscale_get # # # #

Main Index

Purpose

:

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

1292 PCL Reference Manual Examples Modify Action

# This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the X scale factor for the curve. Finally # it sets the X scale factor 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 xy_curve_xscale_get() # has the following arguments: # # xy_curve_xscale_get # ( curve_name, # xfactor ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color REAL r_xfactor INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the X scale factor for the curve # i_return_value = @ xy_curve_xscale_get @ ( s_curve_name, @

Main Index

Chapter 7: XY Plot Functions 1293 Modify Action

r_xfactor dump i_return_value dump r_xfactor

)

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the X scale factor IF( r_xfactor == 1. ) THEN r_xfactor = 3. ELSE r_xfactor = 1. ENDIF i_return_value = xy_curve_xscale_set ( s_curve_name, r_xfactor dump i_return_value

@ @ @ )

#--------------------------------------------------------------------# Reset the value r_xfactor = 0. #--------------------------------------------------------------------# Get the X scale factor # i_return_value = @ xy_curve_xscale_get @ ( s_curve_name, @ r_xfactor ) dump i_return_value dump r_xfactor #---------------------------------------------------------------------

xy_curve_xscale_set

()

# # Purpose : This file provides an example of a call to the # function xy_curve_xscale_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the X scale factor for the curve. Finally # it sets the X scale factor 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 xy_curve_xscale_set() # has the following arguments: # # xy_curve_xscale_set # ( curve_name, # xfactor ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32]

Main Index

1294 PCL Reference Manual Examples Modify Action

INTEGER REAL INTEGER

i_text_color r_xfactor i_return_value

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the X scale factor for the curve # i_return_value = @ xy_curve_xscale_get @ ( s_curve_name, @ r_xfactor ) dump i_return_value dump r_xfactor #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the X scale factor IF( r_xfactor == 1. ) THEN r_xfactor = 3. ELSE r_xfactor = 1. ENDIF i_return_value = xy_curve_xscale_set ( s_curve_name, r_xfactor

Main Index

@ @ @ )

Chapter 7: XY Plot Functions 1295 Modify Action

dump i_return_value #--------------------------------------------------------------------# Reset the value r_xfactor = 0. #--------------------------------------------------------------------# Get the X scale factor # i_return_value = @ xy_curve_xscale_get @ ( s_curve_name, @ r_xfactor ) dump i_return_value dump r_xfactor #---------------------------------------------------------------------

()

xy_curve_yscale_get

# # Purpose : This file provides an example of two calls to # the function xy_curve_yscale_get() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the Y scale factor for the curve. Finally # it sets the Y scale factor 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 xy_curve_yscale_get() # has the following arguments: # # xy_curve_yscale_get # ( curve_name, # yfactor ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color REAL r_yfactor INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name

Main Index

= "new_xy_curve"

1296 PCL Reference Manual Examples Modify Action

s_text i_text_color

= "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the Y scale factor for the curve # i_return_value = @ xy_curve_yscale_get @ ( s_curve_name, @ r_yfactor ) dump i_return_value dump r_yfactor #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the Y scale factor IF( r_yfactor == 1. ) THEN r_yfactor = 3. ELSE r_yfactor = 1. ENDIF i_return_value = xy_curve_yscale_set ( s_curve_name, r_yfactor dump i_return_value

@ @ @ )

#--------------------------------------------------------------------# Reset the value r_yfactor = 0. #--------------------------------------------------------------------# Get the Y scale factor # i_return_value = @ xy_curve_yscale_get @ ( s_curve_name, @ r_yfactor ) dump i_return_value dump r_yfactor #---------------------------------------------------------------------

Main Index

Chapter 7: XY Plot Functions 1297 Modify Action

()

xy_curve_yscale_set

# # Purpose : This file provides an example of a call to the # function xy_curve_yscale_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the Y scale factor for the curve. Finally # it sets the Y scale factor 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 xy_curve_yscale_set() # has the following arguments: # # xy_curve_yscale_set # ( curve_name, # yfactor ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_text[32] INTEGER i_text_color REAL r_yfactor INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve s_curve_name s_text i_text_color

= "new_xy_curve" = "new_xy_curve" = 7

i_return_value = xy_curve_create ( s_curve_name, s_text, i_text_color ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( s_curve_name, FALSE, 5, [1., 3., 6., 8., 9.],

Main Index

@ @ @ @

1298 PCL Reference Manual Examples Modify Action

[2., 8., 4., 9., 5.] dump i_return_value

)

#--------------------------------------------------------------------# Get the Y scale factor for the curve # i_return_value = @ xy_curve_yscale_get @ ( s_curve_name, @ r_yfactor ) dump i_return_value dump r_yfactor #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the Y scale factor IF( r_yfactor == 1. ) THEN r_yfactor = 3. ELSE r_yfactor = 1. ENDIF i_return_value = xy_curve_yscale_set ( s_curve_name, r_yfactor dump i_return_value

@ @ @ )

#--------------------------------------------------------------------# Reset the value r_yfactor = 0. #--------------------------------------------------------------------# Get the Y scale factor # i_return_value = @ xy_curve_yscale_get @ ( s_curve_name, @ r_yfactor ) dump i_return_value dump r_yfactor #---------------------------------------------------------------------

()

xy_legend_attrib_get # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_legend_attrib_get() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the legend attributes for the curve. Finally it sets the legend attributes and gets them 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 xy_legend_attrib_get()

Chapter 7: XY Plot Functions 1299 Modify Action

# has the following arguments: # # xy_legend_attrib_get # ( location, # width, # height, # bgcolor ) # #--------------------------------------------------------------------# Variable Declarations REAL ra_location(2) REAL r_width REAL r_height INTEGER i_bgcolor INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create a XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the display legend flag to TRUE i_return_value = xy_legend_display_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the legend attributes # i_return_value = @ xy_legend_attrib_get @ ( ra_location, @ r_width, @ r_height, @ i_bgcolor ) dump i_return_value dump ra_location dump r_width dump r_height

Main Index

1300 PCL Reference Manual Examples Modify Action

dump i_bgcolor #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set new legend attributes ra_location r_width r_height

= [0., 10.] = 10. = 10.

IF( i_bgcolor == 0 ) THEN i_bgcolor = 1 ELSE i_bgcolor = 0 ENDIF i_return_value = xy_legend_attrib_set ( ra_location, r_width, r_height, i_bgcolor ) dump i_return_value

@ @ @ @ @

#--------------------------------------------------------------------# Reset the values. ra_location = [0., 0.] r_width = 0. r_height = 0. #--------------------------------------------------------------------# Get the legend attributes # i_return_value = @ xy_legend_attrib_get @ ( ra_location, @ r_width, @ r_height, @ i_bgcolor ) dump i_return_value dump ra_location dump r_width dump r_height dump i_bgcolor #---------------------------------------------------------------------

()

xy_legend_attrib_set # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_legend_attrib_set() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the legend attributes for the curve. Finally it sets the legend attributes and gets them 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.

Chapter 7: XY Plot Functions 1301 Modify Action

# The function xy_legend_attrib_set() # has the following arguments: # # xy_legend_attrib_set # ( location, # width, # height, # bgcolor ) # #--------------------------------------------------------------------# Variable Declarations REAL ra_location(2) REAL r_width REAL r_height INTEGER i_bgcolor INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create a XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the display legend flag to TRUE i_return_value = xy_legend_display_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the legend attributes # i_return_value = @ xy_legend_attrib_get @ ( ra_location, @ r_width, @ r_height, @ i_bgcolor ) dump i_return_value dump ra_location dump r_width

Main Index

1302 PCL Reference Manual Examples Modify Action

dump r_height dump i_bgcolor #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set new legend attributes ra_location r_width r_height

= [0., 10.] = 10. = 10.

IF( i_bgcolor == 0 ) THEN i_bgcolor = 1 ELSE i_bgcolor = 0 ENDIF i_return_value = xy_legend_attrib_set ( ra_location, r_width, r_height, i_bgcolor ) dump i_return_value

@ @ @ @ @

#--------------------------------------------------------------------# Reset the values. ra_location = [0., 0.] r_width = 0. r_height = 0. #--------------------------------------------------------------------# Get the legend attributes # i_return_value = @ xy_legend_attrib_get @ ( ra_location, @ r_width, @ r_height, @ i_bgcolor ) dump i_return_value dump ra_location dump r_width dump r_height dump i_bgcolor #---------------------------------------------------------------------

()

xy_legend_border_get # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_legend_border_get() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the legend border attributes for the curve. Finally it sets the legend border attributes and gets them 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.

Chapter 7: XY Plot Functions 1303 Modify Action

# # The function xy_legend_border_get() # has the following arguments: # # xy_legend_border_get # ( style, # border_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_style[30] INTEGER i_border_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create a XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the display border flag to TRUE i_return_value = xy_legend_display_border_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the display legend flag to TRUE i_return_value = xy_legend_display_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the legend border attributes # i_return_value = @ xy_legend_border_get @ ( s_style, @ i_border_color )

Main Index

1304 PCL Reference Manual Examples Modify Action

dump i_return_value dump s_style dump i_border_color #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set new legend border attributes IF( s_style == "Solid" ) THEN s_style = "Dotted" ELSE s_style = "Solid" ENDIF IF( i_border_color == 7 ) THEN i_border_color = 6 ELSE i_border_color = 7 ENDIF i_return_value = xy_legend_border_set ( s_style, i_border_color ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the values. s_style = "" #--------------------------------------------------------------------# Get the legend border attributes # i_return_value = @ xy_legend_border_get @ ( s_style, @ i_border_color ) dump i_return_value dump s_style dump i_border_color #---------------------------------------------------------------------

xy_legend_border_set # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

()

This file provides an example of a call to the function xy_legend_border_set() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the legend border attributes for the curve. Finally it sets the legend border attributes and gets them 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 xy_legend_border_set() has the following arguments: xy_legend_border_set

Chapter 7: XY Plot Functions 1305 Modify Action

# ( style, # border_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_style[30] INTEGER i_border_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create a XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the display border flag to TRUE i_return_value = xy_legend_display_border_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the display legend flag to TRUE i_return_value = xy_legend_display_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the legend border attributes # i_return_value = @ xy_legend_border_get @ ( s_style, @ i_border_color ) dump i_return_value dump s_style dump i_border_color #---------------------------------------------------------------------

Main Index

1306 PCL Reference Manual Examples Modify Action

# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set new legend border attributes IF( s_style == "Solid" ) THEN s_style = "Dotted" ELSE s_style = "Solid" ENDIF IF( i_border_color == 7 ) THEN i_border_color = 6 ELSE i_border_color = 7 ENDIF i_return_value = xy_legend_border_set ( s_style, i_border_color ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the values. s_style = "" #--------------------------------------------------------------------# Get the legend border attributes # i_return_value = @ xy_legend_border_get @ ( s_style, @ i_border_color ) dump i_return_value dump s_style dump i_border_color #---------------------------------------------------------------------

xy_legend_display_border_get

()

# Purpose : This file provides an example of two calls to # the function xy_legend_display_border_get() # # This file opens a new database "new.db" and # creates a window and a curve in it. Later it # gets the display border flag. Finally it sets # the display border flag 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 xy_legend_display_border_get() # has the following arguments: # # xy_legend_display_border_get # ( border_flag ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_border_flag INTEGER i_return_value #

Main Index

Chapter 7: XY Plot Functions 1307 Modify Action

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the display legend flag i_return_value = xy_legend_display_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display border flag # i_return_value = @ xy_legend_display_border_get @ ( l_border_flag ) dump i_return_value dump l_border_flag #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display border flag IF( l_border_flag == TRUE ) THEN l_border_flag = FALSE ELSE l_border_flag = TRUE ENDIF i_return_value = xy_legend_display_border_set ( l_border_flag ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display border flag

Main Index

1308 PCL Reference Manual Examples Modify Action

# i_return_value = xy_legend_display_border_get ( l_border_flag ) dump i_return_value dump l_border_flag

@ @

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

xy_legend_display_border_set

()

# # Purpose : This file provides an example of a call to the # function xy_legend_display_border_set() # # This file opens a new database "new.db" and # creates a window and a curve in it. Later it # gets the display border flag. Finally it sets # the display border flag 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 xy_legend_display_border_set() # has the following arguments: # # xy_legend_display_border_set # ( border_flag ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_border_flag INTEGER i_return_value # #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

Main Index

@ @ @ @

Chapter 7: XY Plot Functions 1309 Modify Action

#--------------------------------------------------------------------# Set the display legend flag i_return_value = xy_legend_display_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display border flag # i_return_value = @ xy_legend_display_border_get @ ( l_border_flag ) dump i_return_value dump l_border_flag #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display border flag IF( l_border_flag == TRUE ) THEN l_border_flag = FALSE ELSE l_border_flag = TRUE ENDIF i_return_value = xy_legend_display_border_set ( l_border_flag ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display border flag # i_return_value = @ xy_legend_display_border_get @ ( l_border_flag ) dump i_return_value dump l_border_flag #---------------------------------------------------------------------

()

xy_legend_display_get # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_legend_display_get() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the display legend flag. Finally it sets the display legend flag 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 xy_legend_display_get() has the following arguments:

1310 PCL Reference Manual Examples Modify Action

# xy_legend_display_get # ( legend_flag ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_legend_flag INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create a XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Get the display legend flag # i_return_value = @ xy_legend_display_get @ ( l_legend_flag ) dump i_return_value dump l_legend_flag #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display legend flag IF( l_legend_flag == TRUE ) THEN l_legend_flag = FALSE ELSE l_legend_flag = TRUE ENDIF i_return_value = xy_legend_display_set ( l_legend_flag ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display legend flag

Main Index

Chapter 7: XY Plot Functions 1311 Modify Action

# i_return_value = xy_legend_display_get ( l_legend_flag ) dump i_return_value dump l_legend_flag

@ @

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

xy_legend_display_set

()

# # Purpose : This file provides an example of a call to the # function xy_legend_display_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the display legend flag. Finally it sets # the display legend flag 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 xy_legend_display_set() # has the following arguments: # # xy_legend_display_set # ( legend_flag ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_legend_flag INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create a XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

Main Index

@ @ @ @

1312 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Get the display legend flag # i_return_value = @ xy_legend_display_get @ ( l_legend_flag ) dump i_return_value dump l_legend_flag #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display legend flag IF( l_legend_flag == TRUE ) THEN l_legend_flag = FALSE ELSE l_legend_flag = TRUE ENDIF i_return_value = xy_legend_display_set ( l_legend_flag ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display legend flag # i_return_value = @ xy_legend_display_get @ ( l_legend_flag ) dump i_return_value dump l_legend_flag #---------------------------------------------------------------------

xy_legend_display_title_get

()

# # Purpose : This file provides an example of two calls to # the function xy_legend_display_title_get() # # This file opens a new database "new.db" and # creates a window and a curve in it. Later it # gets the display title flag. Finally it sets # the display title flag 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 xy_legend_display_title_get() # has the following arguments: # # xy_legend_display_title_get # ( title_flag ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_title_flag INTEGER i_return_value

Main Index

Chapter 7: XY Plot Functions 1313 Modify Action

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the display legend flag i_return_value = xy_legend_display_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display title flag # i_return_value = @ xy_legend_display_title_get @ ( l_title_flag ) dump i_return_value dump l_title_flag #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display title flag IF( l_title_flag == TRUE ) THEN l_title_flag = FALSE ELSE l_title_flag = TRUE ENDIF i_return_value = xy_legend_display_title_set ( l_title_flag ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display title flag

Main Index

1314 PCL Reference Manual Examples Modify Action

# i_return_value = xy_legend_display_title_get ( l_title_flag ) dump i_return_value dump l_title_flag

@ @

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

xy_legend_display_title_set

()

# # Purpose : This file provides an example of a call to the # function xy_legend_display_title_set() # # This file opens a new database "new.db" and # creates a window and a curve in it. Later it # gets the display title flag. Finally it sets # the display title flag 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 xy_legend_display_title_set() # has the following arguments: # # xy_legend_display_title_set # ( title_flag ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_title_flag INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

Main Index

@ @ @ @

Chapter 7: XY Plot Functions 1315 Modify Action

#--------------------------------------------------------------------# Set the display legend flag i_return_value = xy_legend_display_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display title flag # i_return_value = @ xy_legend_display_title_get @ ( l_title_flag ) dump i_return_value dump l_title_flag #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display title flag IF( l_title_flag == TRUE ) THEN l_title_flag = FALSE ELSE l_title_flag = TRUE ENDIF i_return_value = xy_legend_display_title_set ( l_title_flag ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display title flag # i_return_value = @ xy_legend_display_title_get @ ( l_title_flag ) dump i_return_value dump l_title_flag #---------------------------------------------------------------------

()

xy_legend_text_get # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_legend_text_get() This file opens a new database "new.db", creates a window and a curve in it. Later it gets the legend text attributes for the curve. Finally it sets the legend text attributes and gets them 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 xy_legend_text_get() has the following arguments:

1316 PCL Reference Manual Examples Modify Action

# # xy_legend_text_get # ( text, # text_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_text[256] INTEGER i_text_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create a XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the display title flag to TRUE i_return_value = xy_legend_display_title_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the display legend flag to TRUE i_return_value = xy_legend_display_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the legend text attributes # i_return_value = @ xy_legend_text_get @ ( s_text, @ i_text_color ) dump i_return_value dump s_text dump i_text_color

Main Index

Chapter 7: XY Plot Functions 1317 Modify Action

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set new legend text attributes s_text = "Sample" IF( i_text_color == 7 ) THEN i_text_color = 6 ELSE i_text_color = 7 ENDIF i_return_value = xy_legend_text_set ( s_text, i_text_color ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Get the legend text attributes # i_return_value = @ xy_legend_text_get @ ( s_text, @ i_text_color ) dump i_return_value dump s_text dump i_text_color #---------------------------------------------------------------------

xy_legend_text_set

()

# # Purpose : This file provides an example of a call to the # function xy_legend_text_set() # # This file opens a new database "new.db", # creates a window and a curve in it. Later it # gets the legend text attributes for the curve. # Finally it sets the legend text attributes and # gets them 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 xy_legend_text_set() # has the following arguments: # # xy_legend_text_set # ( text, # text_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_text[256] INTEGER i_text_color INTEGER i_return_value #---------------------------------------------------------------------

Main Index

1318 PCL Reference Manual Examples Modify Action

# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create a XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Set the display title flag to TRUE i_return_value = xy_legend_display_title_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the display legend flag to TRUE i_return_value = xy_legend_display_set ( TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the legend text attributes # i_return_value = @ xy_legend_text_get @ ( s_text, @ i_text_color ) dump i_return_value dump s_text dump i_text_color #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set new legend text attributes s_text = "Sample" IF( i_text_color == 7 ) THEN i_text_color = 6

Main Index

Chapter 7: XY Plot Functions 1319 Modify Action

ELSE i_text_color = 7 ENDIF i_return_value = xy_legend_text_set ( s_text, i_text_color ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Get the legend text attributes # i_return_value = @ xy_legend_text_get @ ( s_text, @ i_text_color ) dump i_return_value dump s_text dump i_text_color #---------------------------------------------------------------------

xy_title_current_set

()

# Purpose : This file provides an example of two calls to # the function xy_title_current_set() # # This file opens a new database "new.db", # creates a window and two titles in it. Later it # sets first title as current and verifies by # getting it. Finally it sets the second title as # current 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 xy_title_current_set() # has the following arguments: # # xy_title_current_set # ( title_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_title_name[256] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create a XY curve

Main Index

1320 PCL Reference Manual Examples Modify Action

i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Create two titles i_return_value = xy_title_create ( "title_one", "T1", 12, [60., 50.], 7 ) dump i_return_value

@ @

i_return_value = xy_title_create ( "title_two", "T2", 12, [77., 50.], 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the first title as current s_title_name = "title_one" i_return_value = xy_title_current_set ( s_title_name ) dump i_return_value

@ @

#--------------------------------------------------------------------# Reset the value s_title_name = "" #--------------------------------------------------------------------# Get the current title i_return_value = xy_title_current_get ( s_title_name ) dump i_return_value dump s_title_name

@ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the second title as current s_title_name = "title_two" i_return_value = xy_title_current_set ( s_title_name ) dump i_return_value

@ @

#--------------------------------------------------------------------# Reset the value s_title_name = ""

Main Index

Chapter 7: XY Plot Functions 1321 Modify Action

#--------------------------------------------------------------------# Get the current title i_return_value = xy_title_current_get ( s_title_name ) dump i_return_value dump s_title_name

@ @

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

xy_title_font_get

()

# # Purpose : This file provides an example of two calls to # the function xy_title_font_get() # # This file opens a new database "new.db", # creates a window, a curve and a title in it. # Later it gets the title font size. Finally it # sets the title font size 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 xy_title_font_get() # has the following arguments: # # xy_title_font_get # ( title_name, # font_size ) # #--------------------------------------------------------------------# Variable Declarations STRING s_title_name[256] INTEGER i_font_size INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve i_return_value = xy_curve_create ( "new_xy_curve", "new_xy_curve", 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value =

Main Index

@

1322 PCL Reference Manual Examples Modify Action

xy_curve_data_set ( "new_xy_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Create a title s_title_name

= "new_title_name"

i_return_value = xy_title_create ( s_title_name, "T", 10, [77., 50.], 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the title font size # i_return_value = @ xy_title_font_get @ ( s_title_name, @ i_font_size ) dump i_return_value dump i_font_size #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the title font size i_font_size = 16 i_return_value = xy_title_font_set ( s_title_name, i_font_size ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Get the title font size # i_return_value = @ xy_title_font_get @ ( s_title_name, @ i_font_size ) dump i_return_value dump i_font_size #---------------------------------------------------------------------

()

xy_title_font_set # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function xy_title_font_set() This file opens a new database "new.db", creates a window, a curve and a title in it. Later it gets the title font size. Finally it sets the title font size and gets it again. This file can be run by starting a session of Patran, and running this session file

Chapter 7: XY Plot Functions 1323 Modify Action

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function xy_title_font_set() # has the following arguments: # # xy_title_font_set # ( title_name, # font_size ) # #--------------------------------------------------------------------# Variable Declarations STRING s_title_name[256] INTEGER i_font_size INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve i_return_value = xy_curve_create ( "new_xy_curve", "new_xy_curve", 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_xy_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Create a title s_title_name

= "new_title_name"

i_return_value = xy_title_create ( s_title_name, "T", 10, [77., 50.], 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the title font size # i_return_value = @ xy_title_font_get @ ( s_title_name, @ i_font_size ) dump i_return_value dump i_font_size #---------------------------------------------------------------------

Main Index

1324 PCL Reference Manual Examples Modify Action

# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the title font size i_font_size = 16 i_return_value = xy_title_font_set ( s_title_name, i_font_size ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Get the title font size # i_return_value = @ xy_title_font_get @ ( s_title_name, @ i_font_size ) dump i_return_value dump i_font_size #---------------------------------------------------------------------

xy_title_rename

()

# # Purpose : This file provides an example of a call to the # function xy_title_rename() # # This file opens a new database "new.db", # creates a window and a title in it. Later it # gets the list of titles. Finally it renames the # title and gets the list 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 xy_title_rename() # has the following arguments: # # xy_title_rename # ( old_name, # new_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_old_name[256] STRING s_new_name[256] STRING sa_title_list[256](1) INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create

Main Index

@ @

Chapter 7: XY Plot Functions 1325 Modify Action

( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value #--------------------------------------------------------------------# Create a XY curve i_return_value = xy_curve_create ( "new_curve" , "new_curve" , 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

@ @ @ @

#--------------------------------------------------------------------# Create a title s_old_name

= "title_name"

i_return_value = xy_title_create ( s_old_name, "T", 10, [60., 50.], 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the list of titles # i_return_value = @ xy_title_list_get @ ( sa_title_list ) dump sa_title_list dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Rename the title # s_new_name = "new_title_name" i_return_value = xy_title_rename ( s_old_name, s_new_name ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Get the list of titles # i_return_value = @ xy_title_list_get @ ( sa_title_list ) dump sa_title_list dump i_return_value #---------------------------------------------------------------------

Main Index

1326 PCL Reference Manual Examples Modify Action

xy_title_text_get

()

# # Purpose : This file provides an example of two calls to # the function xy_title_text_get() # # This file opens a new database "new.db", # creates a window, a curve and a title in it. # Later it gets the text attributes for the title # Finally it sets the title text attributes and # gets them 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 xy_title_text_get() # has the following arguments: # # xy_title_text_get # ( title_name, # text, # location, # text_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_title_name[256] STRING s_text[256] REAL ra_location(2) INTEGER i_text_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve i_return_value = xy_curve_create ( "new_xy_curve", "new_xy_curve", 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_xy_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

Main Index

@ @ @ @

Chapter 7: XY Plot Functions 1327 Modify Action

#--------------------------------------------------------------------# Create a title s_title_name

= "new_title_name"

i_return_value = xy_title_create ( s_title_name, "T", 10, [77., 50.], 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the title text attributes # i_return_value = @ xy_title_text_get @ ( s_title_name, @ s_text, @ ra_location, @ i_text_color ) dump i_return_value dump s_text dump ra_location dump i_text_color #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the title text attributes s_text ra_location i_text_color

= "N" = [30., 65.] = 6

i_return_value = xy_title_text_set ( s_title_name, s_text, ra_location, i_text_color ) dump i_return_value

@ @ @ @ @

#--------------------------------------------------------------------# Reset the values. s_text = "" ra_location = [0., 0.] i_text_color = 0 #--------------------------------------------------------------------# Get the title text attributes # i_return_value = @ xy_title_text_get @ ( s_title_name, @ s_text, @ ra_location, @ i_text_color ) dump i_return_value dump s_text dump ra_location dump i_text_color #---------------------------------------------------------------------

Main Index

1328 PCL Reference Manual Examples Modify Action

xy_title_text_set

()

# # Purpose : This file provides an example of a call to the # function xy_title_text_set() # # This file opens a new database "new.db", # creates a window, a curve and a title in it. # Later it gets the text attributes for the title # Finally it sets the title text attributes and # gets them 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 xy_title_text_set() # has the following arguments: # # xy_title_text_set # ( title_name, # text, # location, # text_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_title_name[256] STRING s_text[256] REAL ra_location(2) INTEGER i_text_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window i_return_value = xy_window_create ( "new_xy_window", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Create XY curve i_return_value = xy_curve_create ( "new_xy_curve", "new_xy_curve", 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Assign data points to the curve i_return_value = xy_curve_data_set ( "new_xy_curve", FALSE, 5, [1., 3., 6., 8., 9.], [2., 8., 4., 9., 5.] ) dump i_return_value

Main Index

@ @ @ @

Chapter 7: XY Plot Functions 1329 Modify Action

#--------------------------------------------------------------------# Create a title s_title_name

= "new_title_name"

i_return_value = xy_title_create ( s_title_name, "T", 10, [77., 50.], 7 ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the title text attributes # i_return_value = @ xy_title_text_get @ ( s_title_name, @ s_text, @ ra_location, @ i_text_color ) dump i_return_value dump s_text dump ra_location dump i_text_color #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the title text attributes s_text ra_location i_text_color

= "N" = [30., 65.] = 6

i_return_value = xy_title_text_set ( s_title_name, s_text, ra_location, i_text_color ) dump i_return_value

@ @ @ @ @

#--------------------------------------------------------------------# Reset the values. s_text = "" ra_location = [0., 0.] i_text_color = 0 #--------------------------------------------------------------------# Get the title text attributes # i_return_value = @ xy_title_text_get @ ( s_title_name, @ s_text, @ ra_location, @ i_text_color ) dump i_return_value dump s_text dump ra_location dump i_text_color #---------------------------------------------------------------------

Main Index

1330 PCL Reference Manual Examples Modify Action

xy_window_background_color_get

()

# # Purpose : This file provides an example of two calls to # the function xy_window_background_color_get() # # This file opens a new database "new.db" and # creates a window in it. Later it gets the # graph background color for the window. Finally # it sets the graph background color 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 xy_window_background_color_get() # has the following arguments: # # xy_window_background_color_get # ( window_name, # bgcolor ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] INTEGER i_bgcolor INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window s_window_name

= "new_xy_window"

i_return_value = xy_window_create ( s_window_name, 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the graph background color for the window # i_return_value = @ xy_window_background_color_get @ ( s_window_name, @ i_bgcolor ) dump i_return_value dump i_bgcolor #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the graph background color IF( i_bgcolor == 0 ) THEN i_bgcolor = 8 ELSE

Main Index

Chapter 7: XY Plot Functions 1331 Modify Action

i_bgcolor = 0 ENDIF i_return_value = xy_window_background_color_set ( s_window_name, i_bgcolor ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_bgcolor = 0 #--------------------------------------------------------------------# Get the graph background color # i_return_value = @ xy_window_background_color_get @ ( s_window_name, @ i_bgcolor ) dump i_return_value dump i_bgcolor #---------------------------------------------------------------------

xy_window_background_color_set

()

# # Purpose : This file provides an example of a call to the # function xy_window_background_color_set() # # This file opens a new database "new.db" and # creates a window in it. Later it gets the # graph background color for the window. Finally # it sets the graph background color 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 xy_window_background_color_set() # has the following arguments: # # xy_window_background_color_set # ( window_name, # bgcolor ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] INTEGER i_bgcolor INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window s_window_name

= "new_xy_window"

i_return_value =

Main Index

@

1332 PCL Reference Manual Examples Modify Action

xy_window_create ( s_window_name, 2.5, 3.5, 5., 5. ) dump i_return_value

@

#--------------------------------------------------------------------# Get the graph background color for the window # i_return_value = @ xy_window_background_color_get @ ( s_window_name, @ i_bgcolor ) dump i_return_value dump i_bgcolor #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the graph background color IF( i_bgcolor == 0 ) THEN i_bgcolor = 8 ELSE i_bgcolor = 0 ENDIF i_return_value = xy_window_background_color_set ( s_window_name, i_bgcolor ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_bgcolor = 0 #--------------------------------------------------------------------# Get the graph background color # i_return_value = @ xy_window_background_color_get @ ( s_window_name, @ i_bgcolor ) dump i_return_value dump i_bgcolor #---------------------------------------------------------------------

()

xy_window_border_color_get # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_window_border_color_get() This file opens a new database "new.db" and creates a window in it. Later it gets the display border color for the window. Finally it sets the display border color 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 xy_window_border_color_get()

Chapter 7: XY Plot Functions 1333 Modify Action

# has the following arguments: # # xy_window_border_color_get # ( window_name, # border_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] INTEGER i_border_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window s_window_name

= "new_xy_window"

i_return_value = xy_window_create ( s_window_name, 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the display graph border flag to TRUE i_return_value = xy_window_display_border_set ( s_window_name, TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display border color for the window # i_return_value = @ xy_window_border_color_get @ ( s_window_name, @ i_border_color ) dump i_return_value dump i_border_color #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue. sf_pause() #--------------------------------------------------------------------# Set the display border color IF( i_border_color == 7 ) THEN i_border_color = 6 ELSE i_border_color = 7 ENDIF i_return_value = xy_window_border_color_set ( s_window_name, i_border_color ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_border_color = 0

Main Index

1334 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Get the display border color # i_return_value = @ xy_window_border_color_get @ ( s_window_name, @ i_border_color ) dump i_return_value dump i_border_color #---------------------------------------------------------------------

xy_window_border_color_set

()

# # Purpose : This file provides an example of a call to the # function xy_window_border_color_set() # # This file opens a new database "new.db" and # creates a window in it. Later it gets the # display border color for the window. Finally it # sets the display border color 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 xy_window_border_color_set() # has the following arguments: # # xy_window_border_color_set # ( window_name, # border_color ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] INTEGER i_border_color INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window s_window_name

= "new_xy_window"

i_return_value = xy_window_create ( s_window_name, 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the display graph border flag to TRUE i_return_value = xy_window_display_border_set ( s_window_name, TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display border color for the window

Main Index

Chapter 7: XY Plot Functions 1335 Modify Action

# i_return_value = xy_window_border_color_get ( s_window_name, i_border_color ) dump i_return_value dump i_border_color

@ @ @

#--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display border color IF( i_border_color == 7 ) THEN i_border_color = 6 ELSE i_border_color = 7 ENDIF i_return_value = xy_window_border_color_set ( s_window_name, i_border_color ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_border_color = 0 #--------------------------------------------------------------------# Get the display border color # i_return_value = @ xy_window_border_color_get @ ( s_window_name, @ i_border_color ) dump i_return_value dump i_border_color #---------------------------------------------------------------------

()

xy_window_border_linestyle_get # # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of two calls to the function xy_window_border_linestyle_get() This file opens a new database "new.db" and creates a window in it. Later it gets the border curve style for the window. Finally it sets the border curve style 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 xy_window_border_linestyle_get() has the following arguments: xy_window_border_linestyle_get ( window_name, curve_style )

1336 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] STRING s_curve_style[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window s_window_name

= "new_xy_window"

i_return_value = xy_window_create ( s_window_name, 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the display graph border flag to TRUE i_return_value = xy_window_display_border_set ( s_window_name, TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the border curve style for the window # i_return_value = @ xy_window_border_linestyle_get @ ( s_window_name, @ s_curve_style ) dump i_return_value dump s_curve_style #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the border curve style for the window IF( s_curve_style == "Solid" ) THEN s_curve_style = "Dotted" ELSE s_curve_style = "Solid" ENDIF i_return_value = xy_window_border_linestyle_set ( s_window_name, s_curve_style ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value s_curve_style = "" #--------------------------------------------------------------------# Get the border curve style for the window # i_return_value = @ xy_window_border_linestyle_get @ ( s_window_name, @

Main Index

Chapter 7: XY Plot Functions 1337 Modify Action

s_curve_style ) dump i_return_value dump s_curve_style #---------------------------------------------------------------------

xy_window_border_linestyle_set

()

# # Purpose : This file provides an example of a call to the # function xy_window_border_linestyle_set() # # This file opens a new database "new.db" and # creates a window in it. Later it gets the # border curve style for the window. Finally it # sets the border curve style 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 xy_window_border_linestyle_set() # has the following arguments: # # xy_window_border_linestyle_set # ( window_name, # curve_style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] STRING s_curve_style[32] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window s_window_name

= "new_xy_window"

i_return_value = xy_window_create ( s_window_name, 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the display graph border flag to TRUE i_return_value = xy_window_display_border_set ( s_window_name, TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the border curve style for the window # i_return_value = @ xy_window_border_linestyle_get @ ( s_window_name, @ s_curve_style ) dump i_return_value

Main Index

1338 PCL Reference Manual Examples Modify Action

dump s_curve_style #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the border curve style for the window IF( s_curve_style == "Solid" ) THEN s_curve_style = "Dotted" ELSE s_curve_style = "Solid" ENDIF i_return_value = xy_window_border_linestyle_set ( s_window_name, s_curve_style ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value s_curve_style = "" #--------------------------------------------------------------------# Get the border curve style for the window # i_return_value = @ xy_window_border_linestyle_get @ ( s_window_name, @ s_curve_style ) dump i_return_value dump s_curve_style #---------------------------------------------------------------------

xy_window_border_thickness_get

()

# # Purpose : This file provides an example of two calls to # the function xy_window_border_thickness_get() # # This file opens a new database "new.db" and # creates a window in it. Later it gets the # border thickness for the window. Finally it # sets the border thickness 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 xy_window_border_thickness_get() # has the following arguments: # # xy_window_border_thickness_get # ( window_name, # thickness ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] INTEGER i_thickness INTEGER i_return_value

Main Index

Chapter 7: XY Plot Functions 1339 Modify Action

#--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window s_window_name

= "new_xy_window"

i_return_value = xy_window_create ( s_window_name, 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the display graph border flag to TRUE i_return_value = xy_window_display_border_set ( s_window_name, TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the border thickness for the window # i_return_value = @ xy_window_border_thickness_get @ ( s_window_name, @ i_thickness ) dump i_return_value dump i_thickness #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the border thickness IF( i_thickness == 1 ) THEN i_thickness = 3 ELSE i_thickness = 1 ENDIF i_return_value = xy_window_border_thickness_set ( s_window_name, i_thickness ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_thickness = 0 #--------------------------------------------------------------------# Get the display border color # i_return_value = @ xy_window_border_thickness_get @ ( s_window_name, @ i_thickness ) dump i_return_value dump i_thickness #---------------------------------------------------------------------

Main Index

1340 PCL Reference Manual Examples Modify Action

xy_window_border_thickness_set

()

# # Purpose : This file provides an example of a call to the # function xy_window_border_thickness_set() # # This file opens a new database "new.db" and # creates a window in it. Later it gets the # border thickness for the window. Finally it # sets the border thickness 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 xy_window_border_thickness_set() # has the following arguments: # # xy_window_border_thickness_set # ( window_name, # thickness ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] INTEGER i_thickness INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window s_window_name

= "new_xy_window"

i_return_value = xy_window_create ( s_window_name, 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Set the display graph border flag to TRUE i_return_value = xy_window_display_border_set ( s_window_name, TRUE ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the border thickness for the window # i_return_value = @ xy_window_border_thickness_get @ ( s_window_name, @ i_thickness ) dump i_return_value dump i_thickness #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause()

Main Index

Chapter 7: XY Plot Functions 1341 Modify Action

#--------------------------------------------------------------------# Set the border thickness IF( i_thickness == 1 ) THEN i_thickness = 3 ELSE i_thickness = 1 ENDIF i_return_value = xy_window_border_thickness_set ( s_window_name, i_thickness ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Reset the value i_thickness = 0 #--------------------------------------------------------------------# Get the display border color # i_return_value = @ xy_window_border_thickness_get @ ( s_window_name, @ i_thickness ) dump i_return_value dump i_thickness #---------------------------------------------------------------------

xy_window_display_border_get

()

# # Purpose : This file provides an example of two calls to # the function xy_window_display_border_get() # # This file opens a new database "new.db" and # creates a window in it. Later it gets the # display graph border flag for the curve. # Finally it sets the display graph border flag # 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 xy_window_display_border_get() # has the following arguments: # # xy_window_display_border_get # ( window_name, # border_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] LOGICAL l_border_flag INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002

Main Index

1342 PCL Reference Manual Examples Modify Action

#--------------------------------------------------------------------# Create a new XY window s_window_name

= "new_xy_window"

i_return_value = xy_window_create ( s_window_name, 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display graph border flag # i_return_value = @ xy_window_display_border_get @ ( s_window_name, @ l_border_flag ) dump i_return_value dump l_border_flag #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display graph border flag IF( l_border_flag == TRUE ) THEN l_border_flag = FALSE ELSE l_border_flag = TRUE ENDIF i_return_value = xy_window_display_border_set ( s_window_name, l_border_flag ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Get the display graph border flag # i_return_value = @ xy_window_display_border_get @ ( s_window_name, @ l_border_flag ) dump i_return_value dump l_border_flag #---------------------------------------------------------------------

xy_window_display_border_set # # # # # # # # # # # #

Main Index

Purpose

:

()

This file provides an example of a call to the function xy_window_display_border_set() This file opens a new database "new.db" and creates a window in it. Later it gets the display graph border flag for the curve. Finally it sets the display graph border flag and gets it again. This file can be run by starting a session of Patran, and running this session file

Chapter 7: XY Plot Functions 1343 Modify Action

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function xy_window_display_border_set() # has the following arguments: # # xy_window_display_border_set # ( window_name, # border_flag ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] LOGICAL l_border_flag INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create a new XY window s_window_name

= "new_xy_window"

i_return_value = xy_window_create ( s_window_name, 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the display graph border flag # i_return_value = @ xy_window_display_border_get @ ( s_window_name, @ l_border_flag ) dump i_return_value dump l_border_flag #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Set the display graph border flag IF( l_border_flag == TRUE ) THEN l_border_flag = FALSE ELSE l_border_flag = TRUE ENDIF i_return_value = xy_window_display_border_set ( s_window_name, l_border_flag ) dump i_return_value

@ @ @

#--------------------------------------------------------------------# Get the display graph border flag # i_return_value = @ xy_window_display_border_get @ ( s_window_name, @ l_border_flag ) dump i_return_value

Main Index

1344 PCL Reference Manual Examples Modify Action

dump l_border_flag #---------------------------------------------------------------------

xy_window_id_get

()

# # Purpose : This file provides an example of a call to the # function xy_window_id_get() # # This file opens a new database "new.db" and # creates two windows in it. Later it gets the # IDs of these windows. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function xy_window_id_get() # has the following arguments: # # xy_window_id_get # ( window_name, # window_id ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] INTEGER i_window_id INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 #--------------------------------------------------------------------# Create two XY windows i_return_value = xy_window_create ( "xy_window_one", 2.5, 3.5, 5., 5. ) dump i_return_value

@ @

i_return_value = xy_window_create ( "xy_window_two", 3.5, 4.5, 5., 5. ) dump i_return_value

@ @

#--------------------------------------------------------------------# Get the ID of the first window # s_window_name = "xy_window_one" i_return_value = xy_window_id_get ( s_window_name, i_window_id ) dump i_return_value dump i_window_id

@ @ @

#--------------------------------------------------------------------# Get the ID of the second window # s_window_name = "xy_window_two"

Main Index

Chapter 7: XY Plot Functions 1345 Modify Action

i_return_value = xy_window_id_get ( s_window_name, i_window_id ) dump i_return_value dump i_window_id

@ @ @

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

Main Index

1346 PCL Reference Manual Examples Rename Action

Rename Action This section contains examples of some of the functions used to implement the “Rename” actions. ()

xy_window_rename

# # Purpose : This file provides an example of a call to the # function xy_window_rename() # # This session file opens a new database ’new.db’ # and a new xy window named ’XY_Window’ is # created. The above mentioned function is then # to rename this window to ’Renamed_XY_Window’. # # This file can be run by starting a session of # Patran, opening a new or existing database, # and running this session file through the # "File","Session","Play" pulldown menus # on the menu bar. # # The function xy_window_rename() # has the following arguments: # # xy_window_rename # ( window_name, # new_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_window_name[32] STRING s_new_name[32] INTEGER i_return_value #--------------------------------------------------------------------# Opening new database new.db uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" i_return_value = @ xy_window_create @ ( s_window_name, 1.5, 3.5, 5., 5.) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Rename the window s_window_name s_new_name

= "XY_Window" = "Renamed_XY_Window"

i_return_value = @ xy_window_rename @ ( s_window_name, @ s_new_name ) dump i_return_value #---------------------------------------------------------------------

Main Index

Chapter 7: XY Plot Functions 1347 Delete Action

Delete Action This section contains examples of some of the functions used to implement the “Delete” actions. xy_curve_delete

()

# # Purpose : This file provides an example of a call to the # function xy_curve_delete() # # This session file opens a new database ’new.db’ # A new xy window and a xy curve is created. The # above mentioned function is then called to # delete the curve from the xy window. # # This file can be run by starting a session of # Patran, opening a new or existing database, # and running this session file through the # "File","Session","Play" pulldown menus # on the menu bar. # # The function xy_curve_delete() # has the following arguments: # # xy_curve_delete # ( curve_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_curve_name[32] STRING s_window_name[32] INTEGER i_return_value REAL r_x_location REAL r_y_location REAL r_width REAL r_height #--------------------------------------------------------------------# Opening new database new.db uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = @ xy_window_create @ ( s_window_name, @ r_x_location, @ r_y_location, @ r_width, @ r_height ) dump i_return_value #--------------------------------------------------------------------# Create a curve i_return_value = @ xy_curve_create("curve_1", "data of x vs y", 1) dump i_return_value i_return_value = xy_curve_data_set ( "curve_1", FALSE, 10, [1., 2., 3., 4.,

Main Index

@ @ @

1348 PCL Reference Manual Examples Delete Action

5., 6., 7., 8., 9., 10.], [-5., 6., 4., @ -10., -7., 10., 15., 23., -20., -11.]) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue sf_pause() #--------------------------------------------------------------------# Delete the curve s_curve_name = "curve_1" i_return_value = @ xy_curve_delete @ ( s_curve_name ) dump i_return_value #---------------------------------------------------------------------

xy_title_delete

()

# # Purpose : This file provides an example of a call to the # function xy_title_delete() # # This session file opens a database ’new.db’ # and creates a new xy window. A title is # created and posted to the window. The above # mentioned function is then called to delete the # title. # # This file can be run by starting a session of # Patran, opening a new or existing database, # and running this session file through the # "File","Session","Play" pulldown menus # on the menu bar. # # The function xy_title_delete() # has the following arguments: # # xy_title_delete # ( title_name ) # #--------------------------------------------------------------------# Variable Declarations STRING s_title_name[256] STRING s_window_name[32] INTEGER i_return_value REAL r_x_location REAL r_y_location REAL r_width REAL r_height #--------------------------------------------------------------------# Opening new database new.db uil_file_new.go("","new.db") $? YES 36000002 # Create a new window. s_window_name = "XY_Window" r_x_location = 2.5 r_y_location = 3.5 r_width = 5.0 r_height = 5.0 i_return_value = xy_window_create ( s_window_name, r_x_location, r_y_location, r_width,

Main Index

@ @ @ @ @ @

Chapter 7: XY Plot Functions 1349 Delete Action

r_height ) dump i_return_value #--------------------------------------------------------------------# Create a title i_return_value = @ xy_title_create @ ( "TITLE_1", "TITLE_1", 14, [5.0, 10.0], 1) dump i_return_value #--------------------------------------------------------------------# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Delete the title s_title_name = "TITLE_1" i_return_value = @ xy_title_delete @ ( s_title_name) dump i_return_value #---------------------------------------------------------------------

Main Index

1350 PCL Reference Manual Examples Delete Action

Main Index

Chapter 8: Preference Functions PCL Reference Manual Examples

8

Main Index

Preference Functions 

Introduction



Analysis Preferences



Global Preferences



Graphics Preferences



Report Preferences



Geometry Preferences



Finite Element Preferences

1352 1353 1355 1373 1417 1421 1424

1352 PCL Reference Manual Examples Introduction

Introduction This chapter provides examples of some of the functions that are used to control the settings or preferences used by many of the other forms in Patran. See Preference Functions (Ch. 9) in the PCL Reference Manual for a description of these functions.

Main Index

Chapter 8: Preference Functions 1353 Analysis Preferences

Analysis Preferences This section contains examples of some of the functions used to govern some of the preferences used with the analysis of a model. .

uil_pref_analysis.set_analysis_pref

()

# # Purpose : This file provides an example of a call to the # function uil_pref_analysis.set_analysis_pref() # # This illustration opens a new database and gets # the analysis preference of the current database # Then it changes the analysis preferences 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 uil_pref_analysis.set_analysis_pref() # has the following arguments: # # uil_pref_analysis.set_analysis_pref # ( analysis_code, # analysis_type, # input_file_suffix, # output_file_suffix ) # #--------------------------------------------------------------------# Variable Declarations STRING s_analysis_code[128] STRING s_analysis_type[128] STRING s_input_file_suffix[128] STRING s_output_file_suffix[128] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Get the current analysis type and code with input and output # file suffix. i_return_value = @ pref_anal_get @ ( s_analysis_code, @ s_analysis_type, @ s_input_file_suffix, @ s_output_file_suffix ) dump i_return_value dump s_analysis_code, s_analysis_type dump s_input_file_suffix, s_output_file_suffix #--------------------------------------------------------------------# Change the input and output file suffix. s_input_file_suffix = "inp" s_output_file_suffix = "otp" uil_pref_analysis.set_analysis_pref ( s_analysis_code, s_analysis_type, s_input_file_suffix, s_output_file_suffix )

Main Index

@ @ @ @

1354 PCL Reference Manual Examples Analysis Preferences

#--------------------------------------------------------------------# Get the current analysis type and code with input and output # file suffix. i_return_value = @ pref_anal_get @ ( s_analysis_code, @ s_analysis_type, @ s_input_file_suffix, @ s_output_file_suffix ) dump i_return_value dump s_analysis_code, s_analysis_type dump s_input_file_suffix, s_output_file_suffix #---------------------------------------------------------------------

Main Index

Chapter 8: Preference Functions 1355 Global Preferences

Global Preferences This section contains examples of some of the functions used to govern some of the preferences used to control the global behavior of Patran. pref_geo_get_v1

()

# # Purpose : This file provides an example of a call to the # function pref_geo_get_v1() # # This illustration opens a new database and gets # the geometry preference of the current database # Then it changes the geometry preferences 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 pref_geo_get_v1() # has the following arguments: # # pref_geo_get_v1 # ( default_coord_frame, # geometric_tolerance, # working_plane ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_default_coord_frame REAL r_geometric_tolerance INTEGER i_working_plane INTEGER i_return_value STRING sv_asm_create_cord_3po_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Get the geometry preference settings. i_return_value = pref_geo_get_v1 ( i_default_coord_frame, r_geometric_tolerance, i_working_plane ) dump i_return_value

@ @ @ @

# Geometry preference settings are dump i_default_coord_frame dump r_geometric_tolerance dump i_working_plane #--------------------------------------------------------------------# Create a Coordinate frame i_return_value = @ asm_const_coord_3point( "1", "Coord 0", @ 1, "[0 0 0]", "[0 0 1]", "[1 0 0]", @ sv_asm_create_cord_3po_creat_id ) dump i_return_value #--------------------------------------------------------------------# Set a different Geometry preference

Main Index

1356 PCL Reference Manual Examples Global Preferences

i_default_coord_frame = 1 r_geometric_tolerance = 0.005 i_working_plane = 1 i_return_value = @ pref_geo_set_v1 @ ( i_default_coord_frame, @ r_geometric_tolerance, @ i_working_plane) dump i_return_value #--------------------------------------------------------------------# Get the geometry preference settings. i_return_value = @ pref_geo_get_v1 @ ( i_default_coord_frame, @ r_geometric_tolerance, @ i_working_plane ) dump i_return_value # Geometry preference settings are dump i_default_coord_frame dump r_geometric_tolerance dump i_working_plane sys_free_string(sv_asm_create_cord_3po_creat_id) #---------------------------------------------------------------------

pref_geo_get

()

# # Purpose : This file provides an example of a call to the # function pref_geo_set() # # This illustration opens a new database and gets # the geometry preference of the current database # Then it changes the geometry preferences 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 pref_geo_set() has the following arguments: # # pref_geo_set # ( default_coord_frame, # geometric_tolerance ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_default_coord_frame REAL r_geometric_tolerance INTEGER i_return_value STRING sv_asm_create_cord_3po_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Get the geometry preference settings. i_return_value = pref_geo_get ( i_default_coord_frame, r_geometric_tolerance )

Main Index

@ @ @

Chapter 8: Preference Functions 1357 Global Preferences

dump i_return_value # Geometry preference settings are dump i_default_coord_frame dump r_geometric_tolerance #--------------------------------------------------------------------# Create a Coordinate frame i_return_value = @ asm_const_coord_3point( "1", "Coord 0", @ 1, "[0 0 0]", "[0 0 1]", "[1 0 0]", @ sv_asm_create_cord_3po_creat_id ) dump i_return_value #--------------------------------------------------------------------# Set a different Geometry preference i_default_coord_frame = 1 r_geometric_tolerance = 0.005 i_return_value = @ pref_geo_set @ ( i_default_coord_frame, @ r_geometric_tolerance ) dump i_return_value #--------------------------------------------------------------------# Get the geometry preference settings. i_return_value = @ pref_geo_get @ ( i_default_coord_frame, @ r_geometric_tolerance ) dump i_return_value # Geometry preference settings are dump i_default_coord_frame dump r_geometric_tolerance sys_free_string(sv_asm_create_cord_3po_creat_id) #---------------------------------------------------------------------

pref_geo_set

()

# # Purpose : This file provides an example of a call to the # function pref_geo_set() # # This illustration opens a new database and gets # the geometry preference of the current database # Then it changes the geometry preferences 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 pref_geo_set() has the following arguments: # # pref_geo_set # ( default_coord_frame, # geometric_tolerance ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_default_coord_frame REAL r_geometric_tolerance INTEGER i_return_value

Main Index

1358 PCL Reference Manual Examples Global Preferences

STRING sv_asm_create_cord_3po_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Get the geometry preference settings. i_return_value = pref_geo_get ( i_default_coord_frame, r_geometric_tolerance ) dump i_return_value

@ @ @

# Geometry preference settings are dump i_default_coord_frame dump r_geometric_tolerance #--------------------------------------------------------------------# Create a Coordinate frame i_return_value = @ asm_const_coord_3point( "1", "Coord 0", @ 1, "[0 0 0]", "[0 0 1]", "[1 0 0]", @ sv_asm_create_cord_3po_creat_id ) dump i_return_value #--------------------------------------------------------------------# Set a different Geometry preference i_default_coord_frame = 1 r_geometric_tolerance = 0.005 i_return_value = @ pref_geo_set @ ( i_default_coord_frame, @ r_geometric_tolerance ) dump i_return_value #--------------------------------------------------------------------# Get the geometry preference settings. i_return_value = @ pref_geo_get @ ( i_default_coord_frame, @ r_geometric_tolerance ) dump i_return_value # Geometry preference settings are dump i_default_coord_frame dump r_geometric_tolerance sys_free_string(sv_asm_create_cord_3po_creat_id) #---------------------------------------------------------------------

()

pref_geo_set_v1 # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function pref_geo_set_v1() This illustration opens a new database and gets the geometry preference of the current database Then it changes the geometry preferences 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.

Chapter 8: Preference Functions 1359 Global Preferences

# The function pref_geo_set_v1() has the following arguments: # # pref_geo_set_v1 # ( default_coord_frame, # geometric_tolerance, # working_plane ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_default_coord_frame REAL r_geometric_tolerance INTEGER i_working_plane INTEGER i_return_value STRING sv_asm_create_cord_3po_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Get the geometry preference settings. i_return_value = pref_geo_get_v1 ( i_default_coord_frame, r_geometric_tolerance, i_working_plane ) dump i_return_value

@ @ @ @

# Geometry preference settings are dump i_default_coord_frame dump r_geometric_tolerance dump i_working_plane #--------------------------------------------------------------------# Create a Coordinate frame i_return_value = @ asm_const_coord_3point( "1", "Coord 0", @ 1, "[0 0 0]", "[0 0 1]", "[1 0 0]", @ sv_asm_create_cord_3po_creat_id ) dump i_return_value #--------------------------------------------------------------------# Set a different Geometry preference i_default_coord_frame = 1 r_geometric_tolerance = 0.005 i_working_plane = 1 i_return_value = @ pref_geo_set_v1 @ ( i_default_coord_frame, @ r_geometric_tolerance, @ i_working_plane) dump i_return_value #--------------------------------------------------------------------# Get the geometry preference settings. i_return_value = @ pref_geo_get_v1 @ ( i_default_coord_frame, @ r_geometric_tolerance, @ i_working_plane ) dump i_return_value # Geometry preference settings are dump i_default_coord_frame dump r_geometric_tolerance dump i_working_plane sys_free_string(sv_asm_create_cord_3po_creat_id) #---------------------------------------------------------------------

Main Index

1360 PCL Reference Manual Examples Global Preferences

pref_global_get

()

# # Purpose : This file provides an example of a call to the # function pref_global_get() # # This illustration opens a new database and gets # the global preference of the current database. # Then it changes the global preferences and # gets it again. Finally it changes the global # preference settings into the original value. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function pref_global_get() # has the following arguments: # # pref_global_get # ( confirm, # warning_message, # global_tolerance ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_confirm INTEGER i_warning_message REAL r_global_tolerance,r_old_tolerance INTEGER i_return_value #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Get the global preference settings. i_return_value = pref_global_get ( l_confirm, i_warning_message, r_global_tolerance ) dump i_return_value

@ @ @ @

# Global preference settings are dump l_confirm, i_warning_message, r_global_tolerance #--------------------------------------------------------------------# Set new Global preference settings. IF (l_confirm == TRUE) THEN l_confirm = FALSE ELSE l_confirm = TRUE END IF IF ( i_warning_message == 3 ) THEN i_warning_message = 2 ELSE i_warning_message = 3 END IF r_old_tolerance = r_global_tolerance r_global_tolerance = 0.009 i_return_value = pref_global_set

Main Index

@ @

Chapter 8: Preference Functions 1361 Global Preferences

(

l_confirm, @ i_warning_message, @ r_global_tolerance ) dump i_return_value #--------------------------------------------------------------------# Get the global preference settings. i_return_value = @ pref_global_get @ ( l_confirm, @ i_warning_message, @ r_global_tolerance ) dump i_return_value # Global preference settings are dump l_confirm, i_warning_message, r_global_tolerance #--------------------------------------------------------------------# Set the original values of Global preference settings. IF (l_confirm == TRUE) THEN l_confirm = FALSE ELSE l_confirm = TRUE END IF IF ( i_warning_message == 3 ) THEN i_warning_message = 2 ELSE i_warning_message = 3 END IF r_global_tolerance = r_old_tolerance i_return_value = @ pref_global_set @ ( l_confirm, @ i_warning_message, @ r_global_tolerance ) dump i_return_value #---------------------------------------------------------------------

pref_global_set

()

# # Purpose : This file provides an example of a call to the # function pref_global_set() # # This illustration opens a new database and gets # the global preference of the current database. # Then it changes the global preferences and # gets it again. Finally it changes the global # preference settings into the original value. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function pref_global_set() has the following arguments: # # pref_global_set # ( confirm, # warning_message, # global_tolerance ) # #--------------------------------------------------------------------# Variable Declarations

Main Index

1362 PCL Reference Manual Examples Global Preferences

LOGICAL l_confirm INTEGER i_warning_message REAL r_global_tolerance, r_old_tolerance INTEGER i_return_value #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Get the global preference settings. i_return_value = pref_global_get ( l_confirm, i_warning_message, r_global_tolerance ) dump i_return_value

@ @ @ @

# Global preference settings are dump l_confirm, i_warning_message, r_global_tolerance #--------------------------------------------------------------------# Set new Global preference settings. IF (l_confirm == TRUE) THEN l_confirm = FALSE ELSE l_confirm = TRUE END IF IF ( i_warning_message == 3 ) THEN i_warning_message = 2 ELSE i_warning_message = 3 END IF r_old_tolerance = r_global_tolerance r_global_tolerance = 0.009 i_return_value = @ pref_global_set @ ( l_confirm, @ i_warning_message, @ r_global_tolerance ) dump i_return_value #--------------------------------------------------------------------# Get the global preference settings. i_return_value = @ pref_global_get @ ( l_confirm, @ i_warning_message, @ r_global_tolerance ) dump i_return_value # Global preference settings are dump l_confirm, i_warning_message, r_global_tolerance #--------------------------------------------------------------------# Set the original values of Global preference settings. IF (l_confirm == TRUE) THEN l_confirm = FALSE ELSE l_confirm = TRUE END IF IF ( i_warning_message == 3 ) THEN i_warning_message = 2 ELSE i_warning_message = 3 END IF

Main Index

Chapter 8: Preference Functions 1363 Global Preferences

r_global_tolerance = r_old_tolerance i_return_value = @ pref_global_set @ ( l_confirm, @ i_warning_message, @ r_global_tolerance ) dump i_return_value #---------------------------------------------------------------------

pref_env_get_integer

()

# # Purpose : This file provides an example of a call to the # function pref_env_get_integer() # # In this illustration, the value of a Integer # preference "message_warning" is changed. Then # again the old value is set to that Integer # preference. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function pref_env_get_integer() has the following arguments: # # pref_env_get_integer # ( preference_name, # integer_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_preference_name[128] INTEGER i_integer_value, i_old_value INTEGER i_return_value #--------------------------------------------------------------------# Get the value of the Integer preference "message_warning" # s_preference_name = "message_warning" i_return_value = pref_env_get_integer ( s_preference_name, i_integer_value ) dump i_return_value

@ @ @

# Value of "message_warning" is dump i_integer_value #--------------------------------------------------------------------# Set a different value to the Integer Preference. i_old_value = i_integer_value IF (i_integer_value == 3) THEN i_integer_value = 2 ELSE i_integer_value = 3 END IF i_return_value = @ pref_env_set_integer @ ( s_preference_name, @ i_integer_value ) dump i_return_value #---------------------------------------------------------------------

Main Index

1364 PCL Reference Manual Examples Global Preferences

# Get the value of the Integer preference "message_warning" # i_return_value = @ pref_env_get_integer @ ( s_preference_name, @ i_integer_value ) dump i_return_value # Value of "message_warning" is dump i_integer_value #--------------------------------------------------------------------# Set the original value to the Integer Preference. i_integer_value = i_old_value i_return_value = @ pref_env_set_integer @ ( s_preference_name, @ i_integer_value ) dump i_return_value #---------------------------------------------------------------------

pref_env_get_logical

()

# # Purpose : This file provides an example of a call to the # function pref_env_get_logical() # # In this illustration, the value of a Logical # preference "revert_enabled" is changed. Then # again the old value is set to that Logical # preference. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function pref_env_get_logical() has the following arguments: # # pref_env_get_logical # ( preference_name, # logical_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_preference_name[128] LOGICAL l_logical_value, l_old_value INTEGER i_return_value #--------------------------------------------------------------------# Get the value of the Logical preference "revert_enabled" # s_preference_name = "revert_enabled" # i_return_value = @ pref_env_get_logical @ ( s_preference_name, @ l_logical_value ) dump i_return_value # Value of "revert_enabled" is dump l_logical_value #--------------------------------------------------------------------# Set a different value to the Logical Preference. l_old_value = l_logical_value

Main Index

Chapter 8: Preference Functions 1365 Global Preferences

IF (l_logical_value == TRUE) THEN l_logical_value = FALSE ELSE l_logical_value = TRUE END IF i_return_value = @ pref_env_set_logical @ ( s_preference_name, @ l_logical_value ) dump i_return_value #--------------------------------------------------------------------# Get the value of the Logical preference "revert_enabled" # i_return_value = @ pref_env_get_logical @ ( s_preference_name, @ l_logical_value ) dump i_return_value # Value of "revert_enabled" is dump l_logical_value #--------------------------------------------------------------------# Set the old value to the Logical Preference. l_logical_value= l_old_value i_return_value = @ pref_env_set_logical @ ( s_preference_name, @ l_logical_value ) dump i_return_value #---------------------------------------------------------------------

pref_env_get_real

()

# # Purpose : This file provides an example of a call to the # function pref_env_get_real() # # In this illustration, the value of a real # preference "hc_letter_ht" is changed. Then # the old value is set to that real preference. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function pref_env_get_real() has the following arguments: # # pref_env_get_real # ( preference_name, # real_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_preference_name[128] REAL r_real_value, r_old_value INTEGER i_return_value #--------------------------------------------------------------------# Get the value of the real preference "hc_letter_ht". # s_preference_name = "hc_letter_ht" i_return_value =

Main Index

@

1366 PCL Reference Manual Examples Global Preferences

pref_env_get_real ( s_preference_name, r_real_value ) dump i_return_value

@ @

# The value of the preference is dump r_real_value #--------------------------------------------------------------------# Set a different value to the preference. r_old_value = r_real_value r_real_value = 0.5 i_return_value = @ pref_env_set_real @ ( s_preference_name, @ r_real_value ) dump i_return_value #--------------------------------------------------------------------# Get the value of the real preference "hc_letter_ht". # i_return_value = @ pref_env_get_real @ ( s_preference_name, @ r_real_value ) dump i_return_value # The value of the preference is dump r_real_value #--------------------------------------------------------------------# Set a different value to the preference. r_real_value = r_old_value i_return_value = @ pref_env_set_real @ ( s_preference_name, @ r_real_value ) dump i_return_value #---------------------------------------------------------------------

pref_env_get_string

()

# # Purpose : This file provides an example of a call to the # function pref_env_get_string() # # In this illustration, the value of a String # preference "graphics_fullcolor" is changed. # Then again the old value is set to that String # preference. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function pref_env_get_string() has the following arguments: # # pref_env_get_string # ( preference_name, # string_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_preference_name[128] STRING s_string_value[128], s_old_value[128] INTEGER i_return_value #---------------------------------------------------------------------

Main Index

Chapter 8: Preference Functions 1367 Global Preferences

# Get the value of the String preference "graphics_fullcolor" # s_preference_name = "graphics_fullcolor" # i_return_value = @ pref_env_get_string @ ( s_preference_name, @ s_string_value ) dump i_return_value # The value of the string preference is dump s_string_value #--------------------------------------------------------------------# Set a different value to the String Preference s_old_value = s_string_value IF (s_string_value == "NO") THEN s_string_value = "YES" ELSE s_string_value = "NO" END IF i_return_value = @ pref_env_set_string @ ( s_preference_name, @ s_string_value ) dump i_return_value #--------------------------------------------------------------------# Get the value of the String preference "graphics_fullcolor" # i_return_value = @ pref_env_get_string @ ( s_preference_name, @ s_string_value ) dump i_return_value # The value of the string preference is dump s_string_value #--------------------------------------------------------------------# Set the original value to the String Preference s_string_value = s_old_value i_return_value = @ pref_env_set_string @ ( s_preference_name, @ s_string_value ) dump i_return_value #---------------------------------------------------------------------

()

pref_env_set_integer # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function pref_env_set_integer() In this illustration, the value of an Integer preference "message_warning" is changed. Then again the old value is set to that Integer preference. This file can be run by starting a session of Patran and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

1368 PCL Reference Manual Examples Global Preferences

# # The function pref_env_set_integer() has the following arguments: # # pref_env_set_integer # ( preference_name, # integer_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_preference_name[128] INTEGER i_integer_value, i_old_value INTEGER i_return_value #--------------------------------------------------------------------# Get the value of the Integer preference "message_warning" # s_preference_name = "message_warning" i_return_value = pref_env_get_integer ( s_preference_name, i_integer_value ) dump i_return_value

@ @ @

# Value of "message_warning" is dump i_integer_value #--------------------------------------------------------------------# Set a different value to the Integer Preference. i_old_value = i_integer_value IF (i_integer_value == 3) THEN i_integer_value = 2 ELSE i_integer_value = 3 END IF i_return_value = @ pref_env_set_integer @ ( s_preference_name, @ i_integer_value ) dump i_return_value #--------------------------------------------------------------------# Get the value of the Integer preference "message_warning" # i_return_value = @ pref_env_get_integer @ ( s_preference_name, @ i_integer_value ) dump i_return_value # Value of "message_warning" is dump i_integer_value #--------------------------------------------------------------------# Set the original value to the Integer Preference. i_integer_value = i_old_value i_return_value = @ pref_env_set_integer @ ( s_preference_name, @ i_integer_value ) dump i_return_value #---------------------------------------------------------------------

Main Index

Chapter 8: Preference Functions 1369 Global Preferences

pref_env_set_logical

()

# # Purpose : This file provides an example of a call to the # function pref_env_set_logical() # # In this illustration, the value of a Logical # preference "revert_enabled" is changed. Then # again the old value is set to that Logical # preference. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function pref_env_set_logical() has the following arguments: # pref_env_set_logical # ( preference_name, # logical_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_preference_name[128] LOGICAL l_logical_value, l_old_value INTEGER i_return_value #--------------------------------------------------------------------# Get the value of the Logical preference "revert_enabled" # s_preference_name = "revert_enabled" # i_return_value = @ pref_env_get_logical @ ( s_preference_name, @ l_logical_value ) dump i_return_value # Value of "revert_enabled" is dump l_logical_value #--------------------------------------------------------------------# Set a different value to the Logical Preference. l_old_value = l_logical_value IF (l_logical_value == TRUE) THEN l_logical_value = FALSE ELSE l_logical_value = TRUE END IF i_return_value = @ pref_env_set_logical @ ( s_preference_name, @ l_logical_value ) dump i_return_value #--------------------------------------------------------------------# Get the value of the Logical preference "revert_enabled" # i_return_value = @ pref_env_get_logical @ ( s_preference_name, @ l_logical_value ) dump i_return_value #

Main Index

Value of "revert_enabled" is

1370 PCL Reference Manual Examples Global Preferences

dump l_logical_value #--------------------------------------------------------------------# Set the old value to the Logical Preference. l_logical_value= l_old_value i_return_value = @ pref_env_set_logical @ ( s_preference_name, @ l_logical_value ) dump i_return_value #---------------------------------------------------------------------

pref_env_set_real

()

# # Purpose : This file provides an example of a call to the # function pref_env_set_real() # # In this illustration, the value of a real # preference "hc_letter_ht" is changed. Then # the old value is set to that real preference. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function pref_env_set_real() has the following arguments: # # pref_env_set_real # ( preference_name, # real_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_preference_name[128] REAL r_real_value, r_old_value INTEGER i_return_value #--------------------------------------------------------------------# Get the value of the real preference "hc_letter_ht". # s_preference_name = "hc_letter_ht" i_return_value = pref_env_get_real ( s_preference_name, r_real_value ) dump i_return_value

@ @ @

# The value of the preference is dump r_real_value #--------------------------------------------------------------------# Set a different value to the preference. r_old_value = r_real_value r_real_value = 0.5 i_return_value = @ pref_env_set_real @ ( s_preference_name, @ r_real_value ) dump i_return_value #--------------------------------------------------------------------# Get the value of the real preference "hc_letter_ht". # i_return_value = @

Main Index

Chapter 8: Preference Functions 1371 Global Preferences

pref_env_get_real ( s_preference_name, r_real_value ) dump i_return_value

@ @

# The value of the preference is dump r_real_value #--------------------------------------------------------------------# Set a different value to the preference. r_real_value = r_old_value i_return_value = @ pref_env_set_real @ ( s_preference_name, @ r_real_value ) dump i_return_value #---------------------------------------------------------------------

pref_env_set_string

()

# # Purpose : This file provides an example of a call to the # function pref_env_set_string() # # In this illustration, the value of a String # preference "graphics_fullcolor" is changed. # Then again the old value is set to that String # preference. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function pref_env_set_string() has the following arguments: # # pref_env_set_string # ( preference_name, # string_value ) # #--------------------------------------------------------------------# Variable Declarations STRING s_preference_name[128] STRING s_string_value[128], s_old_value[128] INTEGER i_return_value #--------------------------------------------------------------------# Get the value of the String preference "graphics_fullcolor" # s_preference_name = "graphics_fullcolor" # i_return_value = @ pref_env_get_string @ ( s_preference_name, @ s_string_value ) dump i_return_value # The value of the string preference is dump s_string_value #--------------------------------------------------------------------# Set a different value to the String Preference s_old_value = s_string_value IF (s_string_value == "NO") THEN s_string_value = "YES" ELSE

Main Index

1372 PCL Reference Manual Examples Global Preferences

s_string_value = "NO" END IF i_return_value = @ pref_env_set_string @ ( s_preference_name, @ s_string_value ) dump i_return_value #--------------------------------------------------------------------# Get the value of the String preference "graphics_fullcolor" # i_return_value = @ pref_env_get_string @ ( s_preference_name, @ s_string_value ) dump i_return_value # The value of the string preference is dump s_string_value #--------------------------------------------------------------------# Set the original value to the String Preference s_string_value = s_old_value i_return_value = @ pref_env_set_string @ ( s_preference_name, @ s_string_value ) dump i_return_value #---------------------------------------------------------------------

Main Index

Chapter 8: Preference Functions 1373 Graphics Preferences

Graphics Preferences This section contains examples of some of the functions used to govern some of the preferences used to control how graphics are displayed to the user. bar_elem_color

()

# # Purpose : This file provides an example of two calls to # the function bar_elem_color() # # This illustration opens a new database and # creates two nodes in it. Then it creates a bar # element and changes its colour. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function bar_elem_color() has the following arguments: # bar_elem_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_fem_create_node__nodes_creat[VIRTUAL] STRING sv_fem_create_elemen_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Create two points i_return_value = asm_const_grid_xyz( "", "[0 0 0][10 0 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id ) dump i_return_value # Create two nodes i_return_value = fem_create_nodes( "Coord 0", "Coord 0", TRUE, "1", "Point 1 2 ", sv_fem_create_node__nodes_creat ) dump i_return_value

@ @ @

@ @ @

# Show the label of bar element bar_elem_label(TRUE) # Create a beam element i_return_value = fem_create_elems( "Bar ", "Bar2", "1", "Standard", TRUE, "Node 2 ", "Node 1 ", "", "", "", "", "", "", sv_fem_create_elemen_elem_creat ) dump i_return_value # Set the colour of the beam element to Red i_color_value = 1

Main Index

@ @ @ @ @

1374 PCL Reference Manual Examples Graphics Preferences

bar_elem_color ( i_color_value )

@

# Observe the colour. # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of the beam element to BLUE i_color_value = 4 bar_elem_color ( i_color_value )

@

sys_free_string( sv_asm_create_grid_xyz_creat_id ) sys_free_string( sv_fem_create_node__nodes_creat ) sys_free_string( sv_fem_create_elemen_elem_creat ) #---------------------------------------------------------------------

bar_elem_label

()

# # Purpose : This file provides an example of two calls to # the function bar_elem_label() # # This illustration opens a new database and # creates two nodes in it. Then it creates a bar # element and sets its label on and off. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function bar_elem_label() has the following arguments: # # bar_elem_label # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_fem_create_node__nodes_creat[VIRTUAL] STRING sv_fem_create_elemen_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Create two points i_return_value = asm_const_grid_xyz( "", "[0 0 0][10 0 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id ) dump i_return_value # Create two nodes i_return_value = fem_create_nodes( "Coord 0", "Coord 0", TRUE, "1", "Point 1 2 ", sv_fem_create_node__nodes_creat ) dump i_return_value #

Main Index

Create a beam element

@ @ @

@ @ @

Chapter 8: Preference Functions 1375 Graphics Preferences

i_return_value = @ fem_create_elems( "Bar ", "Bar2", @ "1", "Standard", @ TRUE, "Node 2 ", "Node 1 ", @ "", "", "", "", "", "", @ sv_fem_create_elemen_elem_creat ) dump i_return_value #--------------------------------------------------------------------# Set the label of the beam element. l_label_status = TRUE bar_elem_label ( l_label_status )

@

# Observe the label. # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set off the label of the beam element. l_label_status = FALSE bar_elem_label ( l_label_status )

@

sys_free_string( sv_asm_create_grid_xyz_creat_id ) sys_free_string( sv_fem_create_node__nodes_creat ) sys_free_string( sv_fem_create_elemen_elem_creat ) #---------------------------------------------------------------------

Main Index

1376 PCL Reference Manual Examples Graphics Preferences

body_color

()

# # Purpose : This file provides an example of a call to the # function body_color() # # This illustration opens a new database and # creates a B-Rep solid in it. It changes its # colour to Red and then Blue. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function body_color() has the following arguments: # # body_color # ( colour_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_colour_value INTEGER i_return_value LOGICAL l_label_status STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] STRING sv_sgm_create_solid_br_creat_id[VIRTUAL] STRING sv_asm_delete_any_deleted_ids[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Create 6 patches. i_return_value = asm_const_patch_xyz( "", "<1 1 0><1 0 1>"// "<0 1 1><0 1 1><1 0 1><1 1 0>", "[0 0 0][0 0 0][0 0 0][1 0 0]" // "[0 1 0][0 0 1]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value

@ @ @ @ @

i_return_value = @ sgm_construct_solid_brep( "1", "Surface 1:6", @ FALSE, sv_sgm_create_solid_br_creat_id ) dump i_return_value # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@ @

# Set the body label ON l_label_status = TRUE i_return_value = body_label ( l_label_status ) dump i_return_value # Delete the Surfaces i_return_value = asm_delete_surface( "Surface 1:6 ", sv_asm_delete_any_deleted_ids )

Main Index

@ @

@ @

Chapter 8: Preference Functions 1377 Graphics Preferences

dump i_return_value # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the body colour to Red (Colour value = 1) # i_colour_value = 1 i_return_value = body_color ( i_colour_value ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the body colour to BLUE (Colour value = 4) # i_colour_value = 4 i_return_value = body_color ( i_colour_value ) dump i_return_value

@ @

sys_free_string( sv_asm_create_patch_xy_creat_id ) sys_free_string( sv_sgm_create_solid_br_creat_id ) sys_free_string( sv_asm_delete_any_deleted_ids ) #---------------------------------------------------------------------

body_label

()

# # Purpose : This file provides an example of a call to the # function body_label() # # This illustration opens a new database and # creates a B-Rep solid in it. It changes its # label ON and OFF. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function body_label() has the following arguments: # body_label # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] STRING sv_sgm_create_solid_br_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Create 6 patches. i_return_value = asm_const_patch_xyz( "", "<1 1 0><1 0 1>"// "<0 1 1><0 1 1><1 0 1><1 1 0>", "[0 0 0][0 0 0][0 0 0][1 0 0]" //

Main Index

@ @ @ @

1378 PCL Reference Manual Examples Graphics Preferences

"[0 1 0][0 0 1]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value

@

i_return_value = @ sgm_construct_solid_brep( "1", "Surface 1:6", @ FALSE, sv_sgm_create_solid_br_creat_id ) dump i_return_value # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the body label ON # l_label_status = TRUE i_return_value = body_label ( l_label_status ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the body label OFF # l_label_status = FALSE i_return_value = body_label ( l_label_status ) dump i_return_value

@ @

sys_free_string( sv_asm_create_patch_xy_creat_id ) sys_free_string( sv_sgm_create_solid_br_creat_id ) #---------------------------------------------------------------------

curve_color

()

# # Purpose : This file provides an example of two calls to # the function curve_color() # # This illustration opens a new database and # creates a Curve in it. Then the colour of # the Curve is changed. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function curve_color() has the following arguments: # # curve_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value

Main Index

Chapter 8: Preference Functions 1379 Graphics Preferences

INTEGER i_return_value STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the Curves curve_label(TRUE) # Create a line i_return_value = @ asm_const_line_xyz( "1", "<1 0 0>", @ "[0 0 0]", "Coord 0", @ sv_asm_create_line_xyz_creat_id ) dump i_return_value #--------------------------------------------------------------------# Set the curve colour to Red i_color_value = 1 curve_color ( i_color_value )

@

# Observe the colour. # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the Curve colour to Green i_color_value = 11 curve_color ( i_color_value )

@

sys_free_string( sv_asm_create_line_xyz_creat_id ) #---------------------------------------------------------------------

curve_label

()

# # Purpose : This file provides an example of two calls to # the function curve_label() # # This illustration opens a new database and # creates a Curve in it. Then the label of # the Curve is set on and off. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function curve_label() has the following arguments: # # curve_label # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_line_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002

Main Index

1380 PCL Reference Manual Examples Graphics Preferences

# Create a line i_return_value = @ asm_const_line_xyz( "1", "<1 0 0>", @ "[0 0 0]", "Coord 0", @ sv_asm_create_line_xyz_creat_id ) dump i_return_value #--------------------------------------------------------------------# Set the curve label l_label_status = TRUE curve_label ( l_label_status )

@

# Observe the colour. # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set OFF the curve label l_label_status = FALSE curve_label ( l_label_status )

@

sys_free_string( sv_asm_create_line_xyz_creat_id ) #---------------------------------------------------------------------

display_deformations

()

# # Purpose : This file provides an example of a call to the # function display_deformations() # # In this example a field.db is opened and the # deform plot is initialized. Then the function # is called to switch off the deform plot. # # 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 display_deformation() # has the following arguments: # # display_deformations # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value #--------------------------------------------------------------------# Open the database "field.db" uil_file_open.go("field.db") # Set the view i_return_value = @ ga_view_aa_set @ ( -67., 0., -34. ) dump i_return_value #---------------------------------------------------------------------

Main Index

Chapter 8: Preference Functions 1381 Graphics Preferences

#

Initialize for deform plot.

i_return_value = res_init_deform_plot( dump i_return_value

@ )

i_return_value = res_create_deform_plot_rec2( 1, 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

@ )

# Session file paused. Press "Resume" to continue.. sf_pause() #--------------------------------------------------------------------# Switch off the display of deformation # l_label_status = FALSE i_return_value = @ display_deformations @ ( l_label_status ) dump i_return_value #---------------------------------------------------------------------

display_fa_vectors

()

# # Purpose : This file provides an example of a call to the # function display_fa_vectors() # # In this example a new database is opened and # a patch is created. An LBC is created over the # patch. Then the function is called to switch # off the display of functional assignment # vectors. Again, the vectors are displayed. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function display_fa_vectors() has the following arguments: # display_fa_vectors # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002

Main Index

1382 PCL Reference Manual Examples Graphics Preferences

# Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@ @

# Create a Patch. i_return_value = asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value

@ @

# Create a LBC. i_return_value = loadsbcs_create( "New", "Displacement", "Nodal", "", "Static", ["Surface 1"], "Geometry", "Coord 0", 1., ["< 0 0 0 >", "< 0 0 0 >"], ["", ""] ) dump i_return_value

@ @ @ @

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Switch OFF the display of functional assignment vectors. l_label_status = FALSE i_return_value = display_fa_vectors ( l_label_status ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Switch ON the display of functional assignment vectors. l_label_status = TRUE i_return_value = display_fa_vectors ( l_label_status ) dump i_return_value

@ @

sys_free_string( sv_asm_create_patch_xy_creat_id ) #---------------------------------------------------------------------

()

display_result_vectors # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function display_result_vectors() In this example a field.db is opened and the vector plot is initialized. Then the function is called to switch off the vector plot. 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 display_result_vectors() has the following arguments:

Chapter 8: Preference Functions 1383 Graphics Preferences

# display_result_vectors # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value #--------------------------------------------------------------------# Open the database "field.db" uil_file_open.go("field.db") # Set the view i_return_value = @ ga_view_aa_set @ ( -67., 0., -34. ) dump i_return_value #--------------------------------------------------------------------# Create Vector plot with default options i_return_value = @ ga_range_create( "vector_range", 15 ) dump i_return_value i_return_value = ga_viewport_range_set( "", "vector_range" ) dump i_return_value

@

i_return_value = res_init_vector_plot( dump i_return_value

@ )

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

@ @ @

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

@ @ @

i_return_value = res_deinit_vector_plot( dump i_return_value

@ )

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Switch the vector plot OFF. # l_label_status = FALSE i_return_value = @ display_result_vectors @ ( l_label_status ) dump i_return_value #---------------------------------------------------------------------

()

hex_elem_color # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function hex_elem_color() This illustration opens a new database and creates a hyperpatch in it.It creates mesh seed

1384 PCL Reference Manual Examples Graphics Preferences

# and meshes with Hexagonal elements. Later it # sets its clour to Red and Blue. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function hex_elem_color() has the following arguments: # hex_elem_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value STRING sv_asm_create_hpat_xyz_creat_id[VIRTUAL] INTEGER i_fem_create_mesh_solid_nu_node INTEGER i_fem_create_mesh_solid_nu_elem STRING sv_fem_create_mesh_s_node_creat[VIRTUAL] STRING sv_fem_create_mesh_s_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_creat_id ) dump i_return_value # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@ @ @

@ @

ui_exec_function( "mesh_seed_display_mgr", "init" ) i_return_value = @ mesh_seed_create( "Solid 1.1.3 1.1.4"// @ " 1.2.1 1.2.2 1.1.1 1.1.2 1.2.3 1.4.1 1"// @ ".4.3 1.2.4 1.3.1 1.3.3 ", 1, 2, 0., 0., 0. ) dump i_return_value i_return_value = fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [0.1], "Hex8", "1", "1", "Coord 0", "Coord 0", i_fem_create_mesh_solid_nu_node, i_fem_create_mesh_solid_nu_elem, sv_fem_create_mesh_s_node_creat, sv_fem_create_mesh_s_elem_creat ) dump i_return_value #

@ @ @ @ @ @ @

Set the labels of the hexagonal elements ON

i_return_value = hex_elem_label ( TRUE ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Set the colour of the hexagonal elements to Red (Colour value = 1) #

Main Index

Chapter 8: Preference Functions 1385 Graphics Preferences

i_color_value = 1 i_return_value = hex_elem_color ( i_color_value ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Set the colour of the hexagonal elements to Blue (Colour value = 4) # i_color_value = 4 i_return_value = hex_elem_color ( i_color_value ) dump i_return_value

@ @

sys_free_string( sv_asm_create_hpat_xyz_creat_id ) sys_free_string( sv_fem_create_mesh_s_node_creat ) sys_free_string( sv_fem_create_mesh_s_elem_creat ) #---------------------------------------------------------------------

hex_elem_label

()

# # Purpose : This file provides an example of a call to the # function hex_elem_label() # # This illustration opens a new database and # creates a hyperpatch in it.It creates mesh seed # and meshes with Hexagonal elements. Later it # sets its label ON and OFF. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function hex_elem_label() has the following arguments: # hex_elem_label # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_hpat_xyz_creat_id[VIRTUAL] INTEGER i_fem_create_mesh_solid_nu_node INTEGER i_fem_create_mesh_solid_nu_elem STRING sv_fem_create_mesh_s_node_creat[VIRTUAL] STRING sv_fem_create_mesh_s_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_creat_id ) dump i_return_value # Set the view i_return_value =

Main Index

@ @ @

@

1386 PCL Reference Manual Examples Graphics Preferences

ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@

ui_exec_function( "mesh_seed_display_mgr", "init" ) i_return_value = @ mesh_seed_create( "Solid 1.1.3 1.1.4"// @ " 1.2.1 1.2.2 1.1.1 1.1.2 1.2.3 1.4.1 1"// @ ".4.3 1.2.4 1.3.1 1.3.3 ", 1, 2, 0., 0., 0. ) dump i_return_value i_return_value = fem_create_mesh_sol_3( "IsoMesh", 0, "Solid 1 ", 1, [0.1], "Hex8", "1", "1", "Coord 0", "Coord 0", i_fem_create_mesh_solid_nu_node, i_fem_create_mesh_solid_nu_elem, sv_fem_create_mesh_s_node_creat, sv_fem_create_mesh_s_elem_creat ) dump i_return_value

@ @ @ @ @ @ @

# Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Set the labels of the hexagonal elements ON # l_label_status = TRUE i_return_value = hex_elem_label ( l_label_status ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Set the labels of the hexagonal elements OFF # l_label_status = FALSE i_return_value = hex_elem_label ( l_label_status ) dump i_return_value

@ @

sys_free_string( sv_asm_create_hpat_xyz_creat_id ) sys_free_string( sv_fem_create_mesh_s_node_creat ) sys_free_string( sv_fem_create_mesh_s_elem_creat ) #---------------------------------------------------------------------

()

mpc_color # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function mpc_color() In this example a mpc.db is opened and the the colour of the MPCs present in the database is changed to Red and then Blue. Before running this session file run mpc.ses to create mpc.db. The mpc.db contains one MPC. This file can be run by starting a session of Patran, and running this session file

Chapter 8: Preference Functions 1387 Graphics Preferences

# through the "File","Session","Play" pulldown # menus on the menu bar. # # The function mpc_color() has the following arguments: # mpc_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value #--------------------------------------------------------------------# Open the database "mpc.db" uil_file_open.go("mpc.db") # Set the label of the MPCs ON. i_return_value = mpc_label ( TRUE ) dump i_return_value

@ @

# Session file paused. Press "Resume" to contnue ... sf_pause() #--------------------------------------------------------------------# Set the colour of MPC to Red (Colour value 1) i_color_value = 1 i_return_value = mpc_color ( i_color_value ) dump i_return_value

@ @

# Session file paused. Press "Resume" to contnue ... sf_pause() #--------------------------------------------------------------------# Set the colour of MPC to Blue (Colour value 4) i_color_value = 4 i_return_value = @ mpc_color @ ( i_color_value ) dump i_return_value #---------------------------------------------------------------------

()

mpc_label # # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function mpc_label() In this example a mpc.db is opened and the the label of the MPCs present in the database is set ON and OFF. Before running this session file run mpc.ses to create mpc.db. The mpc.db contains one MPC. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function mpc_label() has the following arguments: mpc_label ( label_status )

1388 PCL Reference Manual Examples Graphics Preferences

#--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value #--------------------------------------------------------------------# Open the database "mpc.db" uil_file_open.go("mpc.db") # Set the label of the MPCs ON. # l_label_status = TRUE i_return_value = mpc_label ( l_label_status ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the label of the MPCs OFF. # l_label_status = FALSE i_return_value = @ mpc_label @ ( l_label_status ) dump i_return_value #---------------------------------------------------------------------

node_color

()

# # Purpose : This file provides an example of two calls to # the function node_color() # # This illustration opens a new database and # creates a Point in it. Then it creates a node # on it and changes its colour. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function node_color() has the following arguments: # node_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_fem_create_nodes__node_creat[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the nodes. node_label(TRUE) i_return_value = asm_const_grid_xyz( "1", "[0 0 0]", "Coord 0",

Main Index

@ @ @

Chapter 8: Preference Functions 1389 Graphics Preferences

sv_asm_create_grid_xyz_creat_id ) dump i_return_value # Create a node i_return_value = @ fem_create_nodes( "Coord 0", "Coord 0", @ TRUE, "1", "Point 1 ", @ sv_fem_create_nodes__node_creat ) dump i_return_value #--------------------------------------------------------------------# Set the colour of node to Red i_color_value = 1 node_color ( i_color_value )

@

# Observe the colour. # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of node to Blue i_color_value = 4 node_color ( i_color_value )

@

sys_free_string( sv_asm_create_grid_xyz_creat_id ) sys_free_string( sv_fem_create_nodes__node_creat ) #---------------------------------------------------------------------

node_label

()

# # Purpose : This file provides an example of two calls to # the function node_label() # # This illustration opens a new database and # creates a Point in it. Then it creates a node # on the point and changes its label on and off. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function node_label() has the following arguments: # node_label # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_fem_create_nodes__node_creat[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 i_return_value = asm_const_grid_xyz( "1", "[0 0 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id ) dump i_return_value #

Main Index

Create a node

@ @ @

1390 PCL Reference Manual Examples Graphics Preferences

i_return_value = @ fem_create_nodes( "Coord 0", "Coord 0", @ TRUE, "1", "Point 1 ", @ sv_fem_create_nodes__node_creat ) dump i_return_value #--------------------------------------------------------------------# Set the label of node. l_label_status = TRUE node_label ( l_label_status )

@

# Observe the label. # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set OFF, the label of node. l_label_status = FALSE node_label ( l_label_status )

@

sys_free_string( sv_asm_create_grid_xyz_creat_id ) sys_free_string( sv_fem_create_nodes__node_creat ) #---------------------------------------------------------------------

point_elem_color

()

# # Purpose : This file provides an example of two calls to # the function point_elem_color() # # This illustration opens a new database and # creates a Point in it. Then it creates a point # element and changes its colour. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function point_elem_color() has the following arguments: # # point_elem_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_fem_create_nodes__node_creat[VIRTUAL] STRING sv_fem_create_elemen_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Show the labels of the point elements. point_elem_label(TRUE) i_return_value = asm_const_grid_xyz( "1", "[0 0 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id ) dump i_return_value

Main Index

@ @ @

Chapter 8: Preference Functions 1391 Graphics Preferences

# Create a node i_return_value = fem_create_nodes( "Coord 0", "Coord 0", TRUE, "1", "Point 1 ", sv_fem_create_nodes__node_creat ) dump i_return_value

@ @ @

# Create a point element i_return_value = @ fem_create_elems( "Point ", "Point", @ "1", "Standard", TRUE, "Node 1 ", @ "", "", "", "", "", "", "", @ sv_fem_create_elemen_elem_creat ) dump i_return_value #--------------------------------------------------------------------# Set the colour of point element to Red i_color_value = 1 point_elem_color ( i_color_value )

@

# Observe the colour. # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of point element to Blue i_color_value = 4 point_elem_color ( i_color_value )

@

sys_free_string( sv_asm_create_grid_xyz_creat_id ) sys_free_string( sv_fem_create_nodes__node_creat ) sys_free_string( sv_fem_create_elemen_elem_creat ) #---------------------------------------------------------------------

point_color

()

# # Purpose : This file provides an example of two calls to # the function point_color() # # This illustration opens a new database and # creates a Point in it. Then the colour of # the point is changed. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function point_color() has the following arguments: # point_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 #

Main Index

Show the labels of the points

1392 PCL Reference Manual Examples Graphics Preferences

point_label(TRUE) i_return_value = asm_const_grid_xyz( "1", "[0 0 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id ) dump i_return_value

@ @ @

# Set the point color to Red i_color_value = 1 point_color ( i_color_value )

@

# Observe the colour. # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the point color to Green i_color_value = 11 point_color ( i_color_value )

@

sys_free_string( sv_asm_create_grid_xyz_creat_id ) #----------------------------------------------------------------------

point_elem_label

()

# # Purpose : This file provides an example of two calls to # the function point_elem_label() # # This illustration opens a new database and # creates a Point in it. Then it creates a point # element and changes its label on and off. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function point_elem_label() has the following arguments: # point_elem_label # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] STRING sv_fem_create_nodes__node_creat[VIRTUAL] STRING sv_fem_create_elemen_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 i_return_value = asm_const_grid_xyz( "1", "[0 0 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id ) dump i_return_value # Create a node i_return_value = fem_create_nodes( "Coord 0", "Coord 0",

Main Index

@ @ @

@ @

Chapter 8: Preference Functions 1393 Graphics Preferences

TRUE, "1", "Point 1 ", sv_fem_create_nodes__node_creat ) dump i_return_value

@

# Create a point element i_return_value = @ fem_create_elems( "Point ", "Point", @ "1", "Standard", TRUE, "Node 1 ", @ "", "", "", "", "", "", "", @ sv_fem_create_elemen_elem_creat ) dump i_return_value #--------------------------------------------------------------------# Set the label of the point element. l_label_status = TRUE point_elem_label ( l_label_status )

@

# Observe the label. # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set OFF, the label of the point element. l_label_status = FALSE point_elem_label ( l_label_status )

@

sys_free_string( sv_asm_create_grid_xyz_creat_id ) sys_free_string( sv_fem_create_nodes__node_creat ) sys_free_string( sv_fem_create_elemen_elem_creat ) #---------------------------------------------------------------------

point_label

()

# # Purpose : This file provides an example of two calls to # the function point_label() # # This illustration opens a new database and # creates a Point in it. Then the label of # the point is changed. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function point_label() has the following arguments: # # point_label # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_grid_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 i_return_value = asm_const_grid_xyz( "1", "[0 0 0]", "Coord 0", sv_asm_create_grid_xyz_creat_id )

Main Index

@ @ @

1394 PCL Reference Manual Examples Graphics Preferences

dump i_return_value # Show the labels of the points l_label_status = TRUE point_label ( l_label_status )

@

# Observe the label. # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Erase the labels of points l_label_status = FALSE point_label ( l_label_status )

@

sys_free_string( sv_asm_create_grid_xyz_creat_id ) #---------------------------------------------------------------------

pref_graphics_set

()

# # Purpose : This file provides an example of a call to the # function pref_graphics_set() # # This function gets the graphic preference # parameters. This file opens a new database # "new.db" and creates a point and node. # Then it gets the graphic preference # parameters.Later it changes the preference # for grid size and node size and finally gets # the graphic preference 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 pref_graphics_set() has the following arguments: # # pref_graphics_set # ( disp_meth, # p_color, # s_color, # e_color, # extend, # fit_view, # center, # hard_rend, # anti_alias, # td_vector, # rt_display, # s_light, # p_marker, # s_marker, # m_color, # m_size, # gm_size, # nm_size, # l_format, # nsigd ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_disp_meth

Main Index

Chapter 8: Preference Functions 1395 Graphics Preferences

INTEGER i_p_color INTEGER i_s_color INTEGER i_e_color LOGICAL l_extend LOGICAL l_fit_view LOGICAL l_center LOGICAL l_hard_rend LOGICAL l_anti_alias LOGICAL l_td_vector LOGICAL l_rt_display LOGICAL l_s_light INTEGER i_p_marker INTEGER i_s_marker INTEGER i_m_color INTEGER i_m_size INTEGER i_gm_size INTEGER i_nm_size INTEGER i_l_format INTEGER i_nsigd LOGICAL l_set_flag(20) STRING sv_asm_create_grid_xyz_created[VIRTUAL] STRING sv_fem_create_nodes_created[VIRTUAL] INTEGER i_return_value #--------------------------------------------------------------------# Open a new database "new.db" uil_file_new.go("","new.db") $? YES 36000002 # Create a Point and Node. i_return_value = @ asm_const_grid_xyz( "1", "[0 0 0]", "Coord 0", @ sv_asm_create_grid_xyz_created ) dump i_return_value i_return_value = fem_create_nodes( "Coord 0", "Coord 0", TRUE, "1", " [0 0 0]", sv_fem_create_nodes_created ) dump i_return_value

@ @ @

i_return_value = pref_graphics_get ( i_disp_meth, i_p_color, i_s_color, i_e_color, l_extend, l_fit_view, l_center, l_hard_rend, l_anti_alias, l_td_vector, l_rt_display, l_s_light, i_p_marker, i_s_marker, i_m_color, i_m_size, i_gm_size, i_nm_size, i_l_format, i_nsigd ) dump i_return_value

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

# Display method is dump i_disp_meth # Primary color is dump i_p_color

Main Index

1396 PCL Reference Manual Examples Graphics Preferences

# Secondary color is dump i_s_color # Error color is dump i_e_color # Autoextend Flag is dump l_extend # Autofitview Flag is dump l_fit_view # Autocenter Flag is dump l_center # Hardware rendering Flag is dump l_hard_rend # Anti-Alias flag is dump l_anti_alias # 3-D vector Display Flag is dump l_td_vector # Result Title Display Flag is dump l_rt_display # Symmetric Light Flag is dump l_s_light # Primary marker is dump i_p_marker # Secondary marker is dump i_s_marker # Marker color is dump i_m_color # Marker size is dump i_m_size # Grid marker size is dump i_gm_size # Node marker size is dump i_nm_size # Results label format is dump i_l_format # Number of significant results digits are dump i_nsigd # Session file paused. Press "Resume" to continue... sf_pause() l_set_flag(17) = TRUE l_set_flag(18) = TRUE i_gm_size = 25 i_nm_size = 50 i_return_value = pref_graphics_set ( l_set_flag, i_disp_meth, i_p_color, i_s_color, i_e_color, l_extend, l_fit_view, l_center, l_hard_rend, l_anti_alias, l_td_vector, l_rt_display, l_s_light, i_p_marker, i_s_marker, i_m_color, i_m_size, i_gm_size, i_nm_size, i_l_format, i_nsigd ) dump i_return_value

Main Index

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

Chapter 8: Preference Functions 1397 Graphics Preferences

# Reset the values i_gm_size = 0 i_nm_size = 0 i_return_value = pref_graphics_get ( i_disp_meth, i_p_color, i_s_color, i_e_color, l_extend, l_fit_view, l_center, l_hard_rend, l_anti_alias, l_td_vector, l_rt_display, l_s_light, i_p_marker, i_s_marker, i_m_color, i_m_size, i_gm_size, i_nm_size, i_l_format, i_nsigd ) dump i_return_value

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

# Grid marker size is dump i_gm_size # Node marker size is dump i_nm_size SYS_FREE_STRING( sv_asm_create_grid_xyz_created ) SYS_FREE_STRING( sv_fem_create_nodes_created ) #---------------------------------------------------------------------

quad_elem_color

()

# # Purpose : This file provides an example of a call to the # function quad_elem_color() # # This illustration opens a new database and # creates a patch in it. It creates mesh seed # and meshes with quad elements. Later it # sets the colour of the quad elements Red and # then Blue. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function quad_elem_color() has the following arguments: # quad_elem_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] INTEGER i_fem_create_mesh_surfa_nu_node INTEGER i_fem_create_mesh_surfa_nu_elem STRING sv_fem_create_mesh_s_node_creat[VIRTUAL] STRING sv_fem_create_mesh_s_elem_creat[VIRTUAL] #---------------------------------------------------------------------

Main Index

1398 PCL Reference Manual Examples Graphics Preferences

# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 i_return_value = asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@ @ @

@ @

ui_exec_function( "mesh_seed_display_mgr", "init" ) 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_nu_node, i_fem_create_mesh_surfa_nu_elem, sv_fem_create_mesh_s_node_creat, sv_fem_create_mesh_s_elem_creat ) dump i_return_value # Set the labels of the Quad elements ON i_return_value = quad_elem_label ( TRUE ) dump i_return_value

@ @ @ @ @ @ @

@ @

# Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Set the colour of the quad element to Red (Colour value = 1) # i_color_value = 1 i_return_value = quad_elem_color ( i_color_value ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Set the colour of the quad element to Blue (Colour value = 4) # i_color_value = 4 i_return_value = quad_elem_color ( i_color_value ) dump i_return_value

@ @

sys_free_string( sv_asm_create_patch_xy_creat_id ) sys_free_string( sv_fem_create_mesh_s_node_creat ) sys_free_string( sv_fem_create_mesh_s_elem_creat ) #---------------------------------------------------------------------

Main Index

Chapter 8: Preference Functions 1399 Graphics Preferences

quad_elem_label

()

# # Purpose : This file provides an example of a call to the # function quad_elem_label() # # This illustration opens a new database and # creates a patch in it. It creates mesh seed # and meshes with quad elements. Later it # sets its label ON and OFF. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function quad_elem_label() has the following arguments: # # quad_elem_label # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] INTEGER i_fem_create_mesh_surfa_nu_node INTEGER i_fem_create_mesh_surfa_nu_elem STRING sv_fem_create_mesh_s_node_creat[VIRTUAL] STRING sv_fem_create_mesh_s_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 i_return_value = asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@ @ @

@ @

ui_exec_function( "mesh_seed_display_mgr", "init" ) 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_nu_node, i_fem_create_mesh_surfa_nu_elem, sv_fem_create_mesh_s_node_creat, sv_fem_create_mesh_s_elem_creat ) dump i_return_value #

Main Index

@ @ @ @ @ @ @

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

1400 PCL Reference Manual Examples Graphics Preferences

sf_pause() #--------------------------------------------------------------------# Set the labels of the Quad elements ON # l_label_status = TRUE i_return_value = quad_elem_label ( l_label_status ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Set the labels of the Quad elements OFF # l_label_status = FALSE i_return_value = quad_elem_label ( l_label_status ) dump i_return_value

@ @

sys_free_string( sv_asm_create_patch_xy_creat_id ) sys_free_string( sv_fem_create_mesh_s_node_creat ) sys_free_string( sv_fem_create_mesh_s_elem_creat ) #---------------------------------------------------------------------

renderstyle

()

# # Purpose : This file provides an example of a call to the # function renderstyle() # # This illustration opens a new database and # creates a solid in it. It then shades it . # Then render style is changed to "Hidden Line" # and finally "Shaded flat" # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function renderstyle() has the following arguments: # # renderstyle # ( style ) # #--------------------------------------------------------------------# Variable Declarations STRING s_style[128] INTEGER i_return_value STRING sv_asm_create_hpat_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value i_return_value =

Main Index

@ @

@

Chapter 8: Preference Functions 1401 Graphics Preferences

asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_creat_id ) dump i_return_value # Shade the solid uil_toolbar.shaded_smooth(

@ @

)

# Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Change the Renderstyle to "Hidden Line" # s_style = "Hidden Line" i_return_value = renderstyle ( s_style ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Change the Renderstyle to "Shaded/Flat" # s_style = "Shaded/Flat" i_return_value = renderstyle ( s_style ) dump i_return_value

@ @

sys_free_string( sv_asm_create_hpat_xyz_creat_id ) #---------------------------------------------------------------------

shade_color

()

# # Purpose : This file provides an example of a call to the # function shade_color() # # This illustration opens a new database and # creates a solid in it. It then shades it in # different colours. # # This file can be run by starting a session of # Patran and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function shade_color() has the following arguments: # shade_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value STRING sv_asm_create_hpat_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Open a new database uil_file_new.go( "", "./new.db" ) $? YES 36000002 # Set the view i_return_value =

Main Index

@

1402 PCL Reference Manual Examples Graphics Preferences

ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@

i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_creat_id ) dump i_return_value

@ @ @

# Shade the solid uil_toolbar.shaded_smooth(

)

# Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Set the shade color to Red (Colour value = 1) # i_color_value = 1 i_return_value = shade_color ( i_color_value ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Set the shade color to Blue (Colour value = 4) # i_color_value = 4 i_return_value = shade_color ( i_color_value ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue.... sf_pause() #--------------------------------------------------------------------# Set the shade color to Cyan (Colour value = 14) # i_color_value = 14 i_return_value = shade_color ( i_color_value ) dump i_return_value

@ @

sys_free_string( sv_asm_create_hpat_xyz_creat_id ) #---------------------------------------------------------------------

()

solid_color # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of 2 calls to the function solid_color() In this example a new database is opened and a solid is created. Then the function is called to change the colour of solid to Red and then Blue. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown

Chapter 8: Preference Functions 1403 Graphics Preferences

# menus on the menu bar. # # The function solid_color() has the following arguments: # solid_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value STRING sv_asm_create_hpat_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@ @

i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_creat_id ) dump i_return_value

@ @

# Set the solid label ON solid_label( TRUE ) # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the solid colour to Red (Colour value = 1) # i_color_value = 1 solid_color (

i_color_value )

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the solid colour to Blue (Colour value = 4) # i_color_value = 4 solid_color (

i_color_value )

sys_free_string( sv_asm_create_hpat_xyz_creat_id ) #---------------------------------------------------------------------

()

solid_label # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of 2 calls to the function solid_label() In this example a new database is opened and a solid is created. Then the function is called to set the solid label to ON and OFF. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

1404 PCL Reference Manual Examples Graphics Preferences

# The function solid_label() has the following arguments: # solid_label # ( label_value ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_value INTEGER i_return_value STRING sv_asm_create_hpat_xyz_creat_id[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@ @

i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_creat_id ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the solid label ON # l_label_value = TRUE solid_label (

l_label_value )

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the solid label OFF # l_label_value = FALSE solid_label (

l_label_value )

sys_free_string( sv_asm_create_hpat_xyz_creat_id ) #---------------------------------------------------------------------

surface_color

()

# # Purpose : This file provides an example of 2 calls to the # function surface_color() # # In this example a new database is opened and # a surface is created. Then the function is # called to change the colour of surface to Red # and then Blue. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function surface_color() has the following arguments: # surface_color # ( color_value ) # #---------------------------------------------------------------------

Main Index

Chapter 8: Preference Functions 1405 Graphics Preferences

# Variable Declarations INTEGER i_color_value INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Set the view. i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@ @

# Create a Patch i_return_value = asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value

@ @

# Set the surface label ON surface_label ( TRUE ) # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of the surface to Red. # i_color_value = 1 surface_color (

i_color_value )

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of the surface to Blue. # i_color_value = 4 surface_color (

i_color_value )

sys_free_string( sv_asm_create_patch_xy_creat_id ) #---------------------------------------------------------------------

surface_label

()

# # Purpose : This file provides an example of 2 calls to the # function surface_label() # # In this example a new database is opened and # a surface is created. Then the function is # called to set the surface label ON and OFF. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function surface_label() has the following arguments: # surface_label # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations

Main Index

1406 PCL Reference Manual Examples Graphics Preferences

LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Set the view. i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@ @

# Create a Patch i_return_value = asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value

@ @

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the surface label ON # l_label_status = TRUE surface_label (

l_label_status )

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the surface label OFF # l_label_status = FALSE surface_label (

l_label_status )

sys_free_string( sv_asm_create_patch_xy_creat_id ) #---------------------------------------------------------------------

tet_elem_color

()

# # Purpose : This file provides an example of 2 calls to the # function tet_elem_color() # # In this example a new database is opened and # a solid is created. A tetrahedral element is # created inside the solid.Then the function is # called to change the colour of element to Red # and then Blue. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function tet_elem_color() has the following arguments: # # tet_elem_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value

Main Index

Chapter 8: Preference Functions 1407 Graphics Preferences

STRING sv_asm_create_hpat_xyz_creat_id[VIRTUAL] STRING sv_fem_create_elemen_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@ @

i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_creat_id ) dump i_return_value

@ @

i_return_value = fem_create_elems( "Tet ", "Tet4", "1", "Standard", TRUE, "Point 1 ", "Point 3 ", "Point 8 ", "Point 4 ", "", "", "", "", sv_fem_create_elemen_elem_creat ) dump i_return_value

@ @ @ @

# Set the tetrahedral element label ON tet_elem_label ( TRUE ) # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of Tetrahedral element to Red. # i_color_value = 1 tet_elem_color (

i_color_value )

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of Tetrahedral element to Blue. # i_color_value = 4 tet_elem_color (

i_color_value )

sys_free_string( sv_asm_create_hpat_xyz_creat_id ) sys_free_string( sv_fem_create_elemen_elem_creat ) #---------------------------------------------------------------------

()

tet_elem_label # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of 2 calls to the function tet_elem_label() In this example a new database is opened and a solid is created. A tetrahedral element is created inside the solid.Then the function is called to set the label of tetrahedral element ON and OFF This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

1408 PCL Reference Manual Examples Graphics Preferences

# The function tet_elem_label() has the following arguments: # tet_elem_label # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_hpat_xyz_creat_id[VIRTUAL] STRING sv_fem_create_elemen_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

@ @

i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_creat_id ) dump i_return_value

@ @

i_return_value = fem_create_elems( "Tet ", "Tet4", "1", "Standard", TRUE, "Point 1 ", "Point 3 ", "Point 8 ", "Point 4 ", "", "", "", "", sv_fem_create_elemen_elem_creat ) dump i_return_value

@ @ @ @

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the tetrahedral element label ON # l_label_status = TRUE tet_elem_label (

l_label_status )

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the tetrahedral element label OFF # l_label_status = FALSE tet_elem_label ( l_label_status ) dump i_return_value sys_free_string( sv_asm_create_hpat_xyz_creat_id ) sys_free_string( sv_fem_create_elemen_elem_creat ) #--------------------------------------------------------------------

()

tri_elem_color # # # # # # # # #

Main Index

Purpose

:

This file provides an example of 2 calls to the function tri_elem_color() In this example a new database is opened and a surface is created. A triangular element is created inside the surface.Then the function is called to change the colour of element to Red and then Blue.

Chapter 8: Preference Functions 1409 Graphics Preferences

# # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function tri_elem_color() has the following arguments: # tri_elem_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] STRING sv_fem_create_elemen_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value # Create a Patch. i_return_value = asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value # Create a Tria element. i_return_value = fem_create_elems( "Tri ", "Tria3", "1", "Standard", TRUE, "Point 1 ", "Point 4 ", "Point 3 ", "", "", "", "", "", sv_fem_create_elemen_elem_creat ) dump i_return_value

@ @

@ @

@ @ @

# Set the Triangular element label ON tri_elem_label ( TRUE ) # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of the Triangular element to Red. # i_color_value = 1 tri_elem_color (

i_color_value )

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of the Triangular element to Blue. # i_color_value = 4 tri_elem_color (

i_color_value )

sys_free_string( sv_asm_create_patch_xy_creat_id ) sys_free_string( sv_fem_create_elemen_elem_creat ) #---------------------------------------------------------------------

Main Index

1410 PCL Reference Manual Examples Graphics Preferences

()

tri_elem_label

# # Purpose : This file provides an example of 2 calls to the # function tri_elem_label() # # In this example a new database is opened and # a surface is created. A triangular element is # created inside the surface.Then the function is # called to set the label of Triangular element # ON and OFF # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function tri_elem_label() has the following arguments: # tri_elem_label # ( label_status ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] STRING sv_fem_create_elemen_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value # Create a Patch. i_return_value = asm_const_patch_xyz( "1", "<1 1 0>", "[0 0 0]", "Coord 0", sv_asm_create_patch_xy_creat_id ) dump i_return_value # Create a Tria element. i_return_value = fem_create_elems( "Tri ", "Tria3", "1", "Standard", TRUE, "Point 1 ", "Point 4 ", "Point 3 ", "", "", "", "", "", sv_fem_create_elemen_elem_creat ) dump i_return_value

@ @

@ @

@ @ @

# Set the colour of the Triangular element to Red(Colour value 1). tri_elem_color ( 1 ) # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the Triangular element label ON # l_label_status = TRUE tri_elem_label (

l_label_status )

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

Main Index

Chapter 8: Preference Functions 1411 Graphics Preferences

# Set the Triangular element label OFF # l_label_status = FALSE tri_elem_label (

l_label_status )

sys_free_string( sv_asm_create_patch_xy_creat_id ) sys_free_string( sv_fem_create_elemen_elem_creat ) #---------------------------------------------------------------------

trim_surface_color

()

# # Purpose : This file provides an example of 2 calls to the # function trim_surface_color() # # In this example a new database is opened and # 2 surfaces are created. One surface is trimmed # from other to create a new trimmed surface. # Then the colour of that surface is changed to # Red and then Blue. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function trim_surface_color() has the following arguments: # trim_surface_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] INTEGER i_sgm_creat_curv_aut_segment_id STRING sv_sgm_create_cur_creat_curv_id[VIRTUAL] STRING sv_sgm_surfac_trimmed__creat_id[VIRTUAL] STRING sv_asm_delete_surface_delet_ids[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Create two patches. i_return_value = @ asm_const_patch_xyz( "", "<1 1 0><0.5 0.5 0>",@ "[0 0 0][0.25 0.25 0]", "Coord 0", @ sv_asm_create_patch_xy_creat_id ) dump i_return_value # Create chain curve i_return_value = sgm_create_curve_chain_v1( "1", " Surface 1.2 Surface 1.3 Surface 1.4"// " Surface 1.1", TRUE, i_sgm_creat_curv_aut_segment_id, sv_sgm_create_cur_creat_curv_id ) dump i_return_value # Create chain curve i_return_value = sgm_create_curve_chain_v1( "2", " Surface 2.2 Surface 2.3 Surface 2.4"// " Surface 2.1", TRUE, i_sgm_creat_curv_aut_segment_id,

Main Index

@ @ @ @ @

@ @ @ @ @

1412 PCL Reference Manual Examples Graphics Preferences

sv_sgm_create_cur_creat_curv_id ) dump i_return_value # Create trimmed surface i_return_value = sgm_create_surface_trimmed_v1( "3", "Curve 1 ", "Curve 2 ", "Surface 1", TRUE, TRUE, TRUE, TRUE, sv_sgm_surfac_trimmed__creat_id ) $? YES 38000217 $? YES 38000217 $? YES 38000219 dump i_return_value # Delete old surface i_return_value = asm_delete_surface( "Surface 2 ", sv_asm_delete_surface_delet_ids ) dump i_return_value

@ @ @ @

@ @

# Set the trimmed surface label ON trim_surface_label ( TRUE ) # Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of Trimmed surface to RED. # i_color_value = 1 trim_surface_color (

i_color_value )

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of Trimmed surface to BLUE. # i_color_value = 4 trim_surface_color (

i_color_value )

sys_free_string( sv_asm_create_patch_xy_creat_id ) sys_free_string( sv_sgm_create_cur_creat_curv_id ) sys_free_string( sv_sgm_surfac_trimmed__creat_id ) sys_free_string( sv_asm_delete_surface_delet_ids ) #---------------------------------------------------------------------

()

trim_surface_label # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of 2 calls to the function trim_surface_label() In this example a new database is opened and 2 surfaces are created. One surface is trimmed from other to create a new trimmed surface. Then the label of that surface is switched ON and OFF. This file can be run by starting a session of Patran, and running this session file through the "File","Session","Play" pulldown menus on the menu bar.

The function trim_surface_label() has the following arguments: trim_surface_label ( label_status )

Chapter 8: Preference Functions 1413 Graphics Preferences

# #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_patch_xy_creat_id[VIRTUAL] INTEGER i_sgm_creat_curv_aut_segment_id STRING sv_sgm_create_cur_creat_curv_id[VIRTUAL] STRING sv_sgm_surfac_trimmed__creat_id[VIRTUAL] STRING sv_asm_delete_surface_delet_ids[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Create two patches. i_return_value = @ asm_const_patch_xyz( "", "<1 1 0><0.5 0.5 0>",@ "[0 0 0][0.25 0.25 0]", "Coord 0", @ sv_asm_create_patch_xy_creat_id ) dump i_return_value # Create a chain curve i_return_value = sgm_create_curve_chain_v1( "1", " Surface 1.2 Surface 1.3 Surface 1.4"// " Surface 1.1", TRUE, i_sgm_creat_curv_aut_segment_id, sv_sgm_create_cur_creat_curv_id ) dump i_return_value # Create a chain curve i_return_value = sgm_create_curve_chain_v1( "2", " Surface 2.2 Surface 2.3 Surface 2.4"// " Surface 2.1", TRUE, i_sgm_creat_curv_aut_segment_id, sv_sgm_create_cur_creat_curv_id ) dump i_return_value # Create trimmed surface i_return_value = sgm_create_surface_trimmed_v1( "3", "Curve 1 ", "Curve 2 ", "Surface 1", TRUE, TRUE, TRUE, TRUE, sv_sgm_surfac_trimmed__creat_id ) $? YES 38000217 $? YES 38000217 $? YES 38000219 dump i_return_value # Delete old surface i_return_value = asm_delete_surface( "Surface 2 ", sv_asm_delete_surface_delet_ids ) dump i_return_value

@ @ @ @ @

@ @ @ @ @

@ @ @ @

@ @

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the trimmed surface label ON # l_label_status = TRUE trim_surface_label (

l_label_status )

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

Main Index

1414 PCL Reference Manual Examples Graphics Preferences

#--------------------------------------------------------------------# Set the trimmed surface label OFF # l_label_status = FALSE trim_surface_label (

l_label_status )

sys_free_string( sv_asm_create_patch_xy_creat_id ) sys_free_string( sv_sgm_create_cur_creat_curv_id ) sys_free_string( sv_sgm_surfac_trimmed__creat_id ) sys_free_string( sv_asm_delete_surface_delet_ids ) #---------------------------------------------------------------------

wedge_elem_color

()

# # Purpose : This file provides an example of 2 calls to the # function wedge_elem_color() # # In this example a new database is opened and # a solid is created. A wedge element is created # over the solid. Then the function is called # to change the colour of wedge to Blue and then # Red. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function wedge_elem_color() has the following arguments: # wedge_elem_color # ( color_value ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_color_value INTEGER i_return_value STRING sv_asm_create_hpat_xyz_creat_id[VIRTUAL] STRING sv_fem_create_elemen_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_creat_id ) dump i_return_value

@ @

i_return_value = fem_create_elems( "Wed ", "Wedge6", "1", "Standard", TRUE, "Point 1 ", "Point 4 ", "Point 3 ", "Point 5 ", "Point 8 ", "Point 7 ", "", "", sv_fem_create_elemen_elem_creat ) dump i_return_value

@ @ @ @ @

# Set the wedge element label ON wedge_elem_label ( TRUE )

Main Index

@ @

Chapter 8: Preference Functions 1415 Graphics Preferences

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of Wedge Element to Blue. # i_color_value = 4 wedge_elem_color (

i_color_value )

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the colour of Wedge Element to Red. # i_color_value = 1 wedge_elem_color (

i_color_value )

sys_free_string( sv_asm_create_hpat_xyz_creat_id ) sys_free_string( sv_fem_create_elemen_elem_creat ) #---------------------------------------------------------------------

wedge_elem_label

()

# # Purpose : This file provides an example of 2 calls to the # function wedge_elem_label() # # In this example a new database is opened and # a solid is created. A wedge element is created # over the solid. Then the function is called # to set the label of Wedge element ON and OFF. # # This file can be run by starting a session of # Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar. # # The function wedge_elem_label() has the following arguments: # wedge_elem_label # ( label_status ) #--------------------------------------------------------------------# Variable Declarations LOGICAL l_label_status INTEGER i_return_value STRING sv_asm_create_hpat_xyz_creat_id[VIRTUAL] STRING sv_fem_create_elemen_elem_creat[VIRTUAL] #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Set the view i_return_value = ga_view_aa_set ( -67., 0., -34. ) dump i_return_value

Main Index

@ @

i_return_value = asm_const_hpat_xyz( "1", "<1 1 1>", "[0 0 0]", "Coord 0", sv_asm_create_hpat_xyz_creat_id ) dump i_return_value

@ @

i_return_value = fem_create_elems( "Wed ", "Wedge6", "1", "Standard", TRUE, "Point 1 ", "Point 4 ", "Point 3 ", "Point 5 ", "Point 8 ",

@ @ @ @

1416 PCL Reference Manual Examples Graphics Preferences

"Point 7 ", "", "", sv_fem_create_elemen_elem_creat ) dump i_return_value

@

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the wedge element label ON # l_label_status = TRUE wedge_elem_label (

l_label_status )

# Session file paused. Press "Resume" to continue ... sf_pause() #--------------------------------------------------------------------# Set the wedge element label OFF # l_label_status = FALSE wedge_elem_label (

l_label_status )

sys_free_string( sv_asm_create_hpat_xyz_creat_id ) sys_free_string( sv_fem_create_elemen_elem_creat ) #---------------------------------------------------------------------

Main Index

Chapter 8: Preference Functions 1417 Report Preferences

Report Preferences This section contains examples of some of the functions used to govern some of the preferences used to control the generation of reports. pref_report_get

()

# # Purpose : This file provides an example of 2 calls to the # function pref_report_get() # # In this example a new database is opened and # default report preference is got. Then the # preferences are changed and got 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 pref_report_get() has the following arguments: # pref_report_get # ( real_numbers, # float_field_width, # float_decimal, # sci_field_width, # sci_decimal, # integer_field_width, # number_spacing ) #--------------------------------------------------------------------# Variable Declarations INTEGER i_real_numbers INTEGER i_float_field_width INTEGER i_float_decimal INTEGER i_sci_field_width INTEGER i_sci_decimal INTEGER i_integer_field_width INTEGER i_number_spacing INTEGER i_return_value #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Get the report preference. # i_return_value = pref_report_get ( i_real_numbers, i_float_field_width, i_float_decimal, i_sci_field_width, i_sci_decimal, i_integer_field_width, i_number_spacing ) dump i_return_value dump dump dump dump dump dump

Main Index

i_real_numbers i_float_field_width i_float_decimal i_sci_field_width i_sci_decimal i_integer_field_width

@ @ @ @ @ @ @ @

1418 PCL Reference Manual Examples Report Preferences

dump i_number_spacing #--------------------------------------------------------------------# Set different parameters for report generation. i_real_numbers = 2 i_float_field_width = 10 i_float_decimal = 5 i_sci_field_width = 10 i_sci_decimal = 6 i_integer_field_width = 5 i_number_spacing = 2 i_return_value = pref_report_set ( i_real_numbers, i_float_field_width, i_float_decimal, i_sci_field_width, i_sci_decimal, i_integer_field_width, i_number_spacing ) dump i_return_value

@ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Get the report preference. # i_return_value = @ pref_report_get @ ( i_real_numbers, @ i_float_field_width, @ i_float_decimal, @ i_sci_field_width, @ i_sci_decimal, @ i_integer_field_width, @ i_number_spacing ) dump i_return_value dump i_real_numbers dump i_float_field_width dump i_float_decimal dump i_sci_field_width dump i_sci_decimal dump i_integer_field_width dump i_number_spacing #---------------------------------------------------------------------

()

pref_report_set # # # # # # # # # # # # # # # # # # #

Main Index

Purpose

:

This file provides an example of a call to the function pref_report_set() In this example a new database is opened and default report preference is got. Then the preferences are changed and got 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 pref_report_set() has the following arguments: pref_report_set ( real_numbers, float_field_width, float_decimal, sci_field_width,

Chapter 8: Preference Functions 1419 Report Preferences

# sci_decimal, # integer_field_width, # number_spacing ) # #--------------------------------------------------------------------# Variable Declarations INTEGER i_real_numbers INTEGER i_float_field_width INTEGER i_float_decimal INTEGER i_sci_field_width INTEGER i_sci_decimal INTEGER i_integer_field_width INTEGER i_number_spacing INTEGER i_return_value #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Get the report preference. # i_return_value = pref_report_get ( i_real_numbers, i_float_field_width, i_float_decimal, i_sci_field_width, i_sci_decimal, i_integer_field_width, i_number_spacing ) dump i_return_value dump dump dump dump dump dump dump

@ @ @ @ @ @ @ @

i_real_numbers i_float_field_width i_float_decimal i_sci_field_width i_sci_decimal i_integer_field_width i_number_spacing

#--------------------------------------------------------------------# Set different parameters for report generation. i_real_numbers = 2 i_float_field_width = 10 i_float_decimal = 5 i_sci_field_width = 10 i_sci_decimal = 6 i_integer_field_width = 5 i_number_spacing = 2 i_return_value = pref_report_set ( i_real_numbers, i_float_field_width, i_float_decimal, i_sci_field_width, i_sci_decimal, i_integer_field_width, i_number_spacing ) dump i_return_value

@ @ @ @ @ @ @ @

#--------------------------------------------------------------------# Get the report preference. # i_return_value = @ pref_report_get @ ( i_real_numbers, @ i_float_field_width, @

Main Index

1420 PCL Reference Manual Examples Report Preferences

i_float_decimal, i_sci_field_width, i_sci_decimal, i_integer_field_width, i_number_spacing ) dump i_return_value

@ @ @ @

dump i_real_numbers dump i_float_field_width dump i_float_decimal dump i_sci_field_width dump i_sci_decimal dump i_integer_field_width dump i_number_spacing #---------------------------------------------------------------------

Main Index

Chapter 8: Preference Functions 1421 Geometry Preferences

Geometry Preferences This section contains examples of some of the functions used to govern some of the preferences used to define how geometry is interpreted.

pref_geometry_get_v1

()

# # Purpose : This file provides an example of 2 calls to the # function pref_geometry_get_v1() # # In this example a new database is opened and # default geometric preference values in the # database is got. Then it is changed and got # 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 pref_geometry_get_v1() has the following arguments: # pref_geometry_get_v1 # ( hpat_parametrization, # nurbs_acceleration, # geometry_convention ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_hpat_parametrization LOGICAL l_nurbs_acceleration LOGICAL l_geometry_convention INTEGER i_return_value #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Get the default geometric preference values in the database. i_return_value = @ pref_geometry_get_v1 @ ( l_hpat_parametrization, @ l_nurbs_acceleration, @ l_geometry_convention ) dump i_return_value # The geometric preference values are dump l_hpat_parametrization dump l_nurbs_acceleration dump l_geometry_convention #--------------------------------------------------------------------# Set a different geometric preference values. # IF (l_hpat_parametrization == TRUE) THEN l_hpat_parametrization = FALSE ELSE l_hpat_parametrization = TRUE END IF IF (l_nurbs_acceleration == TRUE) THEN l_nurbs_acceleration = FALSE ELSE l_nurbs_acceleration = TRUE

Main Index

1422 PCL Reference Manual Examples Geometry Preferences

END IF IF (l_geometry_convention == TRUE) THEN l_geometry_convention = FALSE ELSE l_geometry_convention = TRUE END IF i_return_value = @ pref_geometry_set_v1 @ ( l_hpat_parametrization, @ l_nurbs_acceleration, @ l_geometry_convention ) dump i_return_value #--------------------------------------------------------------------# Get the geometric preference values in the database again. i_return_value = @ pref_geometry_get_v1 @ ( l_hpat_parametrization, @ l_nurbs_acceleration, @ l_geometry_convention ) dump i_return_value # The geometric preference values are dump l_hpat_parametrization dump l_nurbs_acceleration dump l_geometry_convention #---------------------------------------------------------------------

pref_geometry_set_v1

()

# # Purpose : This file provides an example of a call to the # function pref_geometry_set_v1() # # In this example a new database is opened and # default geometric preference values in the # database is got. Then it is changed and got # 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 pref_geometry_set_v1() has the following arguments: # pref_geometry_set_v1 # ( hpat_parametrization, # nurbs_acceleration, # geometry_convention ) # #--------------------------------------------------------------------# Variable Declarations LOGICAL l_hpat_parametrization LOGICAL l_nurbs_acceleration LOGICAL l_geometry_convention INTEGER i_return_value #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Get the default geometric preference values in the database. i_return_value = @ pref_geometry_get_v1 @ ( l_hpat_parametrization, @ l_nurbs_acceleration, @

Main Index

Chapter 8: Preference Functions 1423 Geometry Preferences

l_geometry_convention ) dump i_return_value # The geometric preference values are dump l_hpat_parametrization dump l_nurbs_acceleration dump l_geometry_convention #--------------------------------------------------------------------# Set a different geometric preference values. # IF (l_hpat_parametrization == TRUE) THEN l_hpat_parametrization = FALSE ELSE l_hpat_parametrization = TRUE END IF IF (l_nurbs_acceleration == TRUE) THEN l_nurbs_acceleration = FALSE ELSE l_nurbs_acceleration = TRUE END IF IF (l_geometry_convention == TRUE) THEN l_geometry_convention = FALSE ELSE l_geometry_convention = TRUE END IF i_return_value = @ pref_geometry_set_v1 @ ( l_hpat_parametrization, @ l_nurbs_acceleration, @ l_geometry_convention ) dump i_return_value #--------------------------------------------------------------------# Get the geometric preference values in the database again. i_return_value = @ pref_geometry_get_v1 @ ( l_hpat_parametrization, @ l_nurbs_acceleration, @ l_geometry_convention ) dump i_return_value # The geometric preference values are dump l_hpat_parametrization dump l_nurbs_acceleration dump l_geometry_convention #---------------------------------------------------------------------

Main Index

1424 PCL Reference Manual Examples Finite Element Preferences

Finite Element Preferences This section contains examples of some of the functions used to govern some of the preferences used with finite element model elements. pref_fem_get

()

# # Purpose : This file provides an example of 2 calls to the # function pref_fem_get() # # In this example a new database is opened and # default finite element model minimum angle # value is got from the database. Then it is # changed and got 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 pref_fem_get() has the following arguments: # pref_fem_get # ( minimum_angle ) # #--------------------------------------------------------------------# Variable Declarations REAL r_minimum_angle INTEGER i_return_value #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Get the default finite element model minimum angle value. # i_return_value = @ pref_fem_get @ ( r_minimum_angle ) dump i_return_value # The minimum angle is dump r_minimum_angle #--------------------------------------------------------------------# Set a different value of minimum angle. r_minimum_angle = 29 i_return_value = @ pref_fem_set @ ( r_minimum_angle ) dump i_return_value #--------------------------------------------------------------------# Get the default finite element model minimum angle value. # i_return_value = @ pref_fem_get @ ( r_minimum_angle ) dump i_return_value # The minimum angle is dump r_minimum_angle #---------------------------------------------------------------------

Main Index

Chapter 8: Preference Functions 1425 Finite Element Preferences

pref_fem_set

()

# # Purpose : This file provides an example of a call to the # function pref_fem_set() # # In this example a new database is opened and # default finite element model minimum angle # value is got from the database. Then it is # changed and got 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 pref_fem_set() has the following arguments: # pref_fem_set # ( minimum_angle ) #--------------------------------------------------------------------# Variable Declarations REAL r_minimum_angle INTEGER i_return_value #--------------------------------------------------------------------# Create a new database and set the preferences uil_file_new.go("", "./new.db") $? YES 36000002 # Get the default finite element model minimum angle value. # i_return_value = @ pref_fem_get @ ( r_minimum_angle ) dump i_return_value # The minimum angle is dump r_minimum_angle #--------------------------------------------------------------------# Set a different value of minimum angle. r_minimum_angle = 29 i_return_value = @ pref_fem_set @ ( r_minimum_angle ) dump i_return_value #--------------------------------------------------------------------# Get the default finite element model minimum angle value. # i_return_value = @ pref_fem_get @ ( r_minimum_angle ) dump i_return_value # The minimum angle is dump r_minimum_angle #---------------------------------------------------------------------

Main Index

1426 PCL Reference Manual Examples Finite Element Preferences

Main Index

jp`Kc~íáÖìÉ=nìáÅâ=pí~êí=dìáÇÉ

Index PCL Reference Manual Examples This index looks strange, but it’s only used for WWP. fåÇÉ ñ Index

B

Basic Functions, 7

G

ga_view_screen_scale_set, 164 Geometry Functions, 379

I

Introduction, 1

U

uil_pref_analysis.set_analysis_pref, 1353

Main Index

1428 PCL Reference Manual Examples This index looks strange, but it’s only used for WWP.

Main Index

Related Documents


More Documents from "Kevin"