Results 1 to 4 of 4

Thread: Hide Unhide Specif Layer from Python Extension In Inkscape

  1. #1
    Join Date
    May 2009
    Location
    Close to your Heart
    Beans
    137
    Distro
    Ubuntu 12.04 Precise Pangolin

    Question Hide Unhide Specif Layer from Python Extension In Inkscape

    Hi

    I am new to scripting inkscape extension. I have so far covered the basics and created a working hello world example. I cant find a good resource/documentation where i can find full list of available functions that i can use from python in extensions. So i am posting here for your help. If you guys can point me to such resource it would be great as well.

    I am trying to build an extension to hide/unhide specific layers(layers have specific names) from my extension. I have no clue about how to proceed. Are there any function like-

    Code:
    # Get access to main SVG document element and get its dimensions.
    svg = self.document.getroot() 
    
    #get layer by name and hide it ??
    svg.getLayerByName("Name_of_layer").hide() <<< ????

    Thanks in advance. I really appreciate your time to read this out.

  2. #2
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,172
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Hide Unhide Specif Layer from Python Extension In Inkscape

    Set its "visibility" attribute to "hidden" or "collapse".

  3. #3
    Join Date
    May 2009
    Location
    Close to your Heart
    Beans
    137
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Hide Unhide Specif Layer from Python Extension In Inkscape

    How exactly am I going to do that? I cant find a way to select that specific layer. and thus far away from changing attribute?

  4. #4
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,172
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Hide Unhide Specif Layer from Python Extension In Inkscape

    Quote Originally Posted by shababhsiddique View Post
    How exactly am I going to do that? I cant find a way to select that specific layer. and thus far away from changing attribute?
    Well it's just a matter of editing the XML document to set the attribute. The Inkscape extension use the popular lxml library.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •