PickHelper by Layer


Is there a way to limit the PickHelper to only select entities that are on a specific layer.


Not directly but you could query the results from all_picked for objects of a specific layer. I don’t think you can pick “through” an object on another layer as if it was invisible (unless perhaps by hiding the layer very briefly when doing the pick) but when the user clicks where two objects meet you can chose which one to pick.

# let's assume that 'view' and 'layers' are referenced earlier on
# and the named layer has a match
ph = view.pick_helper
pik = ph.all_picked
lay = layers["MyLovelyLayer"]
if lay # layer was found
  col = pik.find_all{|e| e.layer == lay }
else # avoid Layer0 pitfall if layer doesn't exist
  col = []
# the array 'col' is now filtered to just those picked items on that named layer


Thank-you for help on this.

What I am trying to do is setup a hidden layer for openings in floors. Each opening will have a group on a hidden layer that consists of the edges (and face) that define that opening.

When a user wants to edit an opening I will turn the hidden “opening” layer on momentarily while they pick the appropriate opening and then turn it back off once the selection is made.

The idea is allow for “editable” openings. The hidden geometry is essentially storing the opening geometry if that makes sense.


Instead of hiding the geometry paint it with a material set to 0 opacity.