The inkscape GUI shows an object's X, Y, W and H across the top. You can also get these from the command line by querying all objects in the SVG file.I cannot see anything in the inkex module which will provide this information.
https://inkscape.gitlab.io/extensions/documentation/source/inkex.elements._base.html?highlight=bounding%20box#inkex.elements._base.ShapeElement.bounding_box
selection_list = self.svg.selected
for item in selection_list:
item_id = item.get_id()
bbox = item.bounding_box()
inkex.errormsg(f'item id {item_id} x1 {bbox.left} y1 {bbox.top} width {bbox.width} height {bbox.height}')
The bounding box of text cannot be obtained this way.
Hi,
I want to know with and height of a text object. But nothing above is working. When I print bbox I obtain this:
BoundingBox((-56.0, -56.0),(-187.13548107485641, -187.13548107485641))
Is anyone can help me.
Thank's
https://inkscape.org/forums/extensions/issuess-with-bounding-boxes/
2nd post down on this thread.
The inkscape GUI shows an object's X, Y, W and H across the top. You can also get these from the command line by querying all objects in the SVG file.
I cannot see anything in the inkex module which will provide this information.
https://inkscape.gitlab.io/extensions/documentation/source/inkex.elements._base.html?highlight=bounding%20box#inkex.elements._base.ShapeElement.bounding_box
selection_list = self.svg.selected
for item in selection_list:
item_id = item.get_id()
bbox = item.bounding_box()
inkex.errormsg(f'item id {item_id} x1 {bbox.left} y1 {bbox.top} width {bbox.width} height {bbox.height}')
The bounding box of text cannot be obtained this way.
Hi,
I want to know with and height of a text object. But nothing above is working. When I print bbox I obtain this:
BoundingBox((-56.0, -56.0),(-187.13548107485641, -187.13548107485641))
Is anyone can help me.
Thank's
https://inkscape.org/forums/extensions/issuess-with-bounding-boxes/
2nd post down on this thread.
Thank's
Thank's