Replace multiple objects
Replace multiple objects
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

!!! 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
* Inkscape Tutorial Basics A different approach... http://tinyurl.com/3pextp3
* What do I use Inkscape for http://tinyurl.com/3pbna6l
Re: Replace multiple objects
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
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

Re: Replace multiple objects
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?
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
* Inkscape Tutorial Basics A different approach... http://tinyurl.com/3pextp3
* What do I use Inkscape for http://tinyurl.com/3pbna6l
Re: Replace multiple objects
If I told you that was a miss spelling - what do you think it mean?Bucic wrote:What does 'anc copy' mean?
Hint: I'ts the oposie of "or"

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

Re: Replace multiple objects
Grobe,
'and' is not opposite of 'or'
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.
'and' is not opposite of 'or'

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

!!! 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
* Inkscape Tutorial Basics A different approach... http://tinyurl.com/3pextp3
* What do I use Inkscape for http://tinyurl.com/3pbna6l
Re: Replace multiple objects
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.
Re: Replace multiple objects
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
* Inkscape Tutorial Basics A different approach... http://tinyurl.com/3pextp3
* What do I use Inkscape for http://tinyurl.com/3pbna6l
Re: Replace multiple objects
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
* Inkscape Tutorial Basics A different approach... http://tinyurl.com/3pextp3
* What do I use Inkscape for http://tinyurl.com/3pbna6l
-
- Posts: 138
- Joined: Mon Apr 07, 2008 6:01 am
Re: Replace multiple objects
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.
We don't inherit the Earth from our parents; we borrow it from our children.
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Replace multiple objects
Selecting objects will highlight them in the Objects panel...
Selecting a single object will highlight it in the XML editor.
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/
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/
-
- Posts: 138
- Joined: Mon Apr 07, 2008 6:01 am
Re: Replace multiple objects
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
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.
We don't inherit the Earth from our parents; we borrow it from our children.
Re: Replace multiple objects
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.....
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.....
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Replace multiple objects
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.
And of course, names are easy to search: viewtopic.php?f=5&t=33018#p101338
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/
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/
Re: Replace multiple objects
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 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!
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Replace multiple objects
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.
Re: Replace multiple objects
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.
Anyway, thanks for letting me know. I'll bookmark it, until I can either find a tutorial, or the manual gets updated.
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design