Compare commits
2 Commits
d3f6791b53
...
a0080c8a68
| Author | SHA1 | Date | |
|---|---|---|---|
| a0080c8a68 | |||
| aeec611f78 |
@@ -4,7 +4,7 @@ namespace ExportDXF
|
||||
{
|
||||
public class DrawingInfo
|
||||
{
|
||||
private static Regex drawingFormatRegex = new Regex(@"(?<jobNo>[34]\d{3}(-\d+\w{1,2})?)\s?(?<dwgNo>[ABEP]\d+(-?(\d+[A-Z]?))?)", RegexOptions.IgnoreCase);
|
||||
private static Regex drawingFormatRegex = new Regex(@"(?<jobNo>[345]\d{3}(-\d+\w{1,2})?)\s?(?<dwgNo>[ABEP]\d+(-?(\d+[A-Z]?))?)", RegexOptions.IgnoreCase);
|
||||
|
||||
public string JobNo { get; set; }
|
||||
|
||||
|
||||
@@ -283,12 +283,11 @@ namespace ExportDXF.Forms
|
||||
if (worker.CancellationPending)
|
||||
return;
|
||||
|
||||
var itemExtractor = new BomItemExtractor(bom);
|
||||
itemExtractor.SkipHiddenRows = true;
|
||||
var bomItems = GetItems(bom);
|
||||
|
||||
Print($"Fetching components from {bom.BomFeature.Name}");
|
||||
if (bomItems == null)
|
||||
return;
|
||||
|
||||
var bomItems = itemExtractor.GetItems();
|
||||
items.AddRange(bomItems);
|
||||
}
|
||||
|
||||
@@ -300,6 +299,25 @@ namespace ExportDXF.Forms
|
||||
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)
|
||||
{
|
||||
var prefix = prefixTextBox.Text;
|
||||
|
||||
10
ExportDXF/Properties/DataSources/Item.datasource
Normal file
10
ExportDXF/Properties/DataSources/Item.datasource
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="Item" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ExportDXF.Item, ExportDXF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
Reference in New Issue
Block a user