Jump to content

Python script to export CSV


---
 Share

Recommended Posts

Currently we scrap out PDFs to create csv files for our records.

I'm experimenting with GOM's native CSV exporter. The problem I have is it seems the Measurement Check 'names' and the table template 'name' are hard coded  into the python code when I record the IDE screen in GOM....


gom.script.table.export_table_contents (
	cell_separator=',', 
	codec='utf-8', 
	decimal_separator='.', 
	elements=[gom.app.project.inspection['DISTANCE_1'], gom.app.project.inspection['RADIUS_2'], gom.app.project.inspection['POSITION_3']], 
	file='C:/Custom_Template.csv', 
	header_export=True, 
	line_feed='\r', 
	sort_column=0, 
	sort_order='ascending', 
	template_name='Custom_Template', 
	text_quoting='', 
	write_one_line_per_element=False)

Is there a way to allow the 'elements=' to include all the items in the current active table? I cannot make this python script parametric for all programs if I can't do this.

Is there a way to let the 'template_name=' be whatever template is active in the program?  We have a lot of old templates that are running around and I'd like this field to accept any active template that is in the program?

 

Thanks

Link to comment
Share on other sites

Hello Tim,

you can check for the visibility status of inspection elements. These could be added to a list, which is then passed to the export als elements = list.

image.thumb.png.c835d77ecba0205e1d39c099a3d50a2b.png

Nanno

 

Link to comment
Share on other sites

Please sign in to view this username.

 

Thanks, where do I access that window that you have up? I don't think I've ever seen that.

Link to comment
Share on other sites

Ahhh, I see it is in the scripting window area....i was looking in the reporting windows for this.  

 

I will give this a try thanks...

Link to comment
Share on other sites

 Share

×
×
  • Create New...