Skip to main content
Solved

Update DWG with Excel table

  • December 15, 2017
  • 2 replies
  • 12 views

Hi there. I'm trying to update the .dwg Attribute autocad_text_string with attribute values from a corresponding excel file that was created from the same .dwg and manually corrected. The xlsx file is structured in a way that each sheet represents a layer corresponding to the .dwg and the column header is named autocad_text_string.

The feature merger only takes the first column value of an excel sheet and gives all other dwg attributes of that layer that same value. Do you have any suggestions how to update each features autocad_text_string with the corresponding row value from the excel file?

Best answer by takashi

Hi @dl, if it's sure that the order of features output from the DWG reader feature type is match the order of rows in corresponding Excel spreadsheet, you can add sequential number to each feature with a Counter, expose "xlsx_row_id" attribute in the Excel reader feature type, and then use the sequential number and "xlsx_row_id" as join key to merge desired text string to each feature.

Note that "xlsx_row_id" stores row number starting with 1. That is, the row number of the first data row would be 2 if the first row in the spreadsheet was field names row. You will have to set the first data row number to the "Count Start" parameter in the Counter.

View original
Did this help you find an answer to your question?

2 replies

danilo_fme
Evangelist
Forum|alt.badge.img+45
  • Evangelist
  • December 15, 2017

Hi @dl,

Could you share us your Workspace template (.FMWT ) ?

Thanks,

Danilo


takashi
Evangelist
  • Best Answer
  • December 17, 2017

Hi @dl, if it's sure that the order of features output from the DWG reader feature type is match the order of rows in corresponding Excel spreadsheet, you can add sequential number to each feature with a Counter, expose "xlsx_row_id" attribute in the Excel reader feature type, and then use the sequential number and "xlsx_row_id" as join key to merge desired text string to each feature.

Note that "xlsx_row_id" stores row number starting with 1. That is, the row number of the first data row would be 2 if the first row in the spreadsheet was field names row. You will have to set the first data row number to the "Count Start" parameter in the Counter.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings