<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Python scripting : edit axis parameters from script</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b5ab279f5a/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b5ab279f5a/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/b5ab279f5a/</id><updated>2021-06-22T06:54:43.032000Z</updated><subtitle>Recent posts to Python scripting : edit axis parameters from script</subtitle><entry><title>Python scripting : edit axis parameters from script</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b5ab279f5a/?limit=25#b7b5" rel="alternate"/><published>2021-06-22T06:54:43.032000Z</published><updated>2021-06-22T06:54:43.032000Z</updated><author><name>alejho</name><uri>https://forge.codesys.com/u/alejho/</uri></author><id>https://forge.codesys.com028274e778cf841f5ffb8bcc46fa77677c7c89a0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi all,&lt;br/&gt;
I'm working at a script to autoconfigure some aspects of a project.&lt;br/&gt;
The script will be interactive and submit some questions to the user.&lt;br/&gt;
Is it possible to edit the parameterization of an axis from a python script?&lt;br/&gt;
For example let's say I want to change the axis type and limit like I can do manually from its editor...how can I do?&lt;/p&gt;
&lt;p&gt;&lt;img src="./attachment/accessDevicePython.png" width="50%"/&gt;&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;__future__&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;print_function&lt;/span&gt;

&lt;span class="n"&gt;proj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;primary&lt;/span&gt;
&lt;span class="n"&gt;device&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;proj&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'myAxis'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;recursive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;param&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;device&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;device_parameters&lt;/span&gt;

&lt;span class="c1"&gt;#how to list and edit device parameters from here&lt;/span&gt;
&lt;span class="n"&gt;param&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="err"&gt;?&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Thank you for any kind of help!&lt;br/&gt;
Ciao!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>