|
本帖最后由 sunqike1985 于 2015-5-8 20:14 编辑
setup form !!zgrid
title 'Create Z-GridLines'
text .CEName 'Gridlines' tagwidth 10 tooltip 'Select Subframework' width 20 is string
button.CE1 'CE' at xmax+2 ymin width 7
text .SBFR 'SBFR Name' tagwidth 10 at xmin.CEName ymax.CEName+0.2 tooltip 'New Structure' width 20 is string
text .FRMWname 'FRMW Name' tagwidth 10 at xmin.SBFR ymax.SBFR+0.2 tooltip 'Select FRMW' width 20 is string
button.CE2 'CE' at xmax+2 ymin width 7
text .Height 'Z-Height' tagwidth 10 at xmin.FRMWname ymax.FRMWname+0.2 width 10 is string
button.create 'Create' width 10 at xmin.Height ymax.Height+1
button.Dis 'Dismiss' width 10 at xmax.create+20 ymin.create
define method .zgrid()
!this.ce1.callback = '!this.CE1()'
!this.ce2.callback = '!this.CE2()'
!this.create.callback = '!this.create()'
endmethod
define method .CE1()
!this.CEName.val = !!ce.fullname
!this.SBFR.val = !!ce.fullname + '/COLUMNS'
endmethod
define method .CE2()
!this.FRMWname.val = !!ce.fullname
endmethod
define method .create()
!NAME = !this.SBFR.VAL
NEW SBFR $!NAME
!HEIG = !THIS.Height.VAL
!CONAME = !this.CEName.val
!NAMES = !!collectAllFor('SCTN','TYPE EQ |SCTN|', !CONAME.DBREF())
$p $!NAMES
DO !i values !NAMES
$p $!i
--!refno = !i.refno.string()
--!ele = !refno[!i]
--!element = !ele
!Gtype = !i.Dbref().Gtype
--$P $!Gtype
if (!Gtype eq 'XGRD' ) THEN
!XPOS = X
!ZPOS = Z
!XNUM = NUMBER
if(Gtype eq 'YGRD' ) THEN
!YPOS = Y
!YNUM = NUMBER
NEW SCTN $!XNUM + '-' + $!YNUM
POSS E$!XPOS Y$!YPOS Z$!ZPOS
POSE E$!XPOS Y$!YPOS Z$!HEIG
endif
endif
ENDDO
endmethod
exit
最后那个create方法里有错误,从!NAMES那行开始,下面的那个循环只能取第一个refno,后面的都取不了,我不知道为什么,希望有会的大神帮忙给看看代码,谢谢了!
|
|