spakin / SimpInkScr

Simple Inkscape Scripting
https://inkscape.org/~pakin/%E2%98%85simple-inkscape-scripting
GNU General Public License v3.0
320 stars 31 forks source link

is it possible to select an existing object by id? #117

Closed r03ert0 closed 8 months ago

r03ert0 commented 9 months ago

Thank you for the great extension! I would like to do a boolean operation between a list of generated objects and an existing object. Using the SVG editor in Inkscape I added an "id" to the object I would like to use. Is it possible to select that object by id and assign it to a variable?

r03ert0 commented 9 months ago

found it!

does this sound ok?

obj = None
for r in all_shapes():
    if r._inkscape_obj.eid == 'obj':
        obj = r
        break
if obj:
    obj.style(fill='red')