Sei sulla pagina 1di 3

AVEVA PDMS/MARINE

Step-By-Step Tutorial


HOW TO CREATE OWN TOOLBARS AND MENUS WITH PML ADDINS

Prerequisites :
1.User-defined PMLLIB and PDMSUI in appropriate PML1/2 search paths
SET PMLLIB=\\servername\COMPANY-MACRO\PMLLIB %PMLLIB%
SET PDMSUI=\\servername\COMPANY-MACRO\PDMSUI %PDMSUI%

Method 1. PML-Addin
1.In user folder %PDMSUI%\DES\ADDINS create a file (no extension needed) myCompanyAddin with
following contents:

name: myCompanyAddin
object: MyCompanyToolbarMenuObject

Here:
name is the name PML-Addin
object is the name of PML-object which this addin linked to and which contains PML-description of
toolbars and panels

NB. Path for Design/Outfitting addins must be exactly the same as mentioned because for PML1 files names of folders within %PDMSUI% have a
meaning
For Draft/Outfitting Draft addins it is %PDMSUI%\DRA\ADDINS
For Paragon addins it is %PDMSUI%\CAT\ADDINS

2.In user folder %PMLLIB%\ADDONS create a PML-object, a file called
MyCompanyToolbarMenuObject.pmlobj with UTF-8 coding with following contents:

define object MyCompanyToolbarMenuObject
endobject

define method .MyCompanyToolbarMenuObject ()
endmethod

define method .modifyMenus()
!this.barMenu()
!this.menus()
endmethod

define method .modifyForm()
!this.toolbars()
endmethod

define method .barMenu()
--define of new bar menu
!newmenu = object APPBARMENU()
!newmenu.add(|My Company Menu|, 'mnuCompany')
--add menu to allow it in all applications of Design/Outfitting
!!appMenuCntrl.addBarMenu(!newmenu, 'ALL')
--end of menu definition
endmethod



define method .menus()
AVEVA PDMS/MARINE
Step-By-Step Tutorial

--add items into newly created bar menu mnuCompany
!menu = object APPMENU('mnuCompany')
--new item with callback (example dblisting form)
!menu.add('CALLBACK', |Call Dblisting form|, 'show !!rptoutput free')

--new submenu name mnuPipe
!menu.add('MENU', |Piping|, 'mnuPipe')
!!appMenuCntrl.addMenu(!menu, 'All')
--end of definition

--fill submenu mnuPipe with items
!menu = object APPMENU('mnuPipe')
!menu.add('CALLBACK', |Create Pipe|, 'CALLP IPIPE FPIPE')
!!appMenuCntrl.addMenu(!menu, 'All')
--end of submenu definition
endmethod

--toolbar
define method .toolbars()
--toolbar definition
frame .barCompany TOOLBAR 'My company toolbar'
button .b1 tooltip 'Open command window' pixmap /%PMLLIB%\Icons\redbutton32.png width 32 height 32 callback 'show _CADCBTH'
exit
!!appTbarCntrl.addToolbar('barCompany', 'ALL')
--end of toolbar definition
Endmethod

NB. The picture-file and the path for the toolbar icon (marked in yellow) must exists otherwise no icon will be displayed and system gives a
message of unable to find file. Size of the picture is 32x32

3.Run PDMS or Marine Outfitting

If there is an error like shown below

then close message and type in white window PML REHASH ALL command then type DESIGN (for
entering PDMS Design) or OUTFITTING (for entering Marine Outfitting)






AVEVA PDMS/MARINE
Step-By-Step Tutorial

Result:


NB. You can simply add then new buttons to your panel by adding new lines with new buttons descriptions into frame container:
Example:
button .b2 tooltip 'Query attributes' pixmap /%PMLLIB%\Icons\greenbutton.png width 32 height 32 callback 'Q ATT'
Just be sure all paths and files are exists
You can also call for a simple macroses placing the callback like
button .b3 tooltip 'Call my macro' pixmap /%PMLLIB%\Icons\bluebutton.png width 32 height 32 callback '$M/path/macro.pmlmac'

Potrebbero piacerti anche