zoukankan      html  css  js  c++  java
  • 数组

    数组的一些基础用法

    mybox=$Box* as array --收集数组元素
    deleteItem mybox 1 --根据下标删除数组中的元素
    sel=selection as array --将选择的物体作为数组赋值给sel

    数组排序

    --方法1
    allBoxes
    =selection as array --收集元素 objNames=for i in allBoxes collect i.name --收集物体的名字 sort objNames --排序 sortedObj=for i in objNames collect(getNodeByName i) print sortedObj ----------------------------------------------------------------------- --方法2
    objs
    = for i in $Box* collect i.name -- 收集获取到的物体名字 sort objs -- 排序 objs = for i in objs collect (getNodeByName i) print objs --在侦听器中打印结果 ----------------------------------------------------------------------- --方法3
    objs
    = for i in $Box* collect i.name -- 使用BitArray来定义索引 index = #{1,2,3,4,5} -- 通过索引重新定义 objs = for i in index collect (objs[i]) print objs -- 在侦听器中打印结果 ----------------------------------------------------------------------- objs = for i in $Box* collect i.name sort objs objs=for i in objs collect(getNodeByName i) index=#{1,2,3,4,5} objs=for i in index collect(objs[i]) select objs
  • 相关阅读:
    Python方法
    Cpp求PI
    Asp.net身份验证和授权
    [转] 魔兽系列事件报道
    directxsdk aug 2006
    [转]转变的开始!NVIDIA更换新Logo
    wxWidgets 2.7.0 released
    OpenGL 和 Vista(续)
    暴雪员工的跳槽纪录
    3D版的星际争霸
  • 原文地址:https://www.cnblogs.com/amixc/p/4016950.html
Copyright © 2011-2022 走看看