Here is the code where Iām running into issue:
# Send inputs to the excel sheet
def get_evaluated_spreadsheet(self, params):
inputs = [
SpreadsheetCalculation('project_name', params.project.pname),
SpreadsheetCalculation('project_number', params.project.number),
SpreadsheetCalculation('client', params.project.client),
SpreadsheetCalculation('design_stage', params.project.design_stage),
SpreadsheetCalculation('beam_length', params.geometryDefn.beamLength),
SpreadsheetCalculation('bridge_deck_width', params.geometryDefn.deckWidth),
SpreadsheetCalculation('max_construction_depth', params.geometryDefn.maxConstructionDepth),
SpreadsheetCalculation('cantilever_allowed', params.geometryDefn.cantileverAllowed),
SpreadsheetCalculation('max_cantilever_length', params.geometryDefn.maxCantileverLength),
SpreadsheetCalculation('insitu_deck_slab_concrete_strength', params.deckParams.insituDeckSlab_concStrength),
SpreadsheetCalculation('insitu_deck_slab_thickness', params.deckParams.insituDeckSlab_thickness),
SpreadsheetCalculation('insitu_solid_slab_concrete_strength', params.deckParams.insituSolidSlab_concStrength),
SpreadsheetCalculation('insitu_solid_slab_thickness', params.deckParams.insituSolidSlab_thickness)
]
sheet_path = Path(__file__).parent / 'WSP_Net Zero_Prilim Beam Selection tool_v1.2.xlsx'
sheet = SpreadsheetCalculation.from_path(sheet_path, inputs=inputs)
result = sheet.evaluate(include_filled_file=True)
return result
And this is the error:
2024-07-01 15:56:20.923 ERROR : Exception is raised
Traceback (most recent call last):
File "viktor_connector\\connector.pyx", line 302, in connector.Job.execute
File "viktor\core.pyx", line 1960, in viktor.core._handle_job
File "viktor\core.pyx", line 1945, in viktor.core._handle_job._handle_view
File "viktor\views.pyx", line 2053, in viktor.views.View._wrapper
File "C:\Users\UKSPC003\viktor-apps\beamSlabOptimizerApp\app.py", line 76, in get_data_view
result = self.get_evaluated_spreadsheet(params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\UKSPC003\viktor-apps\beamSlabOptimizerApp\app.py", line 65, in get_evaluated_spreadsheet
result = sheet.evaluate(include_filled_file=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "viktor\external\spreadsheet.pyx", line 379, in viktor.external.spreadsheet.SpreadsheetCalculation.evaluate File "viktor\external\spreadsheet.pyx", line 414, in viktor.external.spreadsheet.SpreadsheetCalculation._create_request_body
AttributeError: 'SpreadsheetCalculation' object has no attribute 'name'