【发布时间】:2019-03-29 08:23:42
【问题描述】:
我正在尝试实施讨论过的 Revit 到 Excel 导出器 here。该按钮正在工作并将 urn 和令牌传递给
ForgeXLS.downloadXLSX(urn, token, callback /*Optional*/);
我正在扩展找到 here 的 Extensions Skeleton 教程。
范围是否可能存在问题...如果是,您能指导我如何调整我正在提取的访问令牌的范围吗?
ForgeXLSX.downloadXLSX 的代码是:
downloadXLSX: function (urn, token, status) {
var fileName = decodeURIComponent(atob(urn).replace(/^.*[\\\/]/, '')) + '.xlsx';
if (fileName.indexOf('.rvt') == -1) {
if (status) status(true, 'Not a Revit file, aborting.');
return;
}
if (status) {
status(false, 'Preparing ' + fileName);
status(false, 'Reading project information....');
}
this.prepareTables(urn, token, function (tables) {
if (status) status(false, 'Building XLSX file...');
var wb = new Workbook();
jQuery.each(tables, function (name, table) {
if (name.indexOf('<')==-1) { // skip tables starting with <
var ws = ForgeXLS.sheetFromTable(table);
wb.SheetNames.push(name);
wb.Sheets[name] = ws;
}
});
var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: true, type: 'binary'});
saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), fileName);
if (status) status(true, 'Downloading...');
})
},
【问题讨论】:
标签: autodesk-forge