Fixed null reference exception when component isn't a part document.

This commit is contained in:
AJ
2018-04-24 12:51:12 -04:00
parent 9aafcde051
commit e441d15a4e
2 changed files with 7 additions and 1 deletions

View File

@@ -286,6 +286,12 @@ namespace ExportDXF.Forms
var model = item.Component.GetModelDoc2() as ModelDoc2;
var part = model as PartDoc;
if (part == null)
{
Print(model.GetTitle() + " - skipped, not a part document");
continue;
}
var config = item.Component.ReferencedConfiguration;
var sheetMetal = model.GetFeatureByTypeName("SheetMetal");