<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Python scripting - print whole project tree</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/500150bdbb/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/500150bdbb/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/500150bdbb/</id><updated>2024-08-12T20:53:32.721000Z</updated><subtitle>Recent posts to Python scripting - print whole project tree</subtitle><entry><title>Python scripting - print whole project tree</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/500150bdbb/?limit=25#73d4" rel="alternate"/><published>2024-08-12T20:53:32.721000Z</published><updated>2024-08-12T20:53:32.721000Z</updated><author><name>micik</name><uri>https://forge.codesys.com/u/micik/</uri></author><id>https://forge.codesys.com7adb1157019034eb29752a3e58cc429f33ef0d50</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;br/&gt;
I have found a script for printing device tree in Codesys project. This script is available as code snippet as an exmaple for using Python in Codesys. However I feel main documentation is lacking. For example, where can I find that object has "is_device" attribute?&lt;br/&gt;
Code examples are given here:&lt;br/&gt;
&lt;a href="https://content.helpme-codesys.com/en/CODESYS%20Scripting/_cds_access_cds_func_in_python_scripts.html" rel="nofollow"&gt;https://content.helpme-codesys.com/en/CODESYS%20Scripting/_cds_access_cds_func_in_python_scripts.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;However, I have a question how to print the whole Project tree and not just devices? Of course I need to remove check:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;if treeobj.is_device:
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;But simply removing this test condition will not produce what I want. I need to print PLC Logic, Application, ad other nodes in the Project tree.&lt;br/&gt;
Where to find this documentation?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>