How to get the ID of an object

Discuss SVG code, accessible via the XML Editor.
richiekosher
Posts: 4
Joined: Thu Mar 22, 2018 12:40 am

How to get the ID of an object

Postby richiekosher » Thu Mar 22, 2018 12:48 am

Hey there,

I want to create a Hovermap of an Infographic I made. So I've got several elements and text as paths.
Now I want to put an XML-Link on the object, a hover-effect etc. Just like in this Tutorial here:
https://www.youtube.com/watch?v=2TM63ing6jY
In the example the guy only got 3 areas so it's not a big problem to set everything up. But in my example there are some 35 path ids and I need to get to know which path is which.

thx for your help

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

Re: How to get the ID of an object

Postby Xav » Thu Mar 22, 2018 2:14 am

The easiest method is to open the Object > Object Properties dialog (Shift-Ctrl-O). As you click on each path you'll see its ID in the dialog. Better still, you can replace the ID with a more descriptive name (make sure you click the "Set" button in the dialog, or your changes will be abandoned as soon as you select another path).
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: How to get the ID of an object

Postby brynn » Thu Mar 22, 2018 2:23 am

Object menu > Objects dialog also displays the ID/label, and it can be changed there as well. The added benefit of the Objects dialog, compared to Object Properties, is that you can see all the objects on the canvas, and in their z-order (instead of opening Object Properties separately each time).

On the other hand, Object Properties also contains some Interactivity options, which you might need. I'm not sure, since I haven't watched the tutorial you mentioned. You may or may not need them.

But anyway, just wanted to mention the Objects dialog :-)

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

Re: How to get the ID of an object

Postby Xav » Thu Mar 22, 2018 5:58 pm

brynn wrote:The added benefit of the Objects dialog, compared to Object Properties, is that you can see all the objects on the canvas, and in their z-order (instead of opening Object Properties separately each time).


The Objects dialog is a good suggestion - but I just want to clarify that you don't need to open the Object Properties dialog 'separately each time': once it's open, clicking around the objects in your canvas will update it to show the properties for the currently selected object.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

richiekosher
Posts: 4
Joined: Thu Mar 22, 2018 12:40 am

Re: How to get the ID of an object

Postby richiekosher » Fri Mar 30, 2018 8:58 pm

Thank you all. I Realited that I can open an XML-Editor and click on the objects to get the "ID" as well!
But I'll try your suggestion too.


Return to “SVG / XML Code”