测试Maxscript中ListBox双击清空列表,右键选择全部

测试Maxscript中创建的ListBox 双击清空列表,右键选择全部

 1 rollout AAA "测试双击清空列表" width:162 height:300    
 2 (    
 3     listbox SSS "list" pos:[24,39] width:108 height:8    
 4     button btn12 "Button" pos:[21,201] width:113 height:42    
 5       
 6     global BB = #()    
 7     global BB1 = #()   
 8     fn getBB =    
 9         (    
10          sel = getCurrentSelection()    
11          for a=1 to sel.count do    
12         (    
13            if sel[a].modifiers[#skin] != undefined then append BB sel[a].name   --有skin的物体,将他们的名字加入到BB  
14        if sel[a].modifiers[#skin] != undefined then append BB1 sel[a]       --有skin的物体,将他们自身加入到BB1  
15         print BB    
16         )    
17         )    
18         
19     on SSS selected nameIndex do     --测试单击列表里的名字  
20     (    
21         select (getNodeByName SSS.items[nameIndex])    
22         )    
23     on SSS doubleClicked nameindex do  --测试双击列表里的名字  
24 (    
25     temp = SSS.items                 
26     print SSS.items.count    
27     print nameindex    
28     
29     x = 0    
30     for a=1 to SSS.items.count do   --for循环 列表项目的数量次   
31     (    
32         print (x+1)    
33        deleteItem temp (x+1)       --删除列表中的项目  deleteItem <array> <number>   
34     )    
35     SSS.items = temp    
36 )    
37     on SSS rightClick nameIndex do    --测试右键单击列表里的名字  
38     (  
39         select (for a in BB1 where a.name!=undefined collect a)     --选择BB1中名字不等于未指认的物体  
40     )  
41     on btn12 pressed do    
42     (    
43         select geometry    
44         getBB()    
45         SSS.items = BB    
46     )    
47 )    
48 createdialog AAA  

 

posted @ 2017-09-15 09:45  zolin7  阅读(472)  评论(0编辑  收藏  举报