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-
# 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.
Hide Unhide Specif Layer from Python Extension
-
- Posts: 1
- Joined: Sat Aug 03, 2013 2:57 pm
Re: Hide Unhide Specif Layer from Python Extension
Hello,
I'm also interested in learn more about the extensions. And it's hard for me to explain what you have to do to reach the goal that you want:
Have you read this?:
http://wiki.inkscape.org/wiki/index.php/Script_extensions
http://wiki.inkscape.org/wiki/index.php/Generating_objects_from_extensions
http://wiki.inkscape.org/wiki/index.php/PythonEffectTutorial
Also, pay attention to this
Hence, in your code you have to have a string variable with the value"display:none", and add that string to the style atribute of the layer
The implementation depends of you
I'm also interested in learn more about the extensions. And it's hard for me to explain what you have to do to reach the goal that you want:
Have you read this?:
http://wiki.inkscape.org/wiki/index.php/Script_extensions
http://wiki.inkscape.org/wiki/index.php/Generating_objects_from_extensions
http://wiki.inkscape.org/wiki/index.php/PythonEffectTutorial
Also, pay attention to this
Code: Select all
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
style="display:none" />
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2"
style="display:inline"
/>
Hence, in your code you have to have a string variable with the value"display:none", and add that string to the style atribute of the layer
The implementation depends of you
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.