Вы находитесь на странице: 1из 29

AVEVA

100 PML
PML
AVEVA PDMS AVEVA Marine

001. Splashscreen ........................................................................................................... 3


002. ..................................................................................... 3
003. ............................................................................................................................................ 3
004. ............................................................................................................................................... 4
005. ......................................................................................................................................... 4
006. ................................................................................................................ 4
007. ...................................................................................................................................................... 4
008. dll ................................................................................................................................................. 4
009. .............................................................................................................................................................................. 4
010. - Walk to Drawlist ..................................................................................................................................... 5
011. ........................................................................................................................................................ 5
012. Drawlist ....................................................................................................................................... 5
013. .................................................................................................................................................... 5
014. ................................................................................................................................................ 6
015. CE ...................................................................................................................................................................................................... 6
016. / Design .............................................................................................................................................. 6
017. Excel PML.NET .......................................................................................................................................... 6
018. , ............................................................................................................................. 7
019. - Esc ......................................................... 7
020. ........................................................................................................................................................... 7
021. Members list ( ) ............................................................................................... 7
022. ( ) ......................................................................................... 7
023. , ...................................................................................................................... 8
024. ............................................................................................................................................................. 8
025. ............................................................................................................................................................. 8
026. Excel .......................................................................................................................................................................................... 9
027. Draft .................................................................................................................................................. 9
028. Draft ........................................................................................................................................................................................... 9
029. ..................................................................................................................................................................................... 9
030. ...................................................................................................................................... 9
031. ALPHA LOG ALPHA FILE ................................................................................................................................................................... 9
032. , dll ............................................................................................................................................................ 9
033. ........................................................................................................................................................................... 9
034. IFTRUE .......................................................................................................................................................................... 10
035. .............................................................................................................................................................. 10
036. ....................................................................................................................................................... 10
037. ( ) ............................................................................................... 10
038. ISODRAFTMODE .......................................................................................................................................... 11
039. ................................................................................................................. 11
040. .............................................................................................................. 11
041. ............................................................................................................ 11
042. I- ................................................................................................................................. 11
043. ........................................................................................................................................... 11
044. Windows ........................................................................................................................................... 11
045. 3D .................................................................................................................................................. 11
046. 2D ............................................................................................................................. 11
047. .................................................................................................................................. 11
048. ...................................................................................................................................................... 14
049. .................................................................................................... 14
050. 3D ................................................................................................................................................... 14
051. ....................................................................................... 14
052. .................................................................................................................................... 14
053. .................................................................................................................................................................................. 14
054. ................................................................................................................................................................................... 16
055. , ................................................................................. 16
056. ................................................................................................. 16
057. 3D ......................................................................................................................................................... 16
058. ....................................................................................................................................................................................... 16
059. ( ) ................................................................................................................. 17
060. ............................................................................................................... 17
061. .............................................................................................................................. 17
062. ............................................................................................................................... 18
063. (Properties) (defaults)................................................................................................................ 18

: / www.aveva.ru/forum
AVEVA

064. PDF ............................................................................................................................................ 19


065. Limits-Defined Drawlist ......................................................... 19
066. ................................................................................................................................................................... 19
067. ................................................................................................................... 19
068. ...................................................................................................................... 19
070. .............................................................................................................. 20
071. ............................................................................................................. 20
072. .............................................................................................................................................................. 20
073. ............................................................................................................................ 21
074. ................................................................................................................................... 21
075. ............................................................................................................................ 21
076. ..................................................................................................................... 22
077. ....................................................................................................... 22
078. .............................................................................................................................................. 22
079. ............................................................................................................................... 23
080. .................................................................................................................................................................... 23
081. ........................................................................................................................................... 23
082. .......................................................................................................................................................... 24
083. .................................................................................................................... 24
085. .................................................................................................................................................................... 24
086. ................................................................................................................................................ 25
087. - .......................................................................................................................................................... 25
088. UTF-8 ........................................................................................................................................................ 25
089. ...................................................................................................................................................................................... 25
090. CE ELBO BEND ............................................................................................................................................................. 25
091. Autoclash ............................................................................................................................ 25
092. ..................................................................................................................................... 26
093. ............................................................................................................................................................ 26
094. 2 ............................................................................................................................................. 26
095. ..................................................................................................................... 27
096. (Autocolour) ...................................................................................................................................... 28
097. .Net ...................................................................................................................................................................................... 28
098. , Autocolour, ........................................................................ 28
099. Drawlist 3D- ....................................................................................................................................... 29
100. , ........................................................................................... 29

: / www.aveva.ru/forum
AVEVA

001. Splashscreen
. ( 11.6 )

: %pmllib%\monitor\pdmslogon.pmlfrm

clock init
$P :
do !x from 10 to 1 by -1
$P ... $!x
PAUSE 1
Enddo
$P !
clock read

. 1

002.

start %pdmsui%\des\start
:

Show !!associationmanager
!!associationmanager.showAssocs( !!ASSOCIATIONMANAGER.REFRESH, |SELECT| )

003.
!datetime = '16:45 20 Feb 2013'

var !sStr SESSIONS ON $!dateTime


q var !sStr

do !x from 1 to !sStr.Real()
!session = !x
!who = SESSU $!session
HANDLE ANY
$P $!session
SKIP
ENDHANDLE
!when = SESSD $!session
!comment = SESSC $!session
$P : $!session : $!who : $!when : $!comment
enddo

: / www.aveva.ru/forum
AVEVA

004.

SETCOMPDATE


Q ATTMDC
Q ATTMOD(att)
Q ATTMODC(att)
Q ATTMODLIST(sess)
Q ATTMODLISTC

Q ELECRE(sess) ,
Q ELECREC ,

Q ELEDEL(sess) ,
Q ELEDEL ,

Q ELEMOD(sess) ,
Q ELEMODC ,

005.
!what = !!Alert.Input(' ?','')
!with = !!Alert.Input(' ?','')
!wher = !!Alert.Input(' ( ):','')

!splitw = !wher.Split()
do !x from 1 to !splitw.Size()

var !coll coll all $!splitw[$!x] for CE


do !y from 1 to !coll.Size()
$!coll[$!y]
!oldname = !!CE.Name
!newname = !oldname.Replace('$!what','$!with')
NAME $!newname
enddo

enddo

006.
var !coll EVAL ( <attribute_name> ) FOR ALL ( <type> ) WITH ( <condition> ) FOR CE

<attribute_name> - , , TYPE DESC DTXR ..

007.
!graSel = object SELECTION()
!graSel.getCurrent()
!graSelL = !graSel.getSelection()
q var !graSelL

008. dll
1. C ( ) :
set CPML=\\server\..\CPML\

2. PML:
var !CPML EVAR CPML
!namespacePath = !CPML + 'library'
!execute = |IMPORT '| + !namespacePath + |'| $!execute

009.
!var = 12.456
Q var !var.String(D0)
<STRING> '12'

: / www.aveva.ru/forum
AVEVA

Q var !var.String('D1')
<STRING> '12.5'
Q var !var.String('D2')
<STRING> '12.46'
Q var !var.String('D3')
<STRING> '12.456'

String('Dn'), n- . ,
, .

010. - Walk to Drawlist


VAR !COLLECTION COLLECT ALL FROM DRAWLIST
!BLOCK = OBJECT BLOCK('!COLLECTION[!EVALINDEX].DBREF()')
!LIST = !COLLECTION.EVALUATE(!BLOCK)
!VOLUME = OBJECT VOLUME(!LIST)

!LIM = OBJECT GPHVIEWS()


!LIM.LIMITS(!!GPH3DDESIGN1.VIEW, !VOLUME)

!draw = object drawlist()


!glbDraw = !draw.Globaldrawlist().Members()
if (!glbdraw.size() EQ 0) then
RETURN
endif
!RT = object array()
do !x from 1 to !glbDraw.Size()
!RT[!x] = !glbDraw[!x].String()
enddo

!BLOCK = OBJECT BLOCK('!RT[!EVALINDEX].DBREF()')


!LIST = !RT.EVALUATE(!BLOCK)
!VOLUME = OBJECT VOLUME(!LIST)

!LIM = OBJECT GPHVIEWS()


!LIM.LIMITS(!!GPH3DDESIGN1.VIEW, !VOLUME)

!volume = object VOLUME(!!gphdrawlists.drawlists[1].members())


!!gphViews.limits(!!gphviews.views[1], !volume)

011.
!this.keyboardfocus = !this.gadget_name

012. Drawlist
!lsaDrawlist = !!gphDrawlists.drawlist(!!GPH3DDESIGN1.VIEW)
!lsaDrawlistMembers = !lsaDrawlist.members()
!lsaDrawlistMembersNames = !lsaDrawlistMembers.evaluate(object BLOCK(|!lsaDrawlistMembers[!evalIndex].name|))

013.
--
--
using namespace 'Aveva.Pdms.Presentation'
Import 'pmlfilebrowser'
handle any
endhandle
--
!browser = object PMLFILEBROWSER('LOAD')
!filePath = 'D:\'
!browser.show(!filePath, '', ' ', false, ' txt (*.txt)|*.txt', 2)
!FileName = !browser.file()

!FileName

: / www.aveva.ru/forum
AVEVA

014.
--
using namespace 'Aveva.Pdms.Presentation'
Import 'pmlfilebrowser'
handle any
endhandle
!browser = object PMLFILEBROWSER('SAVE')
!filePath = 'D:\'
!browser.show(!filePath, '', ' ', false, ' txt (*.txt)|*.txt', 2)
!FileName = !browser.file()

!FileName

015. CE
!!gphAlwaysRotate(!!gph3ddesign1.view, !!ce)

016. / Design
, Design start,
%PDMSUI%\des\admin , $.,
.

: - Design

VAR !getPdmsDflts SPLIT EVAR PDMSDFLTS


!logFile = object file(!getPdmsDflts[1] + '\enter-log.log')
VAR !currentData[1] CLOCK DATE
VAR !currentData[2] CLOCK TIME
VAR !currentData[3] LOGIN
!currentData[4] = '================'
!logFile.WriteFile('APPEND',!currentData)

, , , Auto Clash , appdesmain.pmlfrm


(PMLLIB\design\forms) xmenuauto (pdmsui\des\clasher).

, start ,
dra\admin\start Draft

017. Excel PML.NET


using namespace 'Aveva.Pdms.Presentation'
Import 'GridControl'
handle any
endhandle
!filepath = 'c:\excel.xls'
!grid = object NETGRIDCONTROL()
!nds = object NETDATASOURCE('Grid Control Example', !filePath)
!grid.bindToDataSource(!nds)

!titles = !grid.getColumn(1)
!names = !grid.getColumn(2)
!icons = !grid.getColumn(3)
!descs = !grid.getColumn(4)

: / www.aveva.ru/forum
AVEVA

018. ,
--
!!FMSYS.setProgress(0)

, enddo

!percent = 100 * $!x / !items.Size()


!!FMSYS.setProgress( !percent )

!x , !items.Size()

019. -
Esc
ID@ Esc

prompt off
prompt load escape | Esc|
ID @
HANDLE(61,528)
ENDHANDLE
--
--
!name = !!CE.Name

Esc

DO !i from 1
prompt off
prompt load escape |Identify ELEMENT to be removed from drawing & press ESC|
ID @
HANDLE(61,528)
BREAK
ENDHANDLE
!NameArray[$!i] = !!CE.NAME
ENDDO

020.
--
!modelEditor = object STATE()
--
!modelEditor.modifymode(true)
--
!modelEditor.modifymode(false)

021. Members list ( )


CALLIB UFORMS MEMB _CDCMEMBER FREE

022. (
)
1
--
VAR !allHistory HISTORY
Q var !allHistory
<STRING> '826 825 820 816'
--, , 816

--

: / www.aveva.ru/forum
AVEVA

!historyArray = !allHistory.Split()
q var !historyArray
<ARRAY>
[1] <STRING> '826'
[2] <STRING> '825'
[3] <STRING> '820'
[4] <STRING> '816'

-- ( )
!firstSession = !historyArray[!historyArray.Size()]

--
VAR !CreateAuthor SESSUSER $!firstSession
VAR !CreateDate SESSDATE $!firstSession

2
--
VAR !allHistory history
!historyArray = !allHistory.Split()

-- (DB)
VAR !CEDB DBNAME
!DBO = OBJECT DB(!CEDB)

-- ( )
!firstSession = !historyArray[!historyArray.Size()]

--
!CreateAuthor = !DBO.Session($!firstSession).Author
!CreateDate = !DBO.Session($!firstSession).Date

3
-- CRUSER, CRDATE, CRSESS

023. ,
var !fullyInVolume collect all EXCLUSIVE within volume ce
do !x from 1 to ! fullyInVolume.size()
ADD $! fullyInVolume [$!x]
ENHANCE $!fullyInVolume [$!x] COLOUR GREEN
Enddo

var ! fullyInVolume collect all EXCLUSIVE within e1000 n1000 d100 to e10000 n 30000 u1000
do !x from 1 to ! fullyInVolume.size()
ADD $! fullyInVolume [$!x]
ENHANCE $!fullyInVolume [$!x] COLOUR GREEN
Enddo

, , EXCLUSIVE

024.
!!appxload('DES', 'GEN', false) $* General
!!appxload('DES', 'EQUI', false) $* Equipment
!!appxload('DES', 'PIPE', false) $* Piping
!!appxload('DES', 'CABL', false) $* Cable Tray
!!appxload('DES', 'HVACADV', false) $* HVAC Designer
!!appxload('DES', 'STLWRK', false) $* Beams/Columns
!!appxload('DES', 'PANEL', false) $* Panels/Plates
!!appxload('DES', 'CIVIL', false) $* Walls/Floors
!!appxload('DES', 'ACCESS', false) $* ASL Modeller
!!appxload('DES', 'DTMP', false) $* Design Templates

025.
q var !!fmsys.shownforms()

: / www.aveva.ru/forum
AVEVA

026. Excel
!!EQUILOADCSV() spreadsheetImport.pmlfrm

Excel-. Name/Type

027. Draft
q var !!appDraMain.sheet.rtext

028. Draft
!!cdrapplic.shee.clear()
!!appDraMain.updateGadgets()

029.
prompt off
prompt load escape | |
var !POS SHPO @
prompt on

030.
CLOCK INIT
--
CLOCK READ

031. ALPHA LOG ALPHA FILE


ALPHA LOG ,
ALPHA FILE

032. , dll

-- Show the PMLNet attributes form


import 'PDMSCOMMANDS'
handle(1000,0)
endhandle

using namespace 'Aveva.Pdms.Presentation.PDMSCommands'


!cm = object PMLNETCOMMANDMANAGER()
!cm.executeCommand('AVEVA.Attributes.Show')

033.
var !q HASH ( 'FAER' )
q var !q

<STRING> '889413'

!coco = !!dehash(889413)
q var !coco

<STRING> 'FAER'
, WORD

: / www.aveva.ru/forum
AVEVA

034. IFTRUE
, brwei ,
, brwei

( IFTRUE ( UNSET(CMPREF OF SPREF ) , 0 , BRWEI))

, ,
, , .

035.

PML1- ( )
VAR !items COLLECT ALL ( <itemType> ) FOR CE

PML2-,
!items = !!CollectAllFor(<itemType>,||,CE)

PML2-,
!colObject = object collection()
!colObject.AddScope(CE)
!colObject.AddType('itemType')
!items = !colObject.Results()

,
. Dbref-,

, -,
, .
.

036.
,
. : ,
OLD

var !db dbname


SETCOMPDATE FOR DB $!db TO SESSION sessno

var !atta old collect all ( type ) with ( deleted() ) for db $!db

do !x values !atta
q old name of $!x
q old ( pos of $!atta[$!x] )
enddo

037. ( )
, ,
PICK

VAR !pickMe PICK

Q VAR !pickMe


<ARRAY>
[1] <STRING> '=19409/1108642'
[2] <STRING> 'Line D Through W 6135.652 S 83941.578 U 1700'

: / www.aveva.ru/forum
AVEVA

038. ISODRAFTMODE
VAR !isotype ISOTYPE
HANDLE (47,15)
--
ELSEHANDLE none
--
EXIT
ENDHANDLE

039.
XYPO XN YN

040.
ITPOS OF TUBI
P1POS
P2POS

041.
Q VSIDE OF ITEM_REFNO

042. I-
#POSU(P.:1),#POSU(P.2:)(C2:)(PM:1)

043.
NOTEPAD

VAR !COMMAND ' NOTEPAD /P ' + '__ '


SYSCOM |$!COMMAND|

044. Windows
VAR !HOST HOST
VAR !USERNAME EVAR USERNAME

045. 3D
VAR !GET3DFROM2D ENUPOS OF @

046. 2D
VAR !GET2D SHPOS @

047.
NEW CIRC DEF @ (1) (2)
VAR !GETDIAM DIAM

: / www.aveva.ru/forum
AVEVA

NEW RECT ASDEF @ (1) (2)


VAR !GETXLEN XLEN
VAR !GETYLEN YLEN

NEW RECT DEF @


VAR !GETXLEN XLEN
VAR !GETYLEN YLEN

NEW ELLI DEF @ (1), (2) (3)


VAR !GETXLEN XLEN
VAR !GETYLEN YLEN

NEW ARC DEF @ (1), (2) (3)


VAR !GETRADI RADI

NEW ETRI DEF @ (1) (2)


VAR !GETLEN LENGTH

: / www.aveva.ru/forum
AVEVA

VAR !GETDEG ADEG

NEW TABL DEF @


VAR !GETXLEN XLEN
VAR !GETYLEN YLEN

NROW, NCOLUMN.
, ( XLEN /
NCOLUMN ), = ( YLEN / NROW )

NEW DMND DEF @ : (1), (2), (3)


VAR !GETXLEN XLEN
VAR !GETYLEN YLEN
VAR !GETDEG ADEG

NEW HEXA DEF @ : (1), (2)


VAR !GETDIAM DIAM
VAR !GETDEG ADEG

: / www.aveva.ru/forum
AVEVA


VAR !GETORIGIN ORIGIN
Q VAR !GETORIGIN
<STRING> 'CENTRE X 366MM Y 195MM'

048.
AUTOSCALE

AUTOSCALE LIMITS , Drawlist,


LIMI ( Limits-Defined)

049.
ONPOS 0 0
AUTOSCALE
UPDATE ALL

050. 3D
AUTOSIZE FROM POSITION1 TO POSITION2 3D- ( )


AUTOSIZE FROM @ TO @ - ( )
AUTOSCALE UPDATE ALL

051.

VAR !GETMEMBERS COLLECT ( ALL SITE MEM ALL ZONE MEM ALL EQUI MEM ) FOR CE

052.
OPTION .TESTOPTION PIX WIDTH 64 HEIGHT 64
VAR LIST _TESTOPTION PAIRS |MYPICTURE.PNG| |1|
|MYPICTURE2.PNG| |2|
EXIT

053.
, ,
.

VARS, %PDMSUI%//ADMIN
$S = , .
$U , .

: / www.aveva.ru/forum
AVEVA

: , ,
, .

:
1. arQB.pmlmac %PMLLIB% PML REHASH ALL
:
if (!!CE.Type NEQ 'FLAN') then
$P
RETURN
Endif

!getCEName = !!CE.Namn
$P : $!getCEName
$P -- :
VAR !getTotal P2 BOLT TOTAL
do !x from 1 to !getTotal.Real()
VAR !getDesc P2 BOLT $!x RTEXT
if (!getDesc.Matchwild('*-LEN-*')) then
VAR !getBlen P2 BOLT $!x BLEN
!getDesc = !getDesc.Replace('-LEN-','$!getBlen')
endif
VAR !getMate P2 BOLT $!x XTEXT
VAR !getQuan P2 BOLT $!x NOFF
$P == $!x . $!getQuan x : $!getDesc : $!getMate
enddo

VAR !GetTotalW P2 BOLT TOTW


$P == (++) = $!getTotalW

2. VARS Design (%PDMSUI%/Des/Admin/)


$S QB = $M/%PMLLIB%\arQB.pmlmac
$U

3. PDMS/Marine

, - QB,
( )

, VARS
%PDMSUI%//admin

: / www.aveva.ru/forum
AVEVA

NB. ,

054.
VAR !depth DBDEPTH , WORLD 0
Q var !!CE.ownlst , ,

055. ,

var !getItems COLLECT ALL SPEC WITH ( STEXT OF FIRST MEM EQ 'INSU' ) ,
(
)

056.
Var !getEnhacedLabels SPLIT ENHANCE ENHANCE

SPREAD LOCAL XOFF < XOFF> YOFF < YOFF> SELECT ALL FROM !getEnhacedLabels
, , ,
:
XOFF = - * COS ()
YOFF = - * SIN ()

SPREAD REMOTE OMIT < OMIT> GAP < GAP> MARGIN < MARGIN> SELECT ALL FROM !getEnhacedLabels
:
- OMIT ( LEFT RIGHT BOTTOM TOP)
- - GAP
- MARGIN

SPREAD REMOTE OMIT < OMIT> GAP < GAP> REPOSITION X < X1> Y < Y1> X < X2> Y <
Y2> SELECT ALL FROM !getEnhacedLabels :
- OMIT ( LEFT RIGHT BOTTOM TOP)
- - GAP
- X1,X2,Y1,Y2

057. 3D
!!gphViews.look(!!gph3Ddesign1.view, N90D)
!!gphViews.look(!!gph3Ddesign1.view, S90D)
!!gphViews.look(!!gph3Ddesign1.view, E90D)
!!gphViews.look(!!gph3Ddesign1.view, W90D)

!!gphViews.look(!!gph3Ddesign1.view, N) ()
!!gphViews.look(!!gph3Ddesign1.view, S)
!!gphViews.look(!!gph3Ddesign1.view, E)
!!gphViews.look(!!gph3Ddesign1.view, W)

!!gphViews.look(!!gph3Ddesign1.view, S45W35D) ISO1


!!gphViews.look(!!gph3Ddesign1.view, W45N35D) ISO2
!!gphViews.look(!!gph3Ddesign1.view, E45N35D) ISO3
!!gphViews.look(!!gph3Ddesign1.view, S45E35D) ISO4

058.
!screenInfoFile = |c:\temp\screen_info.txt|
SYSCOM | WMIC DeskTopMonitor get ScreenWidth, ScreenHeight > $!screenInfoFile |

: / www.aveva.ru/forum
AVEVA

PML C:\temp\screen.txt , .
Height , Width

!screenFileObj = object file(!screenInfoFile)


!screenHeight = !screenFileObj.ReadFile()[2].Split()[1].Trim()
!screenWidth = !screenFileObj.ReadFile()[2].Split()[2].Trim()
Q var !screenHeight
Q var !screenWidth

059. ( )
1. (PIN),
PML 1
-- ,
ID @
!pos1 = !!CE.Pos.Wrt(WORLD)
PIN 1 AT $!pos1

-- ,
ID @
!pos2 = !!CE.Pos.Wrt(WORLD)
PIN 2 AT $!pos2

--
VAR !getDistance CONST DIST PIN1 TO PIN2
Q var !getDistance

2. PML2- Distance, Position


-- ,
ID @
!pos1 = !!CE.Pos.Wrt(WORLD)

-- ,
ID @
!pos2 = !!CE.Pos.Wrt(WORLD)

-- . . 2
!getDistance = !pos1.Distance(!pos2).String('D2')
Q var !getDistance

060.
PML2- Midpoint, Position
-- ,
ID @
!pos1 = !!CE.Pos.Wrt(WORLD)
ID @
!pos2 = !!CE.Pos.Wrt(WORLD)
--
AID LINE NUM 1 $!pos1 TO $!pos2 LINESTYLE DOTTED
--
!getMiddle = !pos1.Midpoint(!pos2)
Q var !getMiddle
--
AID TEXT 'V' AT $!getMiddle

061.
, bat-, ,

: / www.aveva.ru/forum
AVEVA

1. , MDB
pdms.bat DESIGN SAM SYSTEM/XXXXXX /SAMPLE

2. , MDB, (
) ,
, ,
:
pdms.bat TTY SAM SYSTEM/XXXXXX /SAMPLE $M/c:\myMacro.pmlmac

pdms.bat BATCH SAM SYSTEM/XXXXXX /SAMPLE $M/c:\myMacro.pmlmac

pdms.bat NOGRAPHICS SAM SYSTEM/XXXXXX /SAMPLE $M/c:\myMacro.pmlmac

, :
pdms.bat DESIGN TTY SAM SYSTEM/XXXXXX /SAMPLE $M/c:\myMacro.pmlmac

pdms.bat DRAFT BATCH SAM SYSTEM/XXXXXX /SAMPLE $M/c:\myMacro.pmlmac

pdms.bat PARAGON NOGRAPHICS SAM SYSTEM/XXXXXX /SAMPLE $M/c:\myMacro.pmlmac

3. , MDB ,
pdms.bat DESIGN readOnly:True SAM SYSTEM/XXXXXX /SAMPLE

4. , MDB ,
( )
pdms.bat DESIGN INTEGRATEDMODE SAM SYSTEM/XXXXXX /SAMPLE

5. , MDB ,
pdms.bat DESIGN NOCONSOLE SAM SYSTEM/XXXXXX /SAMPLE

6. , MDB ,
pdms.bat DESIGN NOCONSOLE SAM SYSTEM/XXXXXX /SAMPLE

062.
$T8+ - ,
$T8- - ,

.
World

063. (Properties) (defaults)


, (Properties)
. Modify-Properties.

, Default, Apply

do !x from 1 to 5
!!comPropCntrl.data[$!x].initEditForm(|DEFAULT|, true)
HANDLE ANY
ENDHANDLE
!!comPropCntrl.data[$!x].okEditForm()
HANDLE ANY
ENDHANDLE
Enddo

: / www.aveva.ru/forum
AVEVA

NB. , Data. , Modify-Properties


.

064. PDF
-- Acrobat Reader
!acropath = 'C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe'
--
!filepath = 'C:\AVEVA-PROJECTS\RDP12\RDPDATA\AVEVA Plant Manuals 12.1.SP4\Administrator Command Reference Manual.pdf'
--
SYSCOM | ""$!acropath" /A "page=39" "$!filepath" "&|

065. Limits-Defined
Drawlist
Drawlist Limits-Defined

View
CALLDRG ULIMITS GETLIMITS _CDROVIEW DRAW FALSE

066.
import 'PMLFileBrowser'
handle any
endhandle
using namespace 'Aveva.Pdms.Presentation'
!folder = object PMLFolderBrowser()
!folder.Show(' ',true)
!FolderPath = !folder.selectedPath()
q var !FolderPath

067.
--
!getHpos = !!CE.Hpos
!getTpos = !!CE.Tpos
--
AID TEXT '' AT $!getHpos
AID TEXT '' AT $!getTpos

068.
do !x from 1 to 365
VAR !getCol COL $!x
$P $!x = $!getCol
Enddo

365 .
COLOUR
!getColour = object colour(_)

: / www.aveva.ru/forum
AVEVA

070.
.
,

kill !!testForm
setup form !! testForm
TRACK |PADDCE| call |!this.trackce()|
text .text1 ' CE' width 10 is string
exit
---------------
define method .trackce()
!getType = !!CE.Type
!this.text1.val = !getType
Endmethod

CE trackce()

CE TRACK,
TRACK
SYSTCE ( Admin)
PADDCE PADD (Draft)
DESICE Design
CATACE Catalogue
ISODCE Isodraft
SCHECE Schematics
PROPCE Properties
MANUCE Manufacturing

071.

SHOW !!attlib

attlib.dat , .
.

072.
, , ..

VAR !data ATTDEF attribute NAME RPTX TYPE DEFI SIZE VISI QSET UNIT
attribute ,

!data , , ,
.

:
VAR !data ATTDEF POS NAME RPTX TYPE DEFI SIZE VISI QSET UNIT
Q var !data
<ARRAY>
[1] <STRING> 'POS'
[2] <STRING> 'POSITION'
[3] <STRING> '8'
[4] <STRING> '5'
[5] <STRING> '3'
[6] <STRING> 'true'
[7] <STRING> 'true'
[8] <STRING> 'DIST'

: / www.aveva.ru/forum
AVEVA


NAME
RPTX (Report Text)
TYPE
0 = All
1 = Integer
2 = Real
3 = Logical
4 = Text
5 = Reference
6 = Word
7 = Orientation
8 = Position
9 = Direction
DEFI
1 = DDL
2 = Dynamic
3 = DDL or Dynamic
4 = Pseudo
5 = DDL or Pseudo
6 = Dynamic or Pseudo
7 = DDL or Dynamic or Pseudo
SIZE
VISI
QSET
UNIT

: , Reference

-- - TYPE
VAR !checkAttType ATTDEF CREF TYPE
--
If (!checkAttType EQ '5') then
$P Reference
Endif

073.
attlib.dat.

-- ( !!searchPaths
!getAttFile = !!searchPaths('attlib.dat')
!getAttList =!getAttFile[1].file.readFile()

!getAttList ()

074.
VAR !getWindow RSHPOS @
!getWindow ,

075.
--
VAR !getWindow RSHPOS @

--
var !LeftX PART(|$!getWindow|,2)
var !RightX PART(|$!getWindow|,6)
var !LeftY part(|$!getWindow|,4)
var !RightY part(|$!getWindow|,8)

-- (- -)
if (($!LeftX) GT ($!RightX)) then
var !TMP |$!LeftX|
var !LeftX |$!RightX|
var !RightX |$!TMP|
endif

: / www.aveva.ru/forum
AVEVA

if (($!LeftY) gt ($!RightY)) then


var !TMP |$!LeftY|
var !LeftY |$!RightY|
var !RightY |$!TMP|
endif

--
ENHANCE ALL (GLAB SLAB) WITH (xyps[1] GE ($!LeftX) AND xyps[1] LE ($!RightX) AND xyps[2] GE ($!LeftY) AND xyps[2] LE ($!RightY)) FOR VIEW

--
VAR !getEnhanced ENHANCE

076.

--
VAR !tubis COLLECT ALL TUBI FOR CE
-- ,
!totalLength = 0
-- (BEND)
!IsbendsNeeded = !!Alert.Confirm(' ?')
--
do !x from 1 to !tubis.Size()
!totalLength = !totalLength + !tubis[!x].Dbref().Itle
HANDLE ANY
ENDHANDLE
enddo
-- , YES
if (!IsBendsNeeded EQ 'YES') then
!text = ', , '
VAR !bends COLLECT ALL BEND FOR CE
do !x from 1 to !tubis.Size()
!totalLength = !totalLength + !bends[!x].Dbref().Fitlen
HANDLE ANY
ENDHANDLE
enddo
else
!text = ', , '
endif
--
!!Alert.Message(' $!text = ' + !totalLength.String('D3'))

077.
Q VAR !!appcntrl.formtitle
Q VAR !!appcntrl.currentapp

078.
VIEW Draft (. ) LAYE), (FONT),
.., .
. %PDMSDFLTS% dra-gen-*lay, * -
, dim lab ( . 100 Draft).
.

,
%PDMSUI%\dra\gen\usetlayprp

CALLDRG USETLAYPRP $<$!PURP$>
!PURP (DIM , LAB )


CALLDEF $!FILE

!FILE

: / www.aveva.ru/forum
AVEVA

079.
Q VAR LOC -
Q VAR GLO -

080.
VAR !checkVar DEFINED ( !someVar )
!someVar , !checkVar
true, - false

081.
!array
[1] <STRING> ''
[2] <STRING> ''
[3] <STRING> ''
[4] <STRING> ''
[5] <STRING> ''
[6] <STRING> ''


1. -

VAR !SortIndex SORT !ARRAY

, !SortIndex !Array

2. -

VAR !SortIndex SORT !ARRAY DESCENDING

3.

!array.Sort()

: / www.aveva.ru/forum
AVEVA

, . 3,
, ,
. :

!newArray = !array
!newArray.Sort()

, ,

082.
VAR !checkUnset UNSET ( attribute )
attribute , Desc

, true

083.
, -
. ,
:

-- ,
$M-
--

$M-

( ), , ,
$M+

085.
, ,
.

:
--
NEW EQUI /EquiName
-- , ,
HANDLE (41,12)
$P
DELETE EQUI
-- ,
ELSEHANDLE NONE
$P
ENDHANDLE


HANDLE ANY
--
ENDHANDLE

: / www.aveva.ru/forum
AVEVA

086.
- ,
. : , , ,
,

--
LABEL /startagain

--
!inputD = !!Alert.Input(' 1 10','1')

--
!isReal = !inputD.Real()
HANDLE ANY
!!Alert.Message(' . ...')
--
GOLABEL /startagain
ENDHANDLE

--, , 1-10
if (!inputD.Real() LT 1 OR !inputD.Real() GT 10) then
!!Alert.Message(' . ...')
--
GOLABEL /startagain
endif

-- ,
!!Alert.Message(' $!inputD ')

087. -
VAR !checkOpenFiles OPENF

, ( ), .

088. UTF-8
!FileToConvert = 'c:\temp\textfile.txt'
!ConverterPath = 'C:\AVEVA\Plant\PDMS12.1.SP4\Transc.exe'
SYSCOM 'CMD /C $!ConverterPath 0 "$!FileToConvert" 65001 -s -b &'
UTF-8

!FileToConvert = 'c:\temp\textfile.txt'
!ConverterPath = 'C:\AVEVA\Plant\PDMS12.1.SP4\Transc.exe'
SYSCOM 'CMD /C $!ConverterPath 0 "$!FileToConvert" 65001 -s -n &'
UTF-8 BOM

089.
Q VAR !var.ObjectType()

090. CE ELBO BEND


CHANGETYPE TO BEND
CHANGETYPE TO ELBO

Spref .

arChangeElboToBend.pmlmac , .
58 PML.DABACON.RU-OFFLINE

091. Autoclash
Autoclash
CALLCL XAUTO TRUE

: / www.aveva.ru/forum
AVEVA

XAUTO (PDMSUI\des\clasher), DCLASHER


CALLCL DCLASHER $!SYSTEM $!FORCE
!SYSTEM = true, !FORCE = false

Autoclash
AUTOCLASH ON ( DESCLASH)
XAUTO

, Autoclash,
XAUTO

092.
PROMPT ' '

,
PROMPT DISMISS

093.
VIEW Down, =:


NEW LDIM FROM /item1 TO /item2


NEW LDIM DIR N FROM /item1 TO /item2

( )
NEW LDIM DIR N FROM P1 OF /item3 TO P2 OF /item4

094. 2
VIEW Down, =:


NEW LDIM DIR N FROM BEFORE ID@ TO BEFORE ID@

NEW LDIM DIR N FROM AFTER ID@ TO AFTER ID@

: / www.aveva.ru/forum
AVEVA

NEW LDIM DIR N FROM AFTER ID@ TO BEFORE ID@

NEW LDIM DIR N FROM BEFORE ID@ TO AFTER ID@

095.

SPCO SPEC, ,
SPCO.

( = SPCO)
if (!!CE.Type NEQ 'SPCO') then
!!Alert.Message(' SPCO')
RETURN
endif

-- CE
!ceName = !!CE.Name

--
!outputArray = object array()
!outputArray[1] = 'SPCO =' + !!CE.Tanswer
do
--
OWNER
if (!!CE.Type EQ 'SELE') then
--
if (!!ce.Answer EQ 0) then
!Answer = !!CE.Tanswer
else
!Answer = !!CE.Answer.String()
if (!!CE.Maxanswer NEQ 0 AND !!CE.Maxanswer NEQ !!CE.Answer) then
!Answer = !Answer + '-' + !!CE.Maxanswer.String()
endif
endif

--
!outputArray.Append('SELE =' + !Answer + ' =' + !!CE.Quest)
endif

-- SPEC,
if (!!CE.Type EQ 'SPEC') then
!outputArray.Append('SPEC =' + !!CE.Quest)
BREAK
endif
enddo

: / www.aveva.ru/forum
AVEVA

--
!outputInvert = !outputArray
!outputInvert.Invert()

--
$!ceName
$P SPCO :
do !x from 1 to !outputInvert.Size()
$P $!x ==$!outputInvert[$!x]
Enddo

096. (Autocolour)
VAR !getRuleColour AUTOCOLOUR FOR CE

, (Autocolour Rules)

097. .Net
import 'PDMSCommands'
handle (1000,0)
endhandle
using namespace 'Aveva.Pdms.Presentation.PDMSCommands'
!commandManager = object PMLNETCOMMANDMANAGER()
!commandManager.executeCommand('Aveva.Pdms.Presentation.HistoryBackwardCommand')

.Net , Customisation (
) Command

098. , Autocolour,

-- Drawlist
!getDrawlist = !!gphDrawlists.drawlist(!!GPH3DDESIGN1.VIEW)

-- item_id Dbref
!getColour = !getDrawlist.colour(item_id)

!getColour 0,

NB.
!getTranslucency = !getDrawlist.translucency(item_id)

: / www.aveva.ru/forum
AVEVA

099. Drawlist 3D-


q var !!gphDrawlists.drawlist(1).Members() Drawlist
q var !!gphviews.views 3D- ( View- 3D )

100. ,

, :
(NOZZ) (BRAN)
ATTA (HANG)
.
, ()
.

:
, ,
. ?

: Cref , ATTA,
(HANG)

-- Cref ATTA
VAR !getCrefs EVAL ( NAME OF CREF ) FOR ALL ATTA WITH ( CREF NEQ Nulref ) FOR CE
--
ADD ALL FROM !getCref

.
PML.DABACON.RU-OFFLINE PML

: / www.aveva.ru/forum