Inkscape.org
Community Café How would you like to custom select on canvas ?
  1. #1
    inklinea inklinea @inklinea⛰️

    What would you like to be able to select on canvas by using an extension.

    I am writing a new selection extension.

    As you may know there are a few ways to select objects in Inkscape.

    Manually selecting, using the mouse:

        * With left click / left click + shift for multi select
        * Holding Alt, to left click draw a line to select objects touched by that line

    With the keyboard:

        * Ctrl-A to select all
        * Clrl-Alt-A select all in all layers

    With the Edit Menu:
        * Select Same -- Fill and Stroke / Fill Colour / Stroke Style / Object Type
        
    From the Find / Replace Panel:
        Various options :)
        

    From Inkscape 1.2 onwards on Windows and Ubuntu, it's possible to select on canvas via extension code using dbus actions.

    At the moment I have select by bounding box width / height / area  and various bounding box coordinate positions.

    It's also possible to  select by css selectors 

    https://www.w3schools.com/cssref/css_selectors.asp

    If you have any ideas by which you would like to specify a select - please post them here :)


     

  2. #2
    bleke bleke @bleke

    I don't know if it counts as 'on canvas', but I would like to select nodes that are on top of each other or very close to each other and delete them, leaving one node. Preferably maintaining the curvature of the lines. Similar to Blender's 'merge by distance'.

  3. #3
    Hum Hum @Hum
    *

    This sounds like a great idea.

    Is it possible to select multiple objects that are within a specific distance apart? Such as all objects within 250 px of one another? Or, in a similar way, only objects that are greater than a specified distance apart? (Distance measured from the center of the individual objects.)

    How about all objects that are currently overlapping - where one object's bounding box overlaps with another object's bounding box?

    Going for broke here - how about all objects whose perimiter is less than or greater than a specified range. For example, if a circle convertef to a path has a perimeter of 500 px and a polygon has a perimeter of 350 px, and you wanted all objects selected that invidually had a perimeter length of less than 600 px? No matter where on the layer they were located.

    Another idea - select all objects that consisted of less than or more than x number of nodes? Such as less than 8 nodes or more than 4 nodes?

    How about selecting all closed shapes versus selecting all non-closed shapes?

    *** How about selecting the opposite of the current selection? That is if you currently have selected 3 objects and there are 5 more that are not selected, it would "reverse" itself ... select the 5 and unselect the 3 originally used? Like a toggle switch.

    How about selecting all groups verus selecting all non-grouped pbjects?

    Forgive me ... but here is another counter idea. For any of the suggestions mentioned above ... if they could not be collectively selected, could their stroke color be set to a user specified color? That way, the intended objects could be "flagged" by their stroke color? The user could specify a pink color (or whatever) and would know visually that all newly colored  (stroke color only) would meet certain criteria?

    These may not be feasible. But it gives one ideas to consider, and may help others to derive at other ideas.

    Thank you so very much, Inklinea.

  4. #4
    GwenaëlQ. GwenaëlQ. @GwenaëlQ.

    Hello,

    I miss a lot a feature that would select objects "inside" an already existing path, with two options: "select only complete objects" or "select even if only partially inside"

    Couldn't find a feature request on Gitlab but pretty sure I already asked for it somewhere !

    Thanks for listening !

     

     

  5. #5
    inklinea inklinea @inklinea⛰️

    Thanks for the suggestions :)

    bleke

    I'm not sure about the node based solutions I'll have to see if it's possible to get down to the node level :)

    Ken - I can have a look at selection based on distribution / overlaps

    Perimeters of bounding boxes are easy :0 for the actual path perimeter - hmm, that might be a bit hard.

    Groups vs non groups should be doable.Either in the document generally speaking or for children of a selection.

    I did write something that compares the areas of shapes by counting the number of pixels in 'make bitmap copy' was a bit slow thought

    The colouring of objects based on a criteria - I have that in one of my earlier extensions - its a workaround - but could also be a feature.

    GwenaëlQ

    hmm, overlaps of shapes thats a good one, I think maybe some kind of boolean and see if there is any remainder - in fact that's sort of a step towards a lasso feature lol
    Might be a bit beyond me at this stage.

    Thanks everyone for the ideas. 
    I'll update in the extensions section if I get it made.
     

  6. #6
    Hum Hum @Hum

    Thank you, for all you do. Your work is always helpful, Inklinea.

  7. #7
    Tyler Durden Tyler Durden @TylerDurden
    ken10001000

    *** How about selecting the opposite of the current selection? That is if you currently have selected 3 objects and there are 5 more that are not selected, it would "reverse" itself ... select the 5 and unselect the 3 originally used? Like a toggle switch.

    This exists in Edit>Invert selection. Works with nodes as well. Uses the ! key.

  8. #8
    Hum Hum @Hum
    *

    Thank you, Tyler. This ! (exclamation mark shortcut) was "right up under my nose" all this time, and I never knew about it. This can be a big help. I very much appreciate your sharing this information.

  9. #9
    inklinea inklinea @inklinea⛰️

    Details of a working extension - a proof of concept here:

    I've tested on Ubuntu and Windows 10.

    https://inkscape.org/forums/extensions/selection-plus/

Inkscape Inkscape.org Inkscape Forum Community Café How would you like to custom select on canvas ?