Inkscape.org
Creating New Extensions Use an existing function
  1. #1
    FrankI4466 FrankI4466 @FrankI4466
    *

    Hi,
    To make a new extension I would like to ungroup all the groups of my drawing. I thought I was going to use the _deep_ungroup function from ungroup_deep.py that comes with inkscape.
    So I declared this:
    import ungroup_deep

    Then tried to use the function like this:
             for node in self.svg.xpath('//svg:g'):
                 UngroupDeep._deep_ungroup(node)

    but I still have errors.
    Someone can help me.

     

    And is there something to add in inx file ?
    Thanks

  2. #2
    FrankI4466 FrankI4466 @FrankI4466
    hassanizhar

    ungroup_deep._deep_ungroup(node)

    This one doesn't work the error is : AttributeError: module 'ungroup_deep' has no attribute '_deep_ungroup' seem to be normal because class name is UngroupDeep.

    The other doesn't work too.