Inkscape.org
Creating New Extensions write extension for creating nanolithography .ely file with python
  1. #1
    lukason lukason @lukason

    Hi Inkscape Users

    I'm completely new to write Inkscape extensions but I want to write an extension for creating a .ely file, which can be used for writing masks with electron beam lithography. The extension should mainly do two things:

    • write an .ely which is a quite simple xml file, accordingly to the current drawing in inkscape. So this is basically just a parser.
    • effect the elements in the current drawing, like settings fill and stroke properties, changing curved path segments to polygons, ...

    I already wrote a python script which takes an svg file as input and create a ely file using the lxml library, but since I also want to pass some options I think an Inkscape extension for that is the more sophisticated way.

    I think that for my purposes the inkex library can do quite a lot. However I can't figure out how to use it. I need to get some elements and their attributes of the svg.

    1. How can I get all the layernames? I want to iterate over all layers and find for example all rectangles and circles in each layer and getting their attributes
    2. How can I get some attributes ov the document, like width and height as well as the first grid with its spacings
    3. How can I set the fill color of all elements in one layer?

    I hope you can help me out. Can you maybe give me a python code snippet?

    Best Lukas

  2. #2
    lukason lukason @lukason

    Hi. I just finished this extension in a first version and uploaded it on GitHub. Are there some other ways to announce this extension and make it more public?

    https://github.com/5amstag/edraw

  3. #3
    Tyler Durden Tyler Durden @TylerDurden

    Some info here: https://inkscape.org/forums/extensions/moving-extensions-into-inkscape/

    The extension can be added to the Gallery: https://inkscape.org/gallery/=extension/

    The extension is a bit specialized, so I'd announce its availability in the likely user-communities (nanolithography).

Inkscape Inkscape.org Inkscape Forum Creating New Extensions write extension for creating nanolithography .ely file with python