[Ju...] Posted December 12, 2025 Share Posted December 12, 2025 (edited) I have 20 report pages that i need to change the active alignment from the align1 to align2using a script. Recording gave me the two lines below. Line 1 is activating the new updated alignment, Line 2 is editing the report page. gom.script.manage_alignment.set_alignment_active (cad_alignment=gom.app.project.alignments['Align2']) gom.script.sys.edit_creation_parameters (element=gom.app.project.reports['report 17']) I manually changed back to align 1 then trying to rerun this does nothing except staying open the edit creation parameters for the one page without changing the alignment. A second question is why in the recorded script does it identify my report page as 'report 17' when its actual page name is HOLES, i cannot find anywhere an identifier of report 17 Thanks for any assistance Edited December 12, 2025 Link to comment Share on other sites More sharing options...
[Ma...] Posted December 12, 2025 Share Posted December 12, 2025 Hi Justin! If I understood this simple script do exactly what you have to do. This is one way to do it. # -*- coding: utf-8 -*- import gom page_in_report=[] for page in gom.app.project.reports: print (page) page_in_report.append(page) gom.script.manage_alignment.set_alignment_active (cad_alignment=gom.app.project.alignments[2]) gom.script.report.update_report_page ( pages=page_in_report, used_alignments='current', used_digits='report', used_legends='report', used_stages='report', used_units='report') 1 Link to comment Share on other sites More sharing options...
[Ma...] Posted December 12, 2025 Share Posted December 12, 2025 To see which alignment corresponds to each index, simply type: print(gom.app.project.alignments[3]) (just change the index number). • Index 0 → always the original scan position • Index 1 → usually the pre-alignment • Index 2, 3, … → user-created alignments in the order they were created. 1 Link to comment Share on other sites More sharing options...
[Ju...] Posted December 12, 2025 Author Share Posted December 12, 2025 Thanks that's what i needed. How did you find the "gom.script" functions? the print(__doc_) just returns none for it Link to comment Share on other sites More sharing options...
[Ma...] Posted December 15, 2025 Share Posted December 15, 2025 I use the gom scripting 2021 (not in vusual studio) and if you just press F2 in a blank line. Here you can see all keyword you can use. 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