I doubt that anyone has published a helper method to do exactly what you are looking for. But you have the logic correct. First clear the selection (in case the user has something selected). Then search through all entities and find the ones on the wrong side of x. Then add all those to the selection set.
` model = Sketchup.active_model
ents = model.active_entities
sel = model.selection
sel.clear!
ents.each do |e|
if e is on the wrong side of x- Add your code here sel.add e
end
end`
Everything in that "your code ghoes here" part needs to decide what type of entity is being looked at and then you have to specify how to determine if that entity is on the wrong side of x. To simplify it, you could just look at the bounding box of each entity and determins if the center of the bounding box is on the wrong side of x. If it is, then add it. That would be the simplest way and would look something like this:
if e.bounds.center[0] > my_x sel.add e end
Chris
I guess I pretty much wrote the whole thing, so I might as well just finish it up. Here is a whole little snippet of working code:
` model = Sketchup.active_model
ents = model.active_entities
sel = model.selection
sel.clear
my_x = 0.0
ents.each do |e|
if e.bounds.center[0] > my_x
sel.add e
end
end`