diff --git a/ExportDXF/Forms/MainForm.cs b/ExportDXF/Forms/MainForm.cs index 94ef7e6..fbc8b07 100644 --- a/ExportDXF/Forms/MainForm.cs +++ b/ExportDXF/Forms/MainForm.cs @@ -1,4 +1,5 @@ using ExportDXF.ItemExtractors; +using ExportDXF.ViewFlipDeciders; using OfficeOpenXml; using SolidWorks.Interop.sldworks; using SolidWorks.Interop.swconst; @@ -571,34 +572,6 @@ namespace ExportDXF.Forms return false; } - private bool HideModelSketches(IView view) - { - var model = view.ReferencedDocument; - var activeConfig = ((Configuration)model.GetActiveConfiguration()).Name; - - var modelChanged = false; - var refConfig = view.ReferencedConfiguration; - model.ShowConfiguration(refConfig); - - var sketches = model.GetAllFeaturesByTypeName("ProfileFeature"); - - foreach (var sketch in sketches) - { - var visible = (swVisibilityState_e)sketch.Visible; - - if (visible == swVisibilityState_e.swVisibilityStateShown) - { - sketch.Select2(true, -1); - model.BlankSketch(); - modelChanged = true; - } - } - - model.ShowConfiguration(activeConfig); - - return modelChanged; - } - private string UserSelectFolder() { string path = null; diff --git a/ExportDXF/ViewHelper.cs b/ExportDXF/ViewHelper.cs index 5554385..9c4623a 100644 --- a/ExportDXF/ViewHelper.cs +++ b/ExportDXF/ViewHelper.cs @@ -1,4 +1,5 @@ using SolidWorks.Interop.sldworks; +using SolidWorks.Interop.swconst; using System; using System.Collections.Generic; using System.Linq; @@ -269,5 +270,33 @@ namespace ExportDXF { return Math.Round(angleInRadians * 180.0 / Math.PI, 8); } + + public static bool HideModelSketches(IView view) + { + var model = view.ReferencedDocument; + var activeConfig = ((Configuration)model.GetActiveConfiguration()).Name; + + var modelChanged = false; + var refConfig = view.ReferencedConfiguration; + model.ShowConfiguration(refConfig); + + var sketches = model.GetAllFeaturesByTypeName("ProfileFeature"); + + foreach (var sketch in sketches) + { + var visible = (swVisibilityState_e)sketch.Visible; + + if (visible == swVisibilityState_e.swVisibilityStateShown) + { + sketch.Select2(true, -1); + model.BlankSketch(); + modelChanged = true; + } + } + + model.ShowConfiguration(activeConfig); + + return modelChanged; + } } } \ No newline at end of file