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

Exporting library

etamgul
2016-01-12
2016-01-14
  • etamgul - 2016-01-12

    I'm having trouble to export my library using the script, only found sample to Import an XML.

    Can someone explain/give sample how could I use this interface?

    string export_xml(
       IEnumerable<IExtendedObject<IScriptObject>> objects,
       string path = null,
       bool recursive = false,
       bool export_folder_structure = false,
       bool declarations_as_plaintext = false
    )
    

    How can I gather an Enumerable of ExtendedObjects from a project that opened a library?

    Thanks

     
  • Anonymous - 2016-01-12

    Originally created by: M.Schaber

    Hi, etamgul,

    etamgul hat geschrieben:
    I'm having trouble to export my library using the script, only found sample to Import an XML.
    Can someone explain/give sample how could I use this interface?

    string export_xml(
       IEnumerable<IExtendedObject<IScriptObject>> objects,
       string path = null,
       bool recursive = false,
       bool export_folder_structure = false,
       bool declarations_as_plaintext = false
    )
    

    How can I gather an Enumerable of ExtendedObjects from a project that opened a library?

    Your question is not completely clear to me:

    Do you want to export objects from a library which is opened as primary project, or do you want to export an already installed library from the library repository which happens to be referenced from the currently open project?

     
  • etamgul - 2016-01-14

    Sorry. To clearify: I'd like to export a lirbary - opened as primary project - to PLCOpenXML format.

     
  • Anonymous - 2016-01-14

    Originally created by: M.Schaber

    etamgul hat geschrieben:
    Sorry. To clearify: I'd like to export a lirbary - opened as primary project - to PLCOpenXML format.

    The "IEnumerable<iextendedobject<iscriptobject>>" should be taken as a hint that one should pass a sequence of script objects there.</iextendedobject<iscriptobject>

    The easiest way should be to use proj.get_children(false) and set the "recursive" parameter of export_xml(...) to true.

    HTH,
    Markus

     

Log in to post a comment.