Jump to content

Read cell contents from table


---
 Share

Recommended Posts

Hello,
can anyone tell me how to read the contents of a cell in the table?

gom.script.table.edit_cell
gom.script.table.insert_row_before
gom.script.table.delete_row 
gom.script.table.insert_column_behind
gom.script.table.delete_column
gom.script.sys.save_table_style
gom.script.table.switch_template

 

table

Link to comment
Share on other sites

Uwe, you need to approach this the other way round.

The table is displaying variables , not storing them.  Unless you really have just written fixed text in the cell, which i cannot imagine nor can you access anyway.

If its really fixed text then best to drive this by project keyword which is then accessible by script.

Therefore you need to see what is driving this cell, say an element keyword , this value can then be accessed via the element in scripting.

I hope this makes some sense.

Link to comment
Share on other sites

Hello James, thank you for your answer.

I understood the keywords thing, but I still have no idea how to implement my test.

I'm looping through all the rows in column 5 from row 1 to 60 and now I want to check if the keyword has a specific value.

# -*- coding: utf-8 -*-

import gom

i = 0

while i <= 60:
    if  gom.script.table.edit_cell (cell_content='\n$format (user_E_01_1_1, ".0", show_unit=false, date_format=\'dd.MM.yyyy\')$', element_type='inspection_dimension_scalar', indices=[{'column': 5, 'row': i}])== 0 :
        ...
    i  += 1

The keywords also vary in each line.

Link to comment
Share on other sites

 Share

×
×
  • Create New...