[Ir...] Posted October 22 Share Posted October 22 (edited) Hello, I'm developing a script that takes an existing cluster as input. However, I'm struggling to find a reliable way to retrieve the list of elements that belong to that cluster within the script. The only alternative I can think of is searching by name, since the cluster elements are automatically renamed with the cluster name as a prefix. Still, this approach doesn't seem robust enough. Do you know of any keyword or method that could help in this situation? I've tried keywords like dependency_children and dependency_elements, but without success. Thanks in advance Edited October 22 Link to comment Share on other sites More sharing options...
[Ma...] Posted October 22 Share Posted October 22 Cluster? What i can imagine what it is, what it contains and how it's defined? Maybe we can find something 🙂 Link to comment Share on other sites More sharing options...
[Ir...] Posted October 22 Author Share Posted October 22 When you create a cluster, you add a list of elements, see the image attached as an example: The script I'm working on assumes that the cluster has already been created, and the only input it receives is the system associated with the cluster (the reference system that is generated when the cluster is created). Based on that information, is there any way to retrieve all the elements from the cluster's creation list? Link to comment Share on other sites More sharing options...
[Ma...] Posted October 29 Share Posted October 29 Hello, see Tech Guide: How to Evaluate Clusters for an introduction. Selecting elements in scripts — App Development Documentation also works for clusters: import gom # Print clusters elements=gom.ElementSelection ( {'category': ['key', 'elements', 'explorer_category', 'clusters']} ) print("=== Clusters ===") for element in elements: print(element) Example: === Clusters === gom.app.project.inspection['Cluster 1'] gom.app.project.inspection['Coordinate system 1 (1) (2)'] gom.app.project.inspection['Coordinate system 1 (2) (1)'] gom.app.project.inspection['Coordinate system 1 (2) (2)'] gom.app.project.inspection['Coordinate system 1 (3) (1)'] gom.app.project.inspection['Coordinate system 1 (3) (2)'] To see elements related to a specific cluster: # Print elements related to Cluster 1 elements = gom.ElementSelection ( {'category': ['key', 'related']}, filter = {'param': 'Cluster 1', 'type': 'by_name' } ) print("=== Cluster 1 - related ===") for element in elements: print(element) Example: === Cluster 1 - related === gom.app.project.actual_elements['Cluster 1.Point 1'] gom.app.project.inspection['Cluster 1.Point 1'] gom.app.project.inspection['Cluster 1.Point 1.dIP'] gom.app.project.inspection['Cluster 1.Point 1.X'] gom.app.project.inspection['Cluster 1.Point 1.Y'] Best regards, Matthias Link to comment Share on other sites More sharing options...
[Ir...] Posted Thursday at 11:45 AM Author Share Posted Thursday at 11:45 AM Thank you very much for your response. I’m reviewing the link you shared about cluster evaluation, and another question came up. The "Clusters" field doesn’t appear in my explorer. Could this be due to the version of ZEISS Inspect I’m using? Link to comment Share on other sites More sharing options...
[Ma...] Posted Thursday at 03:30 PM Share Posted Thursday at 03:30 PM Yes, this might be the case. The cluster concept has been introduced in ZEISS INSPECT 2025. The "Element Groups" show in your Explorer screenshot works differently. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in