Add value diagram windows and view models

This commit is contained in:
Evgeny Redikultsev
2025-11-09 17:34:51 +05:00
parent 111b60a08d
commit 466b47f447
58 changed files with 1397 additions and 162 deletions

View File

@@ -0,0 +1,34 @@
using netDxf;
using netDxf.Entities;
using netDxf.Tables;
using StructureHelperCommon.Models.Shapes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Services.Exports
{
public class EntitiesToDxfExportLogic : IExportToFileLogic
{
private const double metresToMillimeters = 1000.0;
private IGetDxfLayerLogic layerLogic = new GetDxfLayerLogic();
public List<(EntityObject entity, LayerNames layerName)> Entities { get; set; } = [];
public string FileName { get; set; }
public void Export()
{
DxfDocument dxf = new DxfDocument();
foreach (var shape in Entities)
{
Layer layer = layerLogic.GetOrCreateLayer(dxf, shape.layerName);
var entity = shape.entity;
entity.Layer = layer;
dxf.Entities.Add(entity);
}
dxf.Save(FileName);
}
}
}