Include kfactor in BOM
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>6</ApplicationRevision>
|
||||
<ApplicationRevision>9</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
@@ -123,10 +123,10 @@
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Content Include="Templates\Blank.drwdot">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Templates\BomTemplate.xlsx">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -217,10 +217,6 @@ namespace ExportDXF.Forms
|
||||
|
||||
var items = GetItems(bom);
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
}
|
||||
|
||||
Print("Found " + items.Count);
|
||||
Print("");
|
||||
|
||||
@@ -270,7 +266,7 @@ namespace ExportDXF.Forms
|
||||
|
||||
if (savePath == null)
|
||||
{
|
||||
Print("Cancelled\n", Color.Red);
|
||||
Print("Canceled\n", Color.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -293,12 +289,23 @@ namespace ExportDXF.Forms
|
||||
var config = item.Component.ReferencedConfiguration;
|
||||
|
||||
var sheetMetal = model.GetFeatureByTypeName("SheetMetal");
|
||||
var thickness = sheetMetal.GetDimension("Thickness").GetValue2(config);
|
||||
var db = string.Empty;
|
||||
var material = part.GetMaterialPropertyName2(config, out db);
|
||||
|
||||
item.Thickness = thickness;
|
||||
item.Material = material;
|
||||
if (sheetMetal != 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;
|
||||
}
|
||||
|
||||
var db = string.Empty;
|
||||
|
||||
item.Material = part.GetMaterialPropertyName2(config, out db);
|
||||
|
||||
if (part == null)
|
||||
continue;
|
||||
@@ -404,6 +411,9 @@ namespace ExportDXF.Forms
|
||||
partsSheet.Cells[row, 5].Value = item.Thickness;
|
||||
|
||||
partsSheet.Cells[row, 6].Value = item.Material;
|
||||
|
||||
if (item.KFactor > 0)
|
||||
partsSheet.Cells[row, 7].Value = item.KFactor;
|
||||
}
|
||||
|
||||
workbook.Calculate();
|
||||
|
||||
@@ -14,6 +14,8 @@ namespace ExportDXF
|
||||
|
||||
public double Thickness { get; set; }
|
||||
|
||||
public double KFactor { get; set; }
|
||||
|
||||
public string Material { get; set; }
|
||||
|
||||
public Component2 Component { get; set; }
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user