Update Class1.cs

This commit is contained in:
CortexCore 2024-03-03 18:14:41 +08:00
parent 05f2be0359
commit 1fb9cb1ad1
1 changed files with 12 additions and 17 deletions

View File

@ -38,25 +38,20 @@ namespace BITFactory.Cutting.Mod
stringBuilder.AppendLine($"导出时间: {DateTime.Now}"); stringBuilder.AppendLine($"导出时间: {DateTime.Now}");
foreach (var x in commands) foreach (var x in commands)
{ {
if(x is CuttingPointCommand pointCommand) switch (x)
{ {
stringBuilder.AppendLine( case CuttingPointCommand pointCommand:
$"切削点: {pointCommand.PlanePoint.x} {pointCommand.PlanePoint.y} {pointCommand.PlanePoint.z}"); 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;
} }
// 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()); File.WriteAllText(path, stringBuilder.ToString());