[Ti...] Posted June 29 Share Posted June 29 I'd like to make a script to check all of our programs and return which Datums are set to GDT or geometry. Something like this: for i in gom.ElementSelection ({'category': ['key', 'elements', 'part', gom.app.project.parts['Part'], 'explorer_category', 'coordinate_systems', 'object_family', 'actual_datum_system']}): x = i.get('name') comp_mode = gom.app.project.actual_elements[x].computation_mode The problem is computation_mode doesn't seem to be an object, but you can use this script to change the computation_mode: gom.script.sys.edit_creation_parameters ( computation_mode='fitting', element=gom.app.project.actual_elements['A']) gom.script.sys.edit_creation_parameters ( computation_mode='pure-geometry', element=gom.app.project.actual_elements['A']) I don't see anywhere to retrieve the computation mode in this documentation: print(gom.app.project.actual_elements['A'].__doc__) Is there a way to get the computation mode from my program? Thanks. Link to comment Share on other sites More sharing options...
[Ch...] Posted Wednesday at 07:21 AM Share Posted Wednesday at 07:21 AM The keyword in question is "tolerance_applied_standard" (mainly to have the same name as for GPS tolerances). Possible entries are (currently) "ISO 1101", "ASME Y14.5", and "Geometry". Generally, you can press F2 in the script editor to open a dialog where you can select an element and look at its keywords. The most interesting ones usually hide in the "Information" and "Geometry" folders Link to comment Share on other sites More sharing options...
[Ti...] Posted Wednesday at 01:45 PM Author Share Posted Wednesday at 01:45 PM (edited) Please sign in to view this username. Thanks. That doesn't exist in 2021, but we are moving to 2025 soon, so I see that 'tolerances_applied_standard' is available in the F2 in 2025. Here is the funny thing...When I open any program from 2021 in 2025 and run the script above, it reports that half the Datums are ISO 1101, when in fact if you edit them they are Geometry. Then if I toggle them to ISO then back to Geometry and click okay, the script sees them as Geometry. This was extremely scary b/c if the script reports ISO when it is Geometry, then what is it doing inside the Position or Profile callouts? Well, I tested it and it is working correctly. So in summary, an imported program from 2021 that has all Datums set to Geometry, then below variable will see half of them as ISO for some reason, but the GDT callouts like Position and Profile, will use the Datums correctly as Geometry. We use geometry so that whatever you set the feature to measure as I want that to carry over to the datum. We have small datums and guassian on datums is preferred for us. I have a co-worker that leaves it at the default of 'GDT' in 2021 and I want to analyze around 50 of his programs, not to mention a bunch of programs before I was hired. Due to this bug I don't think the below script is going to work for us right now. comp_mode = gom.app.project.actual_elements[x].tolerance_applied_standard Edited Wednesday at 01:45 PM Link to comment Share on other sites More sharing options...
[Mi...] Posted Friday at 01:05 PM Share Posted Friday at 01:05 PM Please sign in to view this username. I tried to save a datum system with "Geometry" standard in SW2023 and unfortunately can confirm that the token gives "ISO" when the project is loaded in SW2025. As you said, the datum system is still computed according to the standard in which the project was saved. Nevertheless, we will fix the erroneous loading of SW2023 projects such that the token returns the expected value. I am sorry that this happened and that you can't use the script as you intended. As far as I can tell, there is no other way to obtain the standard via script. Link to comment Share on other sites More sharing options...
[Ti...] Posted Friday at 09:05 PM Author Share Posted Friday at 09:05 PM (edited) Please sign in to view this username. do you work for Zeiss? If this is fixed is it rolled our in a Service Pack correct? I had two primary reasons for the script: 1) To analyze a co-workers programs who I have been teaching for the consistency of using 'geometry' vs ASME. 2) We have paid for 4 seats of 2025 and we are trying to move to Zeiss Inspect 2025, and if the conversion does not retain the math type that is a huge problem for us so I was trying to find a way to analyze about 300 programs and export the results. I have not tried to analyze the math type export for individual features yet....perhaps you can check if the same issue is happening there as well with the token. I will test it next week. Thanks Edited Friday at 09:05 PM Link to comment Share on other sites More sharing options...
[Ti...] Posted Sunday at 11:15 AM Author Share Posted Sunday at 11:15 AM Please sign in to view this username. I was hoping geometry would be listed as ISO 1101 and perhaps GDT would get listed at ASME, but I just ran all our programs through my script and everything is listed as ISO 1101. Appreciate the efforts to fix this. It will be nice to cycle through all the programs and feel confident all the datums are using the same math type. Link to comment Share on other sites More sharing options...
[Mi...] Posted 17 hours ago Share Posted 17 hours ago (edited) Please sign in to view this username. Yes, I am a software developer here at Zeiss. Unfortunately I cannot fix this bug for a service pack release of SW2025. An option to fix your SW2023 would be to open them in SW2025 and run the following script function: def editCreationParametersOfDatumSystems(): for datum_system in gom.ElementSelection ({'category': ['key', 'elements', 'explorer_category', 'coordinate_systems']}): gom.script.sys.edit_creation_parameters(element=datum_system, auto_apply=True) When the project is saved in SW2025, the project can be loaded in SW2025 again without losing the token value. I hope this somewhat works for you. An upcoming regular release of Zeiss Inspect will do this automatically when an old project is loaded, but not SW2025. I am not sure what you mean with "math type export for features", so I haven't checked that. Please reply back if this should not work. Edited 17 hours ago 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