@earthmover said:
Thanks BTM - that makes sense and I follow the logic behind the code. Perhaps I will try and find time to learn the language. I am good at obsessing and not so good at multi-tasking, so it may have to wait till the snow is falling and my work slows down.
Regarding the script, it indeed is working. However, it is not properly defining the edges end bounds. The script is selecting any edge which has one of the their bounds (verticies) corresponding with the selection, so it is thus selecting also vertical lines and diagonal lines who's start bounds is on the Z in relevance to the selection. Any suggestions for further defining the end bounds so that the script will only select lines only completely on the same XY plane as the selection?
Ah, here:
def selectedgesbyz()
model=Sketchup.active_model
ss=model.selection; edge=ss[0]; ss.clear
model.active_entities.each{|e|ss.add(e)if e.class==Sketchup;;Edge and (edge.start.position.z)== (edge.end.position.z) and (e.bounds.min.z)==(edge.start.position.z) and (e.bounds.max.z)==(edge.start.position.z)}
end#if
UI.menu("Plugins").add_item("Select Edges by Z"){selectedgesbyz} if not file_loaded?(File.basename(__FILE__))
file_loaded(File.basename(__FILE__))