我正在尝试使用 AutoDesk 的 API 修改 DWG 文件。
我用 Visual Basic 创建了一个简单的命令,这个命令在 AutoCAD 中运行良好。命令名称是“Rota”。
然后我创建了一个 XML 文件:
<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage
SchemaVersion="1.0"
Version="1.0"
AutodeskProduct="AutoCAD"
AppVersion="0.1.0"
Name="PluginPrueba"
Description="Paquete de Prueba"
Author="Yomisma" >
<Components>
<RuntimeRequirements
OS="Win64"
Platform="AutoCAD"
SeriesMin="R23.0"
SeriesMax="R23.0"/>
<ComponentEntry
AppName="Comandos"
ModuleName="./Contents/PluginPrueba.dll"
AppType=".Net"
AppDescription="Rotate 45 degrees"
LoadOnCommandInvocation="True"
LoadOnAutoCADStartup="True">
<Commands GroupName="ComandosVB">
<Command Global="Rota" Local="Rota" />
</Commands>
</ComponentEntry>
</Components>
</ApplicationPackage>
我将 XML 放入文件夹 PluginPrueba.bundle,并创建了文件夹 Contests(在此文件夹中我放入了 de DLL 文件)。然后我制作了 ZIP 文件。
然后进入我的代码,我按照以下步骤操作:
1.- oAuth。
2.- 创建一个桶。我放入 Bucket de DWG 文件进行修改。
3.- 发布捆绑包
4.- 创建BundleAlias
5.- UploadToForge 压缩文件。
6.- 创建活动
{
"id": "ActivityPrueba",
"commandLine": "$(engine.path)\\accoreconsole.exe /i $(args[inputFile].path) /al $(appbundles[{{ AppBundleName }}].path) /s $(settings[script].path)",
"parameters": {
"inputFile": {
"zip": false,
"ondemand": false,
"verb": "get",
"description": "Rota DWG",
"localName": "$(inputFile)"
},
"outputFile": {
"zip": false,
"ondemand": false,
"verb": "put",
"description": "output file",
"localName": "outputFile.dwg",
"required": "true"
}
},
"engine": "Autodesk.AutoCAD+23",
"appbundles": [
"{{ client_id }}.{{ AppBundleName }}+prod"
],
"settings": {
"script": "Rota\n"
},
"description": "AutoCAD Prueba Comando."
}
7.- 创建活动别名
8.- 创建工作项
当我执行时,这是报告:
[07/17/2019 08:10:23] Starting work item { id }
[07/17/2019 08:10:23] Start download phase.
[07/17/2019 08:10:23] Start preparing AppPackage appBundlePrueba.
[07/17/2019 08:10:23] Start downloading file https://developer.api.autodesk.com/oss/v2/buckets/newtoken/objects/square.dwg.
[07/17/2019 08:10:23] Download bits and install app to local cache.
[07/17/2019 08:10:23] Error: Failed to prepare app package(s).
[07/17/2019 08:10:23] End downloading file https://developer.api.autodesk.com/oss/v2/buckets/newtoken/objects/square.dwg. 32049 bytes have been written to T:\Aces\Jobs\b64f9613734b497db06459cdcd6e6fb1\square.dwg.
[07/17/2019 08:10:23] End download phase.
[07/17/2019 08:10:23] Error: An unexpected error happened during phase Downloading of job.
[07/17/2019 08:10:23] Job finished with result FailedEnvironmentSetup
[07/17/2019 08:10:23] Job Status:
{
"status": "failedDownload",
..........................
}
怎么了?