How to export object attributes as data

Post questions on how to use or achieve an effect in Inkscape.
crystallography
Posts: 1
Joined: Thu Mar 03, 2016 2:32 am

How to export object attributes as data

Postby crystallography » Thu Mar 03, 2016 2:42 am

Hello,

I am wondering if it is possible to highlight numerous objects (e.g. line segments) and export data (e.g. length of each segment) from each object.

What I am trying to do: I have imported a jpeg image, made numerous "measurements" of features on top of the image by drawing lines over each feature, and I would like to export the data from each of these lines so I can get a list of all the measurements. I could do this manually by reading and typing the length of each line segment as indicated by the "Width of selection", but I am hoping to do this for >1000 objects and figured there must be an easier way.

I have found previous threads with similar requests ("Exporting Nodes Coordinates" http://www.inkscapeforum.com/viewtopic.php?t=8826). The extensions offered by past users are helpful at exporting the coordinates of each object, but not other object attributes such as the length of line segments.

Apologies if this has been answered previously.

Many thanks for your help

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

Re: How to export object attributes as data

Postby brynn » Thu Mar 03, 2016 12:12 pm

I don't think it's ever been asked previously, much less answered!

To my understanding, I think you would need a custom script to do this. I know little to nothing about writing scripts, so I can't help with that. But if it's a simple script, and if someone here has a few spare minutes, they might volunteer. Or maybe if someone wants to learn how to write extensions, this might be a good "starter" project?

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to export object attributes as data

Postby Lazur » Thu Mar 03, 2016 4:05 pm

There is the extension measure path which could work if those objects are only two noded paths that you can even apply on multiple objects selected at the same time.

If still necessary exporting the texts (why not simply export the image as a png?) then run the "extract text" extension and copy all the values at once.


Return to “Help with using Inkscape”