为 Design Automation WorkItem 创建单个包
Creating a single package for Design Automation WorkItem
我的 Forge Design Automation API 脚本将生成一些输出,例如 dxf、png、PDF。我可以使用 WorkItem 将它们打包成一个 zip 文件吗?下面是我创建的 WorkItem 的代码片段。它会失败,因为在默认情况下,它只能下载单一格式的输出。
var wi = new WorkItem()
{
Id = "", // Must be set to empty
Arguments = new Arguments(),
ActivityId = activity.Id
};
wi.Arguments.InputArguments.Add(new Argument()
{
Name = "HostDwg", // Must match the input parameter in activity
Resource =
"http://download.autodesk.com/us/support/files/autocad_2015_templates/acad.dwt",
StorageProvider = StorageProvider.Generic // Generic HTTP download (vs A360)
});
wi.Arguments.OutputArguments.Add(new Argument()
{
Name = "Results", // Must match the output parameter in activity
StorageProvider = StorageProvider.Generic, // Generic HTTP upload (vs A360)
HttpVerb = HttpVerbType.POST, // Use HTTP POST when delivering result
Resource = null, // Use storage provided by Design Automation
});
WorkItem 的 OutputArguments 允许您将结果导出到 zip。 ResourceKind = ResourceKind.ZipPackage。例如
wi.Arguments.OutputArguments.Add(new Argument(
{
Name = "Results", // Must match the output parameter in activity
StorageProvider = StorageProvider.Generic, // Generic HTTP upload (vs A360)
HttpVerb = HttpVerbType.POST, // Use HTTP POST when delivering result
Resource = null, // Use storage provided by Design Automation
ResourceKind = ResourceKind.ZipPackage // Upload as zip to output directory
});
This link 是 WorkItem
的元数据
我的 Forge Design Automation API 脚本将生成一些输出,例如 dxf、png、PDF。我可以使用 WorkItem 将它们打包成一个 zip 文件吗?下面是我创建的 WorkItem 的代码片段。它会失败,因为在默认情况下,它只能下载单一格式的输出。
var wi = new WorkItem()
{
Id = "", // Must be set to empty
Arguments = new Arguments(),
ActivityId = activity.Id
};
wi.Arguments.InputArguments.Add(new Argument()
{
Name = "HostDwg", // Must match the input parameter in activity
Resource =
"http://download.autodesk.com/us/support/files/autocad_2015_templates/acad.dwt",
StorageProvider = StorageProvider.Generic // Generic HTTP download (vs A360)
});
wi.Arguments.OutputArguments.Add(new Argument()
{
Name = "Results", // Must match the output parameter in activity
StorageProvider = StorageProvider.Generic, // Generic HTTP upload (vs A360)
HttpVerb = HttpVerbType.POST, // Use HTTP POST when delivering result
Resource = null, // Use storage provided by Design Automation
});
WorkItem 的 OutputArguments 允许您将结果导出到 zip。 ResourceKind = ResourceKind.ZipPackage。例如
wi.Arguments.OutputArguments.Add(new Argument(
{
Name = "Results", // Must match the output parameter in activity
StorageProvider = StorageProvider.Generic, // Generic HTTP upload (vs A360)
HttpVerb = HttpVerbType.POST, // Use HTTP POST when delivering result
Resource = null, // Use storage provided by Design Automation
ResourceKind = ResourceKind.ZipPackage // Upload as zip to output directory
});
This link 是 WorkItem
的元数据