我用Visual Basic创建了一个简单的命令,此命令在AutoCAD中效果很好。命令名称为“ Rota”。
<?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文件夹(在此文件夹中,我放置了DLL文件)。然后我制作了ZIP文件。
然后在我的代码中,执行以下步骤:
{
"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."
}
执行时,这是报告:
[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",
..........................
}
怎么了?
答案 0 :(得分:0)
错误消息表明我们的服务无法从存储桶中下载输入文件...最有可能是由于标头中缺少身份验证信息。
请记住,我们的存储桶受OAuth2保护,因此您需要在工作项中提供访问令牌(有关详细信息,请参见here),或生成签名的URL以临时下载/上传对象而无需进行身份验证(请参见详细信息here)
"headers": {
"Authorization": "", //header goes here
"Content-type": "application/octet-stream"
},
或者,您可以将输入/输出文件存储到您选择的任何远程存储中-AWS / GCD / Azure等。
答案 1 :(得分:0)
我解决了Activity中的错误更改:
"settings": {
"script": "Rota\n"
收件人:
"settings": {
"script": "(command \"Rota\")\n"
[07/18/2019 09:24:00] Error: Non-optional output [outputFile.dwg] is missing .
[07/18/2019 09:24:00] Error: An unexpected error happened during phase Publishing of job.
"outputFile": {
"zip": false,
"ondemand": false,
"verb": "put",
"description": "output file",
"localName": "outputFile.dwg",
"required": "true"
}
"outputFile": {
"url": "https://developer.api.autodesk.com/oss/v2/buckets/{{ TokenKey}}/objects/square.dwg",
"headers": {
"Authorization": "Bearer {{ oAuthToken }}",
"Content-type": "application/octet-stream"
},
"verb": "put"
},
可能会有什么变化?
谢谢!