Message 1 of 6
How to exclude instances from a selection?

Not applicable
11-01-2009
04:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Need some help...
I have a whole heap of objects (some instances) and want to create a new array of all the objects except the instances.
This is my attempt, but can't get it to work?
Thanks
I have a whole heap of objects (some instances) and want to create a new array of all the objects except the instances.
This is my attempt, but can't get it to work?
ss = getCurrentSelection()
newSS = #() -- the new array
append newSS ss --put the first object in it
for i = 2 to ss.count do -- go through all the object I have selected
(
thecurrentNode = ss -- the selected node
for j = 1 to newSS.count do -- go through the new array
(
theArrayNode = newSS-- get the object from the new array
if (areNodesInstances thecurrentNode theArrayNode) == false then -- check if the selected node is an instance of the new array node
(
if (finditem newSS thecurrentNode) == 0 then -- check that selected node isn't already in the array
(
append newSS thecurrentNode -- add the selected node to the new array
print ("not instance = " + thecurrentNode.name)
)
)
)
)
Thanks