Print errors when getting BOM items.
This commit is contained in:
@@ -283,12 +283,11 @@ namespace ExportDXF.Forms
|
|||||||
if (worker.CancellationPending)
|
if (worker.CancellationPending)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var itemExtractor = new BomItemExtractor(bom);
|
var bomItems = GetItems(bom);
|
||||||
itemExtractor.SkipHiddenRows = true;
|
|
||||||
|
|
||||||
Print($"Fetching components from {bom.BomFeature.Name}");
|
if (bomItems == null)
|
||||||
|
return;
|
||||||
|
|
||||||
var bomItems = itemExtractor.GetItems();
|
|
||||||
items.AddRange(bomItems);
|
items.AddRange(bomItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,6 +299,25 @@ namespace ExportDXF.Forms
|
|||||||
ExportToDXF(items);
|
ExportToDXF(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<Item> GetItems(BomTableAnnotation bom)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var itemExtractor = new BomItemExtractor(bom);
|
||||||
|
itemExtractor.SkipHiddenRows = true;
|
||||||
|
|
||||||
|
Print($"Fetching components from {bom.BomFeature.Name}");
|
||||||
|
|
||||||
|
return itemExtractor.GetItems();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Print($"Failed to get items from BOM. {ex.Message}", Color.Red);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private void ExportToDXF(PartDoc part)
|
private void ExportToDXF(PartDoc part)
|
||||||
{
|
{
|
||||||
var prefix = prefixTextBox.Text;
|
var prefix = prefixTextBox.Text;
|
||||||
|
|||||||
Reference in New Issue
Block a user