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.