diff --git a/ExportDXF/ExportDXF.csproj b/ExportDXF/ExportDXF.csproj
index 2cb49b4..cf38eb4 100644
--- a/ExportDXF/ExportDXF.csproj
+++ b/ExportDXF/ExportDXF.csproj
@@ -22,7 +22,7 @@
false
false
true
- 9
+ 11
1.0.0.%2a
false
true
diff --git a/ExportDXF/Forms/MainForm.cs b/ExportDXF/Forms/MainForm.cs
index 5a81b7b..77a5540 100644
--- a/ExportDXF/Forms/MainForm.cs
+++ b/ExportDXF/Forms/MainForm.cs
@@ -232,7 +232,7 @@ namespace ExportDXF.Forms
if (dir == null)
{
- Print("Cancelled\n", Color.Red);
+ Print("Canceled\n", Color.Red);
return;
}
@@ -289,18 +289,12 @@ namespace ExportDXF.Forms
var config = item.Component.ReferencedConfiguration;
var sheetMetal = model.GetFeatureByTypeName("SheetMetal");
+ var sheetMetalData = sheetMetal?.GetDefinition() as SheetMetalFeatureData;
- if (sheetMetal != null)
+ if (sheetMetalData != null)
{
- var kfactor = sheetMetal.GetDimension("D2")?.GetValue2(config);
-
- if (kfactor.HasValue)
- item.KFactor = kfactor.Value;
-
- var thickness = sheetMetal.GetDimension("Thickness")?.GetValue2(config);
-
- if (thickness.HasValue)
- item.Thickness = thickness.Value;
+ item.Thickness = sheetMetalData.Thickness.FromSldWorks();
+ item.KFactor = sheetMetalData.KFactor;
}
var db = string.Empty;
@@ -314,8 +308,15 @@ namespace ExportDXF.Forms
Application.DoEvents();
}
- var bomFile = Path.Combine(savePath, "BOM.xlsx");
- CreateBOMExcelFile(bomFile, items.ToList());
+ try
+ {
+ var bomFile = Path.Combine(savePath, "BOM.xlsx");
+ CreateBOMExcelFile(bomFile, items.ToList());
+ }
+ catch (Exception ex)
+ {
+ Print(ex.Message, Color.Red);
+ }
}
private string ChangePathExtension(string fullpath, string newExtension)
@@ -503,8 +504,8 @@ namespace ExportDXF.Forms
for (int rowIndex = 0; rowIndex < table.RowCount; rowIndex++)
{
- if (table.RowHidden[rowIndex] == true)
- continue;
+ //if (table.RowHidden[rowIndex] == true)
+ // continue;
var bomComponents = isBOMPartsOnly ?
((Array)bom.GetComponents2(rowIndex, bom.BomFeature.Configuration))?.Cast() :
diff --git a/ExportDXF/Helper.cs b/ExportDXF/Helper.cs
index 492d597..b570b73 100644
--- a/ExportDXF/Helper.cs
+++ b/ExportDXF/Helper.cs
@@ -172,12 +172,12 @@ namespace ExportDXF
public static double ToSldWorks(this double d)
{
- return d * ScaleFactor;
+ return Math.Round(d * ScaleFactor, 8);
}
public static double FromSldWorks(this double d)
{
- return d / ScaleFactor;
+ return Math.Round(d / ScaleFactor, 8);
}
}
}