Pulldown menus can be added to MSC.Patran’s top menubar.
I Menubar on MSC.Patran’s main or primary form. Includes File, Group, etc. The widget Id is obtained via uil_primary.get_menubar_id() User-defined menu. This menu widget is a child of MSC.Patran’s main menubar widget. This widget is created with the ui_menu_create(…) function
Menu items are children of the user-defined menu widget. These are added to the user-defined menu with the ui_item_create(…) function. Functions are executed based on item name passed to the menu callback function.
ndividual items on the pulldown menu can be used to open user-defined forms or other PCL functions.
In addition to adding the contents of the p3_user_menu.def file to MSC.Patran’s top menubar, the shareware will add additional pulldown menus defined in files named, p3_user_menu.*.def, i.e., p3_user_menu.4me.def.
Up to 3 additional pulldown menus can be defined.
The shareware looks for p3_user_menu.*.def files in your current directory, home directory, MSC.Patran installation directory, and the shareware directory.
Example: p3_user_menu.my_menu.def
Menu label
*MENU LABEL = My_Menu
*
Executes a function that is not contained within a PCL Class. The function cannot have any arguments.
CLASS = -NA-
Executes the function tbd(classname). The tbd functon in turn executes: ui_exec_function(“classname”, “display”), i.e., the tbd function is used to open a form from the toolbar.
MSC.Patran Customization
If you use an icon that is not in the MSC.Patran icons directory then you will need to define the location of the icon file in the p3midilog.pcl file. Typically, the p3midilog.pcl file would be located in your home directory.
Toolbar icons can be any size. However, all icons on the default toolbar are 28x28 (pixels) on UNIX and 16x16 on NT.
For UNIX (i.e., Motif), the icons are in xbm format. For NT, the icons can be in either xbm format or bmp format (bitmap).
On UNIX, the icons must be black and white. On NT, the icons can be color if the bmp format is used.
On UNIX workstations, a program like bitmap can be used to create the icons.
On a PC, a program like Microsoft Windows Paint can be used to create the icons.
MSC.Patran Customization
To add your own toolbar function/icon
Create the PCL function and compile it into a library if it does not exist.
Make sure there are proper entries in your p3epilog.pcl file that tell MSC.Patran where to find the library that contains your function.
Create an icon by editing one of the existing toolbar icons using bitmap or its equivalent.
Add appropriate statements to your p3toolbar.def file.
Add a !!PATH statement to your p3midilog.pcl file telling MSC.Patran where to look for the icon file.