Check for suppressed bends

This commit is contained in:
AJ
2019-09-27 22:08:09 -04:00
parent cdc0fabe4f
commit 1f9dd002be

View File

@@ -470,6 +470,11 @@ namespace ExportDXF.Forms
var drawingModel = templateDrawing as ModelDoc2; var drawingModel = templateDrawing as ModelDoc2;
drawingModel.ViewZoomtofit2(); drawingModel.ViewZoomtofit2();
if (HasSupressedBends(view))
{
Print("A bend is suppressed, please check flat pattern!", Color.Red);
}
if (HideModelSketches(view)) if (HideModelSketches(view))
{ {
// delete the current view that has sketches shown // delete the current view that has sketches shown
@@ -504,6 +509,25 @@ namespace ExportDXF.Forms
} }
} }
private bool HasSupressedBends(IView view)
{
var model = view.ReferencedDocument;
var refConfig = view.ReferencedConfiguration;
model.ShowConfiguration(refConfig);
var flatPattern = model.GetFeatureByTypeName("FlatPattern");
var bends = flatPattern.GetAllSubFeaturesByTypeName("UiBend");
foreach (var bend in bends)
{
if (bend.IsSuppressed())
return true;
}
return false;
}
private bool HideModelSketches(IView view) private bool HideModelSketches(IView view)
{ {
var model = view.ReferencedDocument; var model = view.ReferencedDocument;