截图代码记录

[email protected]

 

----------------------------

截图代码

xx = gw.getviewportdib()
display xx

---------------------------- 

时间控制代码

rollout test "Test Timer"

(

timer clock "testClock" interval:1000 --tick once a second

label test "0"

on clock tick do

(

valUp = (test.text as integer)+1

test.text = valUp as string
mybox = box pos:[0,0,(valup*50)]
completeredraw()

)

)

createDialog test

---------------------------------

选择场景中最大的模型


bbxdistance_Ary =for i in geometry where classof i != BoneGeometry collect (distance i.max  i.min)
getbiggest = amax bbxdistance_Ary
for i in geometry where classof i != BoneGeometry do
(
 if (distance i.max  i.min ) == getbiggest do select i
)
macros.run "Tools" "Isolate_Selection"

------------------------------------------------

amax 将这个函数自己代码实现

求数组中最大值

global temp = 0 --声明一个临时变量用于存放数值

getbbxdistance_ary = for i in geometry collect distance i.max i.min --收集所有模型BOUNDINGBOX的对角线长度
 
for i=1 to getbbxdistance_ary.count do  ---循环,如果数组里的数值大于TEMP便将该值赋予TEMP
 (
  if getbbxdistance_ary[i]>temp then temp = getbbxdistance_ary[i]
 )
 
temp --返回最大值

 

 按上面推理出最小值
for i=1 to getbbxdistance_ary.count do  ---循环,得出最大数值,然后在对比数组,发现比TEMP小便将该值赋予TEMP
 (
  if getbbxdistance_ary[i]<temp then temp = getbbxdistance_ary[i]
 )
 
temp --返回最小值

-------------------------------------------------------------------

----当一个DIALOG关闭后执行的操作

rollout callclosert ""
(
   timer clock "test" interval:100
    on clock tick do
   (
     if not aa.open do
     (
      print"aa is closed"
      try(DestroyDialog callclosert )catch()
     )
   )
 )
 
rollout aa "aa" width:162 height:93
(
 on aa close do
 (
    createdialog callclosert
     
 )
 )
createdialog aa 100 100

你可能感兴趣的:(代码)