测试Maxscript中创建的ListBox 双击清空列表,右键选择全部
rollout AAA "测试双击清空列表" width:162 height:300
(
listbox SSS "list" pos:[24,39] width:108 height:8
button btn12 "Button" pos:[21,201] width:113 height:42
global BB = #()
global BB1 = #()
fn getBB =
(
sel = getCurrentSelection()
for a=1 to sel.count do
(
if sel[a].modifiers[#skin] != undefined then append BB sel[a].name --有skin的物体,将他们的名字加入到BB
if sel[a].modifiers[#skin] != undefined then append BB1 sel[a] --有skin的物体,将他们自身加入到BB1
print BB
)
)
on SSS selected nameIndex do --测试单击列表里的名字
(
select (getNodeByName SSS.items[nameIndex])
)
on SSS doubleClicked nameindex do --测试双击列表里的名字
(
temp = SSS.items
print SSS.items.count
print nameindex
x = 0
for a=1 to SSS.items.count do --for循环 列表项目的数量次
(
print (x+1)
deleteItem temp (x+1) --删除列表中的项目 deleteItem <array> <number>
)
SSS.items = temp
)
on SSS rightClick nameIndex do --测试右键单击列表里的名字
(
select (for a in BB1 where a.name!=undefined collect a) --选择BB1中名字不等于未指认的物体
)
on btn12 pressed do
(
select geometry
getBB()
SSS.items = BB
)
)
createdialog AAA