From 4e1f4c8c021622709fd18a254a368db3290fbf73 Mon Sep 17 00:00:00 2001 From: CortexCore <2630229280@qq.com> Date: Sun, 3 Mar 2024 18:15:47 +0800 Subject: [PATCH] 1 --- Class1.cs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Class1.cs b/Class1.cs index 0950b90..9661551 100644 --- a/Class1.cs +++ b/Class1.cs @@ -38,20 +38,25 @@ namespace BITFactory.Cutting.Mod stringBuilder.AppendLine($"导出时间: {DateTime.Now}"); foreach (var x in commands) { - switch (x) + if(x is CuttingPointCommand pointCommand) { - case CuttingPointCommand pointCommand: - stringBuilder.AppendLine( - $"切削点: {pointCommand.PlanePoint.x} {pointCommand.PlanePoint.y} {pointCommand.PlanePoint.z}"); - break; - case CuttingLineCommand lineCommand: - stringBuilder.AppendLine($"切削线:{lineCommand.Line.Length}"); - foreach (var linePos in lineCommand.Line) - { - stringBuilder.AppendLine($"切削线点: {linePos.x} {linePos.y} {linePos.z}"); - } - break; + stringBuilder.AppendLine( + $"切削点: {pointCommand.PlanePoint.x} {pointCommand.PlanePoint.y} {pointCommand.PlanePoint.z}"); } + // switch (x) + // { + // case CuttingPointCommand pointCommand: + // stringBuilder.AppendLine( + // $"切削点: {pointCommand.PlanePoint.x} {pointCommand.PlanePoint.y} {pointCommand.PlanePoint.z}"); + // break; + // case CuttingLineCommand lineCommand: + // stringBuilder.AppendLine($"切削线:{lineCommand.Line.Length}"); + // foreach (var linePos in lineCommand.Line) + // { + // stringBuilder.AppendLine($"切削线点: {linePos.x} {linePos.y} {linePos.z}"); + // } + // break; + // } } File.WriteAllText(path, stringBuilder.ToString());