解决场景有重名问题 (给同事写)


zongzu =#()
for i in Objects do
(
    append zongzu i.name
)
 重名收集 =#()
   重名=#()
for i in zongzu  do
(
    if findItem  重名收集 i ==0 then
    (
         append 重名收集 i
    )else
    (
        append 重名 i
    )
)
    
--重名 就是 重名子的 但是还是在要  唯一化 一次

 唯一化重名 =#()
     if 重名.count >0 then
     (
          for i in 重名 do
          (
              if findItem  唯一化重名 i ==0 then
              (
                  append 唯一化重名 i
              )
          )
      )
     
      --- 现在  唯一化重名  就是场景中重的名字
      engarray =#()
      for i in 1 to 唯一化重名.count do
      (
             ccname =  (execute("$"+唯一化重名[i]+"*")) as Array
            append engarray ccname
      )
      engarray --- 就是最后重名数组
     
     
     

原文地址:https://www.cnblogs.com/gaitian00/p/2582473.html