Update Libraries

Overview

With the update libraries extension, you can update the libraries of the project automatically. This is the same function as provided by the Libraries > Automatic version mapping (all libraries) command in the graphical user interface of EcoStruxure Machine Expert.

Script Engine Example

# Enable the new python 3 print syntax
from __future__ import print_function
 
# The path to the project
project_path = r"D:\PythonProjects\Example.project"
 
# Clean up any open project:
if projects.primary:
    projects.primary.close()
 
# Load the project
proj = projects.open(project_path);
 
# Search for the library manager objects in the project
lib_managers = [i for i in proj.get_children(True) if i.is_libman]
 
# Make the auto mapping for each library manager found
for lib_manager in lib_managers:
    lib_manager.make_auto_mapping()