2023-04-07 08:10:28 +03:00
|
|
|
|
#if !NET472
|
|
|
|
|
using System.Runtime.Versioning;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
namespace RhSolutions.Tools;
|
|
|
|
|
|
|
|
|
|
#if !NET472
|
|
|
|
|
[SupportedOSPlatform("windows")]
|
|
|
|
|
#endif
|
2023-04-14 08:08:46 +03:00
|
|
|
|
internal class DxfTool : Tool
|
2023-04-07 08:10:28 +03:00
|
|
|
|
{
|
2023-04-17 08:49:26 +03:00
|
|
|
|
public DxfTool(IServiceProvider provider) : base(provider)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-07 08:10:28 +03:00
|
|
|
|
public override void Execute()
|
|
|
|
|
{
|
|
|
|
|
Application app = RhSolutionsAddIn.Excel.Application;
|
|
|
|
|
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
|
|
|
|
|
var products = _reader.ReadProducts(new[] { worksheet });
|
2023-04-17 08:49:26 +03:00
|
|
|
|
_writer = _writerFactory.GetWriter("Dxf");
|
2023-04-07 08:10:28 +03:00
|
|
|
|
_writer.WriteProducts(products);
|
|
|
|
|
}
|
|
|
|
|
}
|