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