[Ti...] Posted Sunday at 02:28 PM Share Posted Sunday at 02:28 PM 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 22 hours ago Share Posted 22 hours ago 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 15 hours ago Author Share Posted 15 hours ago (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 15 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