Patran二次开发工具PCL系列教程之8

更新时间:2023-06-02 07:04:01 阅读量: 实用文档 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

Lecture 8 Customizing: Toolbar, p3printers.def, Keymapping, Creating an Analysis Preference

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-1

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-2

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

Display - Toolbar

The Toolbar provides quick access to frequently used functions Additional functions may be added to the toolbar 32 Toolbar functions are supplied with MSC.Patran The default UNIX toolbar contains 30 icons

The default NT toolbars contain 32 icons

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-3

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

PATRAN Default Toolbar Icons

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-4

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

PATRAN Default Toolbar Icons (cont.)

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-5

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

PATRAN Toolbar Control File

The Toolbar on the main form is configured by the p3toolbar.def file. p3toolbar.def is located in the MSC.Patran installation directory. The file is read in sequential order when the p3toolbar is displayed. i.e., top to bottom in the file refers to the icons left to right on the toolbar

p3toolbar.def file example: Start Toolbar = Transform *ICON= tbrotatexy.bmp *CLASS= uil_toolbar *FUNCTION= rotate_xy *HELP= Mouse Rotate XY *LOAD ITEM

End Toolbar

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-6

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

PATRAN Toolbar Control File (cont.)

The icons can be found in Patran_install_dir/icons directory. *CLASS indicates where to find the function for the icon. *FUNCTION indicates which function will be executed when the icon is selected. *HELP indicates the help bubble that will be displayed when the mouse moves over the icon.

There is also an option for whether or not to load the icon into the toolbar when PATRAN is executed. – In order for the icon to load into MSC.Patran, – *LOAD ITEM must be added after the *HELP call.

The Start/End Toolbar Lines (NT only) define the boundaries of the dockable toolbars

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-7

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

PATRAN Toolbar Icons

*ICON specifies the icon that is to be used in the Toolbar form.The icons are restricted to a 40x40 bitmap format (typically 28x28 for UNIX or 16x16 for NT). Icons can be created using various UNIX bitmap utilities or Paint for NT. A toolbar icon template (UNIX) is supplied with MSC.Patran and can be used to create user-defined icons. tbblank.28.icon

The user defined icons must be referenced in the p3toolbar.def file and must be in MSC.Patran’s path p3toolbar.def must be in either the Patran_install_dir or the users home directory

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-8

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

PATRAN Toolbar Functions

*CLASS and *FUNCTION specify the function that is to be used by the Icon in

the Toolbar. CLASS and FUNCTION definitions can be specified by creating relatively simple PCL functions. PCL functions that reside within a user defined class are made available by referencing the library in the user’s p3epilog.pcl file.

!! PATH UNIX_path_to_library or sys_path(“ADD”,...) !! LIBRARY class.plb or sys_path(“ADD”,...)

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-9

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

p3printers.def (UNIX only)

The p3printers.def file is located in the Patran_install_dir.

The file allows you to configure the printers that will appear in the “Available Printers” listbox on the Print form.The printers available on NT need to be set up through starndard Windows configuration. An example of the format is shown below: $This is the Default Postscript Printer PrinterDevice Driver Destination Paper Size Width Height Left Margin Right Margin Top Margin Bottom Margin Default Units Number of Copies = Unknown = Postscript = Unknown = Letter, Custom = 0.0 = 0.0 = 0.5 in = 0.5 in = 0.5 in = 0.5 in = Inches, Points, cm = 1 $ Other units are Picas and mm $ See the documentation for additional sizes $ Default width for Custom paper size $ Default height for Custom paper size

= Postscript Default

Print Orientation = Portrait, Landscape; Landscape $ Note use of default

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-10

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

p3printers.def (cont.)

The driver is also displayed in the p3printers.def file An example is shown below:..........Driver Specific Options.................. Format Black to White, White to Black, Color Background White, Black, Actual Lines & Text = White, Black, Actual; Black Line Weight = 0.5 pts Text Scale $ Note use of default = $ another option is “Grayscale” =

$

= 100 %Image Size = Fit on Page, As Is Scale Factor = No Show; 1.0 Center = No Show; Yes Draw Borders $ Note use of “No Show” and a default

= Yes, NoQuality = No Show; Normal Color Model = No Show; RGB GCR = No Show; 75 %

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-11

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

Keymapping (UNIX only)

Hot Keys Touch a key to execute an option, such as: rotate, zoom, labels on/off Functions on the quickpick/toolbar can be executed from the keyboard

Provided by X-lib (UNIX only) Defined in a file called .Patran.EventMaps Default is in Patran_install_dir, and is searched for through the PCL Path Most recent keymap has priority If the key is defined twice the last definition takes precedence.

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-12

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

Keymapping (cont.)

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-13

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

Keymapping Syntax

Modifier <Event>: Function Modifiers: None Ctrl Meta Alt Shift Lock

Event: Btn 3 Down Btn 2 Down Btn 1 Down

Btn 3 Up

Btn 2 Up

Btn 1 Up

Key If

you want to specify a certain key <Key> Keyname Keyname = a, F1, KP_1

Note: None<Key>: do_this(), makes any key you hit execute do_this()

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-14

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

Keymapping Example:

For example,you may have the following mappings:

None<Key>1: LabelsOn() Shift<Key>1: LabelsOff() Alt<Btn1Down>: LabelsOn() Alt<Btn1Up>: LabelsOff() Ctrl Alt<Btn1Up>: ZoomOut() Ctrl Alt<Btn1Down>: ZoomIn() Ctrl <Key>s: SpectrumOnOff() <Key>osfUp:PanUp() <Key>osfDown:PanDown() None<Key>KP_1: RearView() None<Key>KP_2: BottomView() Ctrl <Btn3Down>: PopupGMenu(*selectMenu) Ctrl <Btn2Down>: PopupGMenu(*appsPopMenu) None <Key>c:CallPCL(test_event)

Where test_event is:

Function test_event()ui_exec_function(“my_class”,”display”) End Function /* test_event */PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-15

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

Steps to Incorporate your own preference into MSC.Patran

Load the template database with application specific attributes (PCL) Add user interface for the Analysis form (PCL) Translate the analysis model (PCL, Fortran, C) Read analysis results into patran database (PCL, Fortran, C)

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-16

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

Steps to Incorporate your own preference into MSC.Patran (cont.)

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-17

经典的MSC.Patran/Nastran二次开发工具PCL入门教程,PPT课件

PAT304 Course Notes – Release 9.5 Copyright 2001 MSC.Software Corporation

8-18

本文来源:https://www.bwwdw.com/article/0iz1.html

Top