[jo...] Posted May 22, 2024 Share Posted May 22, 2024 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 https://qualityforum.zeiss.com/topic/3994-script-to-generate-coordinate-system/ Share on other sites More sharing options...
[Na...] Posted May 28, 2024 Share Posted May 28, 2024 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 https://qualityforum.zeiss.com/topic/3994-script-to-generate-coordinate-system/#findComment-11594 Share on other sites More sharing options...
[jo...] Posted May 28, 2024 Author Share Posted May 28, 2024 Thank you very much Nanno, you have been very helpful regards, Link to comment https://qualityforum.zeiss.com/topic/3994-script-to-generate-coordinate-system/#findComment-11598 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