0

My script for Forge Design Automation API will produce a couple of outputs such as dxf, png, PDF. Can I package them to an zip with WorkItem? The below is the code snippet of the WorkItem I created. It will fail because in default, it can only download single format of output.

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     
});
Augusto Goncalves
  • 8,493
  • 2
  • 17
  • 44

1 Answers1

1

The OutputArguments of WorkItem allows you to export the result to zip. ResourceKind = ResourceKind.ZipPackage. e.g.

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 is a the meta data of WorkItem

Augusto Goncalves
  • 8,493
  • 2
  • 17
  • 44
Xiaodong Liang
  • 2,051
  • 2
  • 9
  • 14