public virtual void MyTestInitialize() { try { // Start PowerSHAPE _powerSHAPE.Reset(); // Switch FormUpdate and Dialogs off _powerSHAPE.FormUpdateOff(); _powerSHAPE.DialogsOff(); } catch (Exception) { // If something has gone wrong whilst running the tests in this TestFixture // then this will ensure we reconnect to PowerShape _powerSHAPE = null; ConnectToPowerShape(); // Start PowerSHAPE _powerSHAPE.Reset(); // Switch FormUpdate and Dialogs off _powerSHAPE.FormUpdateOff(); _powerSHAPE.DialogsOff(); } }
private void StartPowerShape() { if (_powerShape == null) { _powerShape = new PSAutomation(InstanceReuse.UseExistingInstance); } _powerShape.Reset(); _powerShape.FormUpdateOff(); _powerShape.RefreshOff(); _powerShape.DialogsOff(); }
static void Main(string[] args) { powerSHAPE = new PSAutomation(Autodesk.ProductInterface.InstanceReuse.CreateNewInstance); powerSHAPE.Reset(); //Creating and selecting model psModel = powerSHAPE.Models.CreateEmptyModel(); //Turning off messages powerSHAPE.FormUpdateOff(); powerSHAPE.RefreshOff(); powerSHAPE.DialogsOff(); // Building model BuildingBasis(); BuildingCylinder(); CuttingCirclesInBase(); BuildingSidebars(); // Ending execution ClosingSafely(); }