Include bend radius on BOM
This commit is contained in:
@@ -300,9 +300,10 @@ namespace ExportDXF.Forms
|
||||
{
|
||||
item.Thickness = sheetMetalData.Thickness.FromSldWorks();
|
||||
item.KFactor = sheetMetalData.KFactor;
|
||||
}
|
||||
item.BendRadius = sheetMetalData.BendRadius.FromSldWorks();
|
||||
}
|
||||
|
||||
if (item.Description == null)
|
||||
if (item.Description == null)
|
||||
item.Description = model.Extension.CustomPropertyManager[config].Get("Description");
|
||||
|
||||
if (item.Description == null)
|
||||
@@ -312,7 +313,7 @@ namespace ExportDXF.Forms
|
||||
|
||||
item.Material = part.GetMaterialPropertyName2(config, out db);
|
||||
|
||||
if (part == null)
|
||||
if (part == null)
|
||||
continue;
|
||||
|
||||
SavePartToDXF(part, config, savepath);
|
||||
@@ -426,8 +427,13 @@ namespace ExportDXF.Forms
|
||||
|
||||
if (item.KFactor > 0)
|
||||
partsSheet.Cells[row, 7].Value = item.KFactor;
|
||||
|
||||
if (item.BendRadius > 0)
|
||||
partsSheet.Cells[row, 8].Value = item.BendRadius;
|
||||
}
|
||||
|
||||
partsSheet.Column(1).AutoFit();
|
||||
|
||||
workbook.Calculate();
|
||||
pkg.Save();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
using SolidWorks.Interop.swconst;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
@@ -32,7 +34,9 @@ namespace ExportDXF
|
||||
|
||||
while (feature != null)
|
||||
{
|
||||
if (feature.GetTypeName() == featureName)
|
||||
var name = feature.GetTypeName();
|
||||
|
||||
if (name == featureName)
|
||||
list.Add(feature);
|
||||
|
||||
feature = feature.GetNextFeature() as Feature;
|
||||
@@ -41,7 +45,24 @@ namespace ExportDXF
|
||||
return list;
|
||||
}
|
||||
|
||||
public static bool HasFlatPattern(this ModelDoc2 model)
|
||||
public static List<Feature> GetAllSubFeaturesByTypeName(this Feature feature, string subFeatureName)
|
||||
{
|
||||
var subFeature = feature.GetFirstSubFeature() as Feature;
|
||||
var list = new List<Feature>();
|
||||
|
||||
while (subFeature != null)
|
||||
{
|
||||
Debug.WriteLine(subFeature.GetTypeName2());
|
||||
if (subFeature.GetTypeName() == subFeatureName)
|
||||
list.Add(subFeature);
|
||||
|
||||
subFeature = subFeature.GetNextSubFeature() as Feature;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static bool HasFlatPattern(this ModelDoc2 model)
|
||||
{
|
||||
return model.GetBendState() != (int)swSMBendState_e.swSMBendStateNone;
|
||||
}
|
||||
@@ -161,6 +182,33 @@ namespace ExportDXF
|
||||
{
|
||||
return feature?.Parameter(dimName) as Dimension;
|
||||
}
|
||||
|
||||
public static string PunctuateList(this IEnumerable<string> stringList)
|
||||
{
|
||||
var list = stringList.ToList();
|
||||
|
||||
switch (list.Count)
|
||||
{
|
||||
case 0:
|
||||
return string.Empty;
|
||||
|
||||
case 1:
|
||||
return list[0];
|
||||
|
||||
case 2:
|
||||
return string.Format("{0} and {1}", list[0], list[1]);
|
||||
|
||||
default:
|
||||
var s = string.Empty;
|
||||
|
||||
for (int i = 0; i < list.Count - 1; i++)
|
||||
s += list[i] + ", ";
|
||||
|
||||
s += "and " + list.Last();
|
||||
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class Units
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace ExportDXF
|
||||
|
||||
public double KFactor { get; set; }
|
||||
|
||||
public double BendRadius { get; set; }
|
||||
|
||||
public string Material { get; set; }
|
||||
|
||||
public Component2 Component { get; set; }
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user