Moved HideModelSketches to ViewHelper class.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using ExportDXF.ItemExtractors;
|
using ExportDXF.ItemExtractors;
|
||||||
|
using ExportDXF.ViewFlipDeciders;
|
||||||
using OfficeOpenXml;
|
using OfficeOpenXml;
|
||||||
using SolidWorks.Interop.sldworks;
|
using SolidWorks.Interop.sldworks;
|
||||||
using SolidWorks.Interop.swconst;
|
using SolidWorks.Interop.swconst;
|
||||||
@@ -571,34 +572,6 @@ namespace ExportDXF.Forms
|
|||||||
return false;
|
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()
|
private string UserSelectFolder()
|
||||||
{
|
{
|
||||||
string path = null;
|
string path = null;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using SolidWorks.Interop.sldworks;
|
using SolidWorks.Interop.sldworks;
|
||||||
|
using SolidWorks.Interop.swconst;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -269,5 +270,33 @@ namespace ExportDXF
|
|||||||
{
|
{
|
||||||
return Math.Round(angleInRadians * 180.0 / Math.PI, 8);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user