Re: Select all objects which are "within" a selected rectangle?
Otfried Cheong <[email protected]>
| Newsgroups | gmane.comp.graphics.ipe.general |
|---|---|
| Message-ID | <[email protected]> |
On 11/26/2011 10:37 AM, elwood151 wrote: > I want to select some of those graphs and select all objects in the square > to modify them with an ipelet or "by hand". > (Clicking on each single object is slow and prone to errors, as I'm having > hundreds of such graphs to modify). > It would be great if I could just select the squares I want to change and > IPE could add all objects to the selection which are "within" those squares. Can't you just drag out a selection rectangle? The other obvious idea would be to change your workflow so that it groups together each graph - then clicking on it would be enough to select the entire graph. Finally, one could of course make an ipelet that selects exactly the objects inside the primary selection. So select a box, call the ipelet. Here is an attempt at such an ipelet. Cheers, Otfried _______________________________________________ Ipe-discuss mailing list Ipe-discuss-rGrgPyRx506NN8uzcEdRPYRWq/[email protected] http://lists.science.uu.nl/mailman/listinfo/ipe-discuss
selectbox.lua
(text/x-lua, 860 B)
----------------------------------------------------------------------
-- Select objects within bounding box of primary selection
----------------------------------------------------------------------
-- To assign a shortcut to this:
-- shortcuts.ipelet_1_selectbox = "Alt+E"
label = "Select inside"
about = [[
Select objects that are inside the bounding box of the primary selection.
This ipelet is part of Ipe.
]]
function run(model, num)
local p = model:page()
if not p:hasSelection() then
model.ui:explain("no selection")
return
end
local prim = p:primarySelection()
local box = p:bbox(prim)
p:deselectAll()
for i = 1,#p do
local b = p:bbox(i)
if i ~= prim and box:contains(b) then p:setSelect(i, 2) end
end
p:ensurePrimarySelection()
end
----------------------------------------------------------------------