I'm using the script language to access all types used in a program.
I started with the DevicePrintTree.py as an example and are able to find all types defined in the project.
Some types however are defined in libraries.
I have two problems:
- how can I find the path to the library file in the library manager?
- how can I open the library, while maintaining at the same time the projects.primary project open?
Best regards,
Geert Vanstraelen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Geert Vanstraelen hat geschrieben:
I have two problems:
- how can I find the path to the library file in the library manager?
- how can I open the library, while maintaining at the same time the projects.primary project open?
The libraries, which are required, are automatically loaded. Even the compiled libraries but they only contain "proxy objects".
forprojinprojects.all:
  ifproj.primary:
    print("Primary: %s"%proj.path)
  elifproj.library:
    print("Library: %s"%proj.path)
BR
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2016-12-01
Originally created by: Geert Vanstraelen
Dear Martin,
Thank you for your solution, the access to projects.all and he path were the missing clues.
The loaded user libraries also seem to contain limited information.
By opening and closing them one by one I finished to have the information that I needed.
Best regards,
Geert
projectPath=""libraryPaths= []
print("--- List of all projects: ----------")forprojinprojects.all:
  ifproj.primary:
   print("Primary: %s"%proj.path)
   projectPath=proj.path
  elifproj.library:
   print("Library: %s"%proj.path)
   if(proj.path.find("compiled")<0):
     print("********** User library: %s"%proj.path)
     libraryPaths.append(proj.path)
   else:
     print("********** System library: %s"%proj.path)print("------------------------------------")forlibPathinlibraryPaths:
  projects.primary.close()
  lib=projects.open(libPath)
  parsetree(projects.primary, 1, 1)projects.primary.close()
\# Reopenourprimaryprojectprojects.open(projectPath)parsetree(projects.primary, 1, 1)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Originally created by: Geert Vanstraelen
Hello,
I'm using the script language to access all types used in a program.
I started with the DevicePrintTree.py as an example and are able to find all types defined in the project.
Some types however are defined in libraries.
I have two problems:
- how can I find the path to the library file in the library manager?
- how can I open the library, while maintaining at the same time the projects.primary project open?
Best regards,
Geert Vanstraelen
Hi.
The libraries, which are required, are automatically loaded. Even the compiled libraries but they only contain "proxy objects".
BR
Martin
Originally created by: Geert Vanstraelen
Dear Martin,
Thank you for your solution, the access to projects.all and he path were the missing clues.
The loaded user libraries also seem to contain limited information.
By opening and closing them one by one I finished to have the information that I needed.
Best regards,
Geert