OOf...
Glad to find this thread. Several of our placement tools have started failing in SU 8.
We were using raytest to try to find a specific object behind the cursor, and then hiding anything we did not want to locate.
In this example, we are placing a component, and want raytest to ignore the component we are placing (We make it visible so the user can see it). This is from our "spray paint" tool which is trying to place trees randomly on the ground, but not on other trees which we just placed.
item = model.raytest ray
#Ignore any elements of the same type we are placing
hidden_ents = Array.new
while(item != nil && item[1].at(0).kind_of?(Sketchup;;ComponentInstance) && item[1].at(0).definition == definition)
hidden_ents.push(item[1][0])
item[1][0].hidden = true
item = model.raytest ray
end
hidden_ents.each {
|ent|
ent.hidden = false
}
However, in SU 8, hiding the component instance, when it is under the cursor - does not leave it out of the ray test. (We also discovered a nasty bug where we were looping forever if we are over the component being placed)
Can anyone think of a way to place components at the end of a ray, but ignore certain elements. Apparently .hidden will not work, and not even placing them on a temporary hidden layer. I haven't tried deleting them, (and then aborting the delete operation), yet. But it seems pretty painful.