I'm making a python extension, and need the extension to retrieve a selected groups x, y coordinates.
I think this can be done with the bounding box, but I don't know how to do it.
if there's any other way of doing it I'm all ears.
Retrieve a selected groups x, y coordinates?
Re: Retrieve a selected groups x, y coordinates?
Did you see the bounding box functions in simpletransform.py in the extensions directory? If it doesn't need to be 100% exact, you can use that. Else you can query the coordinates using the command line from inside the extension. There are many extensions that do this, but I can't give you a concrete example atm.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: Retrieve a selected groups x, y coordinates?
Hi Moini.
Yes I did see simpletransform / boxunion, roughBBox, refinedBBox.
I just don't know how to access it. Or what to access.
I'm guessing it should look something like this.
import simpletransform
bbox = simpletransform.refineBBox(node.get('path'))
x = bbox [0] [0] [1] [0]
And what is xmin, and xmax ?
Any help would be appreciated.
Thanks
Yes I did see simpletransform / boxunion, roughBBox, refinedBBox.
I just don't know how to access it. Or what to access.
I'm guessing it should look something like this.
import simpletransform
bbox = simpletransform.refineBBox(node.get('path'))
x = bbox [0] [0] [1] [0]
And what is xmin, and xmax ?
Any help would be appreciated.
Thanks
Re: Retrieve a selected groups x, y coordinates?
Try with computeBBox instead
(which takes a list of objects, see it being used in, e.g., render_scale extension or export jpg extension:
https://github.com/brathering82/inkscape
https://github.com/giacmir/Inkscape-JPE ... -extension )
(which takes a list of objects, see it being used in, e.g., render_scale extension or export jpg extension:
https://github.com/brathering82/inkscape
https://github.com/giacmir/Inkscape-JPE ... -extension )
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: Retrieve a selected groups x, y coordinates?
Thanks, Moini.
I'll take a look at those extensions , and see if I can figure it out.
I'll take a look at those extensions , and see if I can figure it out.