Inkscape.org
Creating New Extensions Getting value of attribute to display on the user interface when selecting an object
  1. #1
    Anonymous Anonymous @Anonymous

    Hi, I'm a beginner on creating extension for Inkscape, currently I made an extension to edit the attribute value of selected object. I'm wondering if there is a way to load the value of selected object to display on the user interface when the user is clicked on another object?

  2. #2
    inklinea inklinea @inklinea⛰️
    *

    When you use an extension, Inkscape sends the entire SVG to the extension, along with some extra data, such as a list of currently selected objects.

    Once your extension is finished, the entire SVG is sent back to Inkscape.

    If you hide the .inx window by removing parameters:

    You can send messages to the user via inkex.errormsg('Hello') or similar. This pops up an error window which can display any info you want.

    There are other options, a small Tkinter popup window could be used which is part of python.

    Or you could have an element just off the page which could be updated each time using getElementById

    The above extension could be assigned to a shortcut key and act upon the current selection.

    It is not possible to update or interact with the main Inkscape Gui though using the extension system.

    There is an attribute browser built into the Edit>XML Editor however.

    Peek 2021 06 12 10 14
Inkscape Inkscape.org Inkscape Forum Creating New Extensions Getting value of attribute to display on the user interface when selecting an object