Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Get/Set project information

2012-04-23
2012-04-23
  • Frank Jepsen - 2012-04-23

    Hi,

    I am trying to get/set project information using scripts.

    I can find the "Project information" object using:

    from __future__ import print_function
    \# define the printing function
    def tree(treeobj, depth=0):
        name = treeobj.get_name(False)
        if name == "Project information":
            print(name)
            print(treeobj.get_children().Count)
            
    \# start looking in primary project
    for obj in projects.primary.get_children():
       tree(obj)
    

    I cannot find information on the object in ScriptEngine.chm. Can anyone help me here? Or is the object with project information simply not supported yet?

    // Frank

     
  • Anonymous - 2012-04-23

    Originally created by: M.Schaber

    Hi, Frank,

    Frank Jepsen hat geschrieben:
    I am trying to get/set project information using scripts.
    I can find the "Project information" object using:

    (snipped)
    

    I cannot find information on the object in ScriptEngine.chm. Can anyone help me here? Or is the object with project information simply not supported yet?

    Currently, this object is not supported yet.

    I propose that you file this as a feature request via our support department.

     
  • Frank Jepsen - 2012-04-23

    Hi M.Schaber,

    Ok. Then I will have to make a workaround for now.

    I will try to create a feature request for it.

    Regards,
    Frank

     
  • Anonymous - 2012-04-23

    Originally created by: M.Schaber

    Hi, Frank,

    Frank Jepsen hat geschrieben:
    Ok. Then I will have to make a workaround for now.

    Maybe you can utilize the native or PLCOpenXML export/import for that workaround.

    HTH,
    Markus

     
  • Frank Jepsen - 2012-04-23

    M.Schaber hat geschrieben:
    ...
    Maybe you can utilize the native or PLCOpenXML export/import for that workaround.
    ...

    I have now tried that and cannot get it to work unfortunately.

    I tried creating a project with some content and project information, exported it and imported it again. The project information goes into the XML I can see, but I cannot load the project information again; only the other content is loaded. Is this a known issue?

    The workaround I hoped for was exporting to PLCOpenXML, edit XML using scripts, and import it again.

    Now it seems that I have to resort to my previous "workaround", where I have used an auto-mouse/keyboard-clicker to automatically click around in the GUI. (even though this it not a very stable solution)

     
  • Anonymous - 2012-04-23

    Originally created by: M.Schaber

    Hi, Frank,

    Frank Jepsen hat geschrieben:
    I tried creating a project with some content and project information, exported it and imported it again. The project information goes into the XML I can see, but I cannot load the project information again; only the other content is loaded. Is this a known issue?

    I'm not that deep into the export/import function details so I'm afraid I cannot answer that question. If the same problem appears when importing manually via the menu, maybe the general forum can help you. Or you can always fall back to our support department.

     

Log in to post a comment.