|
之前发过一版关于管道组建用PDMS自带的菜单栏创建的方法,现在我介绍下用命令栏创建管道组件
实际上PDMS里面所有的操作几乎都可以用命令实现,只不过是实现的过程复杂程度不一致而已
这是我创建的一个管道组件的界面
因为每个院做的数据库不一样,用到的STYPE规则不一样,所以我做的组件不具有一般性,所以我贴出了部分代码,管理员需要进一步加工才能用
主要需要更改里面的STYPE
下面是代码:
define method .gateag()
!!alert.message('选择三通或弯头.')
id @
!tee = ref
!teetype = !!ce.type
!specA = !!ce.spref.name
!spec = '/' + !specA.part(2,'/')
pipe
Var !Branch Coll all bran for ce
Var !Names Eval name for all from !Branch
!Names.sort().invert()
!Largecout = !names[1].after('/').after('/').after('B')
!Largecouta = Real(!Largecout)
!Largecoutb = !Largecouta + 1
!pipename = !names[1].after('/').before('/')
!branchname = '/' + !pipename + '/B' + '$!Largecoutb'
var !mode mode
For
Choose AutoConnect On
if mat(!teetype,'ELBO') gt 0 then
$!tee
New Valv choose WITH STYPE 'GATE-SW-800#'
HANDLE (7,3)
ENDHANDLE
FCONN TO prev
MOVE PA ALONG PL OF PREV DIST 80 FROM PL OF PREV
HANDLE (61,16)
ENDHANDLE
ROT ABOut P2 BY 90
else
$!tee
New Bran
name $!branchname
Pspec $!spec
Conn PH to $!tee
New Valv choose WITH STYPE 'GATE-SW-800#'
HANDLE (7,3)
ENDHANDLE
FCONN TO PH
MOVE PA ALONG PH DIST 80 FROM PH
HANDLE (61,16)
ENDHANDLE
ROT ABOut P2 BY 90
endif
New ELBO choose WITH STYPE 'LR90'
HANDLE (7,3)
ENDHANDLE
FCONN TO PREV
MOVE PA ALONG PL OF PREV DIST 80 FROM PL OF PREV
!ptype = !this.ctype.selection('dtext')
!ptype1 = !ptype.after('CL')
!ptype2 = !ptype1 + '#'
New FLAN choose WITH STYPE '$!ptype2'
HANDLE (7,3)
ENDHANDLE
arrive P2
leave P1
FCONN TO prev
MOVE PA ALONG PL OF PREV DIST 80 FROM PL OF PREV
New GASK choose WITH STYPE '$!ptype2'
HANDLE (7,3)
ENDHANDLE
arrive P2
leave P1
CONN TO PREV
New FLAN choose WITH STYPE 'BLIND'
HANDLE (7,3)
ENDHANDLE
FCONN P1 TO P1 OF PREV
bran
PREV OF LAST GASK LEAVE 1
LAST GASK FCONN TO PREV LEAVE 1
LAST FLAN FCONN TO PREV
BRAN
Conn PT to Last mem
$!mode
endmethod
|
|