Jump to content

Export ONLY the datas which are in the report by SCRIPTING


Recommended Posts


I have a template with many many datas, inspections, etc.. and i run a script that "filter" some kind of inspection and updates some reports pages with only thoses results.

But at the end, i still need to export only the datas wihch are on the report and not the others, by scripting

Then, when I record a script, I can choose to view only the datas in report like :

drag and drop the whole report in the middle area.

gom.script.cad.show_element_exclusively (elements=gom.ElementSelection ({'category': ['key', 'elements', 'is_element_in_clipboard', 'False', 'explorer_category', 'reports']}))

but when i want to export then, it generate 

gom.script.table.export_table_contents (
	codec='iso 8859-1', 
	elements=gom.ElementSelection ([gom.app.project.inspection[.............],gom.app.project.inspection[.............]])

with each element is mentionned one by one by is name.


but in the next project, the elements in the report are differrents.


Is it clear enough ?


Thanks for your help,

Best regards,


Link to comment
Share on other sites

You can replace the recorded "elements" parameter of "export_table_contents" by this:

# python style
elements = [element for element in gom.app.project.inspection if element.is_visible]

or this:

# GOM style
elements = gom.app.project.inspection.filter ('is_visible', True)


Link to comment
Share on other sites


  • Create New...