[jo...] Posted May 22 Share Posted May 22 good morning, i am trying now with gom scripting and i am very new with this. my goal is to make a script that generates a coordinate system for each circle I select in the tree. The only thing I get with the recorder is to do the actions I need, but only for a circle called ‘1’. I would like to make a multiselection ( manually), with it make a list and go taking all the circles of that list and make the actions that I share with you. I have the logic of the script in my head but I am not able to do it. Could someone help me? sistemas.py Link to comment Share on other sites More sharing options...
[Na...] Posted May 28 Share Posted May 28 Hello Jon, we have an article for selections here: https://zeissiqs.github.io/zeiss-inspect-addon-api/2023/howtos/python_api_introduction/selecting_elements.html It's from the Add-On development documentation you can find under "links" at the top of the page. The code could look something like this and will create a list you can iterate through (a free python course is available in the training center, which is also linked at the top). import gom points = [] for e in gom.ElementSelection ({'category': ['key', 'elements']}): if e.get('is_selected')==True: points.append (e) print (points) For this application, a creation sequence on similar elements, you could also use a user defined inspection principle. https://techguide.zeiss.com/en/zeiss-inspect-2023/article/cmd_inspection_create_user_defined_inspection_principle.html circles user defined inspection principle.mp4 (measuring principles might differ and I used a "normal" position check, not GD&T but that works too) Nanno Link to comment Share on other sites More sharing options...
[jo...] Posted May 28 Author Share Posted May 28 Thank you very much Nanno, you have been very helpful regards, 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