-
Notifications
You must be signed in to change notification settings - Fork 1
/
DA_AutoCAD.cs
29 lines (27 loc) · 998 Bytes
/
DA_AutoCAD.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Autodesk.Forge.Oss.DesignAutomation.Samples.Models;
using Autodesk.Forge.Oss.DesignAutomation.Services;
using System.Threading.Tasks;
namespace Autodesk.Forge.Oss.DesignAutomation.Samples
{
public class DA_AutoCAD
{
public static async Task<bool> Test()
{
IDesignAutomationService service = new AutoCADDesignAutomationService("ListLayers")
{
EngineVersions = new[] { "24" },
EnableConsoleLogger = true,
EnableParameterConsoleLogger = true,
EnableReportConsoleLogger = true,
};
await service.Initialize(@".\DA\DA4ACAD\ListLayers.zip");
var result = await service.Run<AutoCADParameterOptions>(options =>
{
options.InputDwg = @".\DA\DA4ACAD\ListLayers.dwg";
options.Script = "(command \"LISTLAYERS\")\n";
});
await service.Delete();
return result;
}
}
}