public void MyTestCleanup() { try { if (TestContext.CurrentContext.Result.Outcome.Equals(ResultState.Failure)) { FileInfo[] files = new DirectoryInfo(Path.GetTempPath()).GetFiles("w_*.log"); //this section is what's really important for your application. foreach (FileInfo file in files) { file.CopyTo(@"c:\temp\testfail\" + file.Name, true); } } // Check that no dialogs need to be closed _powerSHAPE.Execute("CANCEL"); // Switch FormUpdate and Dialogs back on _powerSHAPE.FormUpdateOn(); _powerSHAPE.DialogsOn(); // Close model _powerSHAPE.Models.Clear(); } catch (Exception) { } }
public void MyTestCleanup() { try { // Check that no dialogs need to be closed _powerSHAPE.Execute("CANCEL"); // Switch FormUpdate and Dialogs back on _powerSHAPE.FormUpdateOn(); _powerSHAPE.DialogsOn(); // Close all models _powerSHAPE.Models.Clear(); } catch (Exception) { } }
static void CuttingCirclesInBase() { double lengthToCircleCenter = length * (50.0 / defaultLength); double widthToBottomCircleCenter = length * (17.0 / defaultLength); double widthToUpperCircleCenter = length * (63.0 / defaultLength); double radius = length * (7.0 / defaultLength); // Points Point leftBottomCircleCenter = new Point(-lengthToCircleCenter, 0.0, widthToBottomCircleCenter); Point leftUpperCircleCenter = new Point(-lengthToCircleCenter, 0.0, widthToUpperCircleCenter); Point rightBottomCircleCenter = new Point(lengthToCircleCenter, 0.0, widthToBottomCircleCenter); Point rightUpperCircleCenter = new Point(lengthToCircleCenter, 0.0, widthToUpperCircleCenter); Point leftBottomCircleStartingPoint = new Point(-lengthToCircleCenter, 0.0 + radius, widthToBottomCircleCenter); Point leftUpperCircleStartingPoint = new Point(-lengthToCircleCenter, 0.0 + radius, widthToUpperCircleCenter); Point rightBottomCircleStartingPoint = new Point(lengthToCircleCenter, 0.0 + radius, widthToBottomCircleCenter); Point rightUpperCircleStartingPoint = new Point(lengthToCircleCenter, 0.0 + radius, widthToUpperCircleCenter); // Circles PSArc leftBottomCircle = psModel.Arcs.CreateArcCircle(leftBottomCircleCenter, leftBottomCircleStartingPoint, radius); PSArc leftUpperCircle = psModel.Arcs.CreateArcCircle(leftUpperCircleCenter, leftUpperCircleStartingPoint, radius); PSArc rightBottomCircle = psModel.Arcs.CreateArcCircle(rightBottomCircleCenter, rightBottomCircleStartingPoint, radius); PSArc rightUpperCircle = psModel.Arcs.CreateArcCircle(rightUpperCircleCenter, rightUpperCircleStartingPoint, radius); // Rotating circles to the correct plane leftBottomCircle.Rotate(Autodesk.Axes.X, 90.0, 0, leftBottomCircleCenter); leftUpperCircle.Rotate(Autodesk.Axes.X, 90.0, 0, leftUpperCircleCenter); rightBottomCircle.Rotate(Autodesk.Axes.X, 90.0, 0, rightBottomCircleCenter); rightUpperCircle.Rotate(Autodesk.Axes.X, 90.0, 0, rightUpperCircleCenter); // Extruding cylinders which'll be subtracted psModel.Solids.CreateSolidExtrusionFromWireframe(leftBottomCircle, (8.0 / defaultLength) * width + 20.0, 0.0); psModel.Solids.CreateSolidExtrusionFromWireframe(leftUpperCircle, (8.0 / defaultLength) * width + 20.0, 0.0); psModel.Solids.CreateSolidExtrusionFromWireframe(rightBottomCircle, (8.0 / defaultLength) * width + 20.0, 0.0); psModel.Solids.CreateSolidExtrusionFromWireframe(rightUpperCircle, (8.0 / defaultLength) * width + 20.0, 0.0); #pragma warning disable CS0618 // Using raw macro for subtraction powerSHAPE.Execute("add Solid \"3\"", "add Solid \"4\"", "add Solid \"5\"", "add Solid \"6\"", "CREATE FEATURE SUBTRACTION", "select clearlist"); #pragma warning restore CS0618 // Using raw macro for subtraction }
/// <summary> /// Deletes selected triangles. /// </summary> /// <remarks></remarks> public void DeleteSelectedTriangles() { _powershape.Execute("DeleteTriangles"); }