Inkscape.org
Beyond the Basics How to Accomplish Multiple Objects Replacements ('Find and Replace")
  1. #1
    Hum Hum @Hum
    *

    Hi. I am wondering if there is a series of steps within Inkscape, or an extension, or some xml coding trick to do the following ...

    (I do not know if there is such a "global" find and replace process that can accomplish this or not.)

    1 - Select a source shape (such as a triangle (already converted to path) and then

    2 -  replace all other existing objects on the page ... while keeping their same x and y coordinate positions  ... while maintaining the same object size (dimensions)  color, stroke and fill of the "source" object. 

    So, basically a "global replacement" of all those "destination"  objects to match that of the "source" object.

    For example - if there is a series of leaf-like objects on the page and by using a series of steps or and extension, revised xml code, etc.  to replace each of those leaf-like objects with the "source" triangle objects. 

    So, whether the "destination" objects were originally the same size or the same shape or not, and regardless of their number (whether 1, 34, etc.) the replacement activity would end up with the same number of objects - at their same x and y locations - only they would now show as triangles ... with the same attributes of the "source" object.

    (I don't know if there is a means to find these destination objects by their ID identifications and then re-write their code to match the objects attributes of the source object, or not.)

    I hope this idea is clear enough.

    Thank you!

  2. #2
    Tyler Durden Tyler Durden @TylerDurden
    *

    The Align & Distribute dialog has the fundamentals of what you seek. X number of selected objects can be replaced with x number of additional selected objects.

    This refers to xy positioning... I'm not sure if there is also a means to manage z-order, if that is also required.

    e.g. 42 dark red stars position can be switched with 43 green triangles position.

     

     

    I recall an earlier discussion on this concept or similar, but the conclusions escape me.

  3. #3
    Paddy_CAD Paddy_CAD @Paddy_CAD
    😀

    Hi Ken.  I think I understand the question.  Hopefully this will help.

    With the select tool, select all the "old" objects and the "new" replacement objects.  Now [shift+ctrl+a] to open the Align and Distribute dialog.  Click [Exchange positions of selected objects - stacking order] and repeat for each object.

    The new objects will replace the old objects at the same rotation centre, but it won't reproduce the sizes and colours.  I need to think some more about that.

    (This suggestion has been adapted from a previous forum discussion. https://inkscape.org/forums/questions/dots/#c32795)

  4. #4
    Hum Hum @Hum

    Wow. Thanks for the quick responses.

    I will investigate these ideas later today. My big thanks to you.

  5. #5
    berteh berteh @berteh

    thanks @Paddy_CAD, didn't know that feature and it saved me a few hours of tedious manual work !

Inkscape Inkscape.org Inkscape Forum Beyond the Basics How to Accomplish Multiple Objects Replacements ('Find and Replace")