I am new to Python programming and have a small issue, maybe:
How can I create a new folder in the device-tree or the POU-tree?
For example:
I want to create a new folder at: "Application/POUs" that should be named with "test".
So that I have a new folder at: "Application/POUs/test" where I can import any POUs.
Is that possible?
If yes might an example very helpfull.
Regards
Michael
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A script object can create a folder under itself by calling the method create_folder(<folder name="">). See example.</folder>
proj=projects.primaryobjs=proj.find('Folder', recursive=True)folder=objs[0]
folder.create_folder('SubFolder')objs=folder.find('SubFolder')ifnotobjs[0].is_folder:
Β Β raiseException('Object is not a folder')
BR
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there,
I am new to Python programming and have a small issue, maybe:
How can I create a new folder in the device-tree or the POU-tree?
For example:
I want to create a new folder at: "Application/POUs" that should be named with "test".
So that I have a new folder at: "Application/POUs/test" where I can import any POUs.
Is that possible?
If yes might an example very helpfull.
Regards
Michael
Hi mvs.
A script object can create a folder under itself by calling the method create_folder(<folder name="">). See example.</folder>
BR
Martin
Hi Martin,
I tested it and it works great.
Many thanks
Michael