Forum Discussion
FICO
5 years agoCommunity Manager
Issue with scenario attachments; attachment not found
Hello - looking for advice/help related to an issue with scenario attachments. we are using python to create several excel workbook files, which contain model input data. we have a set of strings (i...
FICO
5 years agoCommunity Manager
Thanks, this is helpful. So, I used findfiles before and after running the python script: findfiles(lsf,"*.xlsx")
After running python, I see the following output:
[110A Model Input.xlsx,120A Model Input.xlsx,2000 Model Input.xlsx,2011 Model Input.xlsx,211A Model Input.xlsx,2210 Model Input.xlsx,230A Model Input.xlsx,241A Model Input.xlsx,260A Model Input.xlsx,310A Model Input.xlsx,321A Model Input.xlsx,330A Model Input.xlsx]
Note - There is a total of 12 xlsx files, as expected. The set is shown below (with 12 elements)
SET: {`110A',`2210',`2011',`241A',`230A',`260A',`310A',`211A',`2000',`120A',`330A',`321A'}
Note - when I try to add attachments, I get the following output. Code is shown below too.
issue: 110A file is shown to have file size=0. Previously, we did not check for file size but tried to upload each attachment. That would lead to a run-time error, and the execution would fail. The error was: "Error downloading attachment for 110A".
Debug: adding model input attachment for market: 110A
Error adding attachment 110A Model Input.xlsx
Filesize = 0 for 110A Model Input.xlsx
Debug: adding model input attachment for market: 2210
Attachment 2210 Model Input.xlsx added to the scenario.
Debug: adding model input attachment for market: 2011
Attachment 2011 Model Input.xlsx added to the scenario.
Debug: adding model input attachment for market: 241A
Attachment 241A Model Input.xlsx added to the scenario.
Debug: adding model input attachment for market: 230A
Attachment 230A Model Input.xlsx added to the scenario.
Debug: adding model input attachment for market: 260A
Attachment 260A Model Input.xlsx added to the scenario.
Debug: adding model input attachment for market: 310A
Attachment 310A Model Input.xlsx added to the scenario.
Debug: adding model input attachment for market: 211A
Attachment 211A Model Input.xlsx added to the scenario.
Debug: adding model input attachment for market: 2000
Attachment 2000 Model Input.xlsx added to the scenario.
Debug: adding model input attachment for market: 120A
Attachment 120A Model Input.xlsx added to the scenario.
Debug: adding model input attachment for market: 330A
Attachment 330A Model Input.xlsx added to the scenario.
Debug: adding model input attachment for market: 321A
Attachment 321A Model Input.xlsx added to the scenario.
procedure set_attachment(filename: string, tags: list of string)
if getfsize(filename) > 0 then
insightputscenattach(filename)
if insightattachstatus=INSIGHT_ATTACH_OK then
insightsetscenattachtags(filename,tags)
writeln("Attachment "+filename+" added to the scenario.")
else
writeln("Error adding attachment "+filename)
exit(1)
end-if
else
writeln("Error adding attachment "+filename)
writeln(" Filesize = 0 for "+filename)
end-if
end-procedureRelated Content
Related Content
- 11Views0likes2Comments
