[Ma...] Posted May 23, 2022 Share Posted May 23, 2022 Hello GOM team, I have to copy a stage, put it in cliipboard and then rename it with the original stage name. In the image example I have to rename the element in clipboard as "12016229_220324_Figura_1". I have written the code to copy all stages, but I have to implemate it with the renaming part. # -*- coding: utf-8 -*- import gom gom.script.manage_alignment.set_alignment_active (cad_alignment=gom.app.project.alignments[1]) gom.script.sys.recalculate_project (with_reports=False) for g in gom.app.project.stages: print(g.name) gom.script.sys.copy_to_clipboard (elements=gom.ElementSelection ({'category': ['key', 'elements', 'part', gom.app.project.parts[0], 'explorer_category', 'actual_part']})) gom.script.sys.paste_from_clipboard (destination=gom.ElementSelection ({'category': ['key', 'elements', 'part', gom.app.project.parts[0], 'explorer_category', 'actual_part']})) Thank you very much. Link to comment Share on other sites More sharing options...
[Ma...] Posted May 23, 2022 Author Share Posted May 23, 2022 I found the solution: gom.script.sys.edit_properties ( data=[gom.app.project.parts['Part'].actual], elem_name=gom.app.project.stage[0]) and then copy and past in clipboard. 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