Replace multiple objects

Post questions on how to use or achieve an effect in Inkscape.
User avatar
Bucic
Posts: 128
Joined: Fri Apr 24, 2009 2:50 am
Location: Poland

Replace multiple objects

Postby Bucic » Tue Oct 19, 2010 4:03 am

Is it possible to replace e.g. 20 objects 'X' with 20 objects 'Y'. I would like to replace some of the switches with an updated version

Image
!!! Support wishlist: A new perspective / transformation tool http://tinyurl.com/3uacua4
* Inkscape Tutorial Basics A different approach... http://tinyurl.com/3pextp3
* What do I use Inkscape for http://tinyurl.com/3pbna6l

User avatar
Grobe
Posts: 411
Joined: Tue Feb 02, 2010 2:20 am

Re: Replace multiple objects

Postby Grobe » Fri Oct 22, 2010 12:25 pm

I'll almost about to say "paste in place". But unfortunately it has the opposite effect.

Workaround:
1 - Duplicate the object you want to replace the original object.
2 - Select the original object anc copy.
3 - Select second object and do a "Paste size".
4 - Center the replacing object to the original object both horisontal and vertically.
-----------
Repeat for each object
:lol:

User avatar
Bucic
Posts: 128
Joined: Fri Apr 24, 2009 2:50 am
Location: Poland

Re: Replace multiple objects

Postby Bucic » Fri Oct 22, 2010 5:31 pm

What does 'anc copy' mean?

It seems that this procedure not only does not allow replacing multiple objects at once but also doesn't even do positioning for me even if I replace each object, one by one.

What is the advantage of this procedure over totally manual replacement of each object then?

Paste Size scales the whole selection to match the overall size of the clipboard object(s).
!!! Support wishlist: A new perspective / transformation tool http://tinyurl.com/3uacua4
* Inkscape Tutorial Basics A different approach... http://tinyurl.com/3pextp3
* What do I use Inkscape for http://tinyurl.com/3pbna6l

User avatar
Grobe
Posts: 411
Joined: Tue Feb 02, 2010 2:20 am

Re: Replace multiple objects

Postby Grobe » Sat Oct 23, 2010 12:14 am

Bucic wrote:What does 'anc copy' mean?
If I told you that was a miss spelling - what do you think it mean?

Hint: I'ts the oposie of "or" ;)


Bucic wrote:What is the advantage of this procedure over totally manual replacement of each object then?
This is my idea of the procedure involving "totally manual replacement of each object".

What's your method then?
:lol:

User avatar
Bucic
Posts: 128
Joined: Fri Apr 24, 2009 2:50 am
Location: Poland

Re: Replace multiple objects

Postby Bucic » Wed Oct 27, 2010 5:15 am

Grobe,

'and' is not opposite of 'or' :D

I don't have any procedure yet. I know that right now I would have to replace every single X by Y's, including positioning. This is not a solution but a description of the problem ;) Your procedure, if I got it right, does nothing more except scaling which isn't needed as I would prepare Y to replace X's in the right scale already.
!!! Support wishlist: A new perspective / transformation tool http://tinyurl.com/3uacua4
* Inkscape Tutorial Basics A different approach... http://tinyurl.com/3pextp3
* What do I use Inkscape for http://tinyurl.com/3pbna6l

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Replace multiple objects

Postby druban » Thu Oct 28, 2010 5:18 am

Bucic, after thinking about your problem I have to say that there is no solution to do this in one step or easily. I am thinking of a word processor type find and replace function but I don't think xml files that manipulable. The only thing that might ease the process is that you could copy the transform attributes of the object to be replaced and then paste them in after replacing the object. If there are lots of objects you could get a nice repetitive rhythm going and do it quite fast...
Your mind is what you think it is.

User avatar
Bucic
Posts: 128
Joined: Fri Apr 24, 2009 2:50 am
Location: Poland

Re: Replace multiple objects

Postby Bucic » Thu Oct 28, 2010 5:40 am

druban wrote:Bucic, after thinking about your problem I have to say that there is no solution to do this in one step or easily. I am thinking of a word processor type find and replace function but I don't think xml files that manipulable. The only thing that might ease the process is that you could copy the transform attributes of the object to be replaced and then paste them in after replacing the object. If there are lots of objects you could get a nice repetitive rhythm going and do it quite fast...

You actually gave me an idea or at least something to check out. I'm thinking of naming my object X (to be replaced) and open svg in Notepad++. I should be able to find sections that define my object X and replace them with sections that define object Y (to replace X with). What do you think? I have never edited svg using a text editor...
!!! Support wishlist: A new perspective / transformation tool http://tinyurl.com/3uacua4
* Inkscape Tutorial Basics A different approach... http://tinyurl.com/3pextp3
* What do I use Inkscape for http://tinyurl.com/3pbna6l

User avatar
Bucic
Posts: 128
Joined: Fri Apr 24, 2009 2:50 am
Location: Poland

Re: Replace multiple objects

Postby Bucic » Mon Nov 08, 2010 6:22 pm

I tried following the idea above but I can't figure out where exactly one object 'starts' and where it 'ends' in an svg file (opened using Notepad++).
!!! Support wishlist: A new perspective / transformation tool http://tinyurl.com/3uacua4
* Inkscape Tutorial Basics A different approach... http://tinyurl.com/3pextp3
* What do I use Inkscape for http://tinyurl.com/3pbna6l

seans_potato_biz
Posts: 138
Joined: Mon Apr 07, 2008 6:01 am

Re: Replace multiple objects

Postby seans_potato_biz » Thu Oct 05, 2017 10:05 am

Is there a solution to this yet? I also thought of editing the SVG in a text editor but will have the same problem. It would be nice if you had some sort of hybrid program where you could select an object in the GUI and it would highlight the relevant code.
Win 7/10, Inkscape 0.92.2

We don't inherit the Earth from our parents; we borrow it from our children.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Replace multiple objects

Postby tylerdurden » Thu Oct 05, 2017 10:13 am

Selecting objects will highlight them in the Objects panel...

Selecting a single object will highlight it in the XML editor.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

seans_potato_biz
Posts: 138
Joined: Mon Apr 07, 2008 6:01 am

Re: Replace multiple objects

Postby seans_potato_biz » Thu Oct 05, 2017 12:27 pm

Thanks. Unfortunately, although those unique names enabled me to identify the code that define one of these objects, it's also going to prevent me from using the find and replace feature. This is way too complicated.

This method should be quicker (uses "exchange positions of selected objects" function): https://www.youtube.com/watch?v=9SNvArDGzDU
Win 7/10, Inkscape 0.92.2

We don't inherit the Earth from our parents; we borrow it from our children.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Replace multiple objects

Postby brynn » Fri Oct 06, 2017 1:53 am

Hah, this one was so old, we can't even see the image in the op anymore!

As TD said, selecting an object highlights it in both the Objects dialog and XML Editor. And it's vice versa, as well!

But reading the op, I wonder if they might have been looking for Edit menu > Find/Replace? It allows you to find objects with certain attribute or style or other parameter, and to replace them with something else.

How is the object id preventing you from using Find/Replace? I think Find/Replace does uses the object id, as one of the parameters.....doesn't it?

I've actually never used it to replace. I have only used it to find, and then I change whatever I wanted to change. But to replace with a whole different object....I'll have to read up on that. Let's see if I can find anything about it.....

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Replace multiple objects

Postby tylerdurden » Fri Oct 06, 2017 2:15 am

In CAD, it's best-practice to name each object as it's created. This can also be best practice in illustration/diagramming.

Keeping the object properties dialog open during work allows the ID or label to be entered as objects are created.
    The IDs will be listed in the XML editor, easy to view.
    The Labels will be easy to see in the Objects dialog.

And of course, names are easy to search: viewtopic.php?f=5&t=33018#p101338
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Replace multiple objects

Postby brynn » Fri Oct 06, 2017 2:22 am

Hhm, yeah I was trying to find something on it the other day too. But I can't seem to find anything.

I'm sure Xav has covered it, in his series of tutorials, which come monthly in Full Circle magazine. (viewtopic.php?f=6&t=11981)

But I'm not sure how to search out a particuliar topic. If he doesn't see this and reply, I can give you 6 links to 6 special editions. Searching 6 would be easier than 60!

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: Replace multiple objects

Postby Xav » Fri Oct 06, 2017 2:29 am

brynn wrote:Hhm, yeah I was trying to find something on it the other day too. But I can't seem to find anything.

I'm sure Xav has covered it, in his series of tutorials, which come monthly in Full Circle magazine. (viewtopic.php?f=6&t=11981)

But I'm not sure how to search out a particuliar topic. If he doesn't see this and reply, I can give you 6 links to 6 special editions. Searching 6 would be easier than 60!



I'm not entirely sure what "it" is in the context of this thread, but I guess you might be looking for this one (from the first post in the linked thread):

xav wrote:* Full Circle Magazine #122: Part 62 - New in 0.91/0.92: Finding & selecting objects.


It's a fairly recent article, so isn't in any of the special editions yet.

If "it" is something other than the Find/Replace dialog, please clarify and I'll try to point you in the right direction.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Replace multiple objects

Postby brynn » Fri Oct 06, 2017 2:40 am

Yes, I mean Find/Replace. I named it in my first message. But since replies are coming so fast today, I thought I should post a 2nd reply, rather than edit the first. In this case, someone else replied in between, making it harder to realize what I meant.

Anyway, thanks for letting me know. I'll bookmark it, until I can either find a tutorial, or the manual gets updated.


Return to “Help with using Inkscape”