/// <summary> /// Creates a new macro from a list of strings. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> /// <param name="macros">a list of macros to be loaded.</param> protected internal PMMacro(PMAutomation powerMILL, params string[] macros) { _lines = new List <string>(); if (macros.Any()) { _lines = macros.ToList(); } ConfigureMacro(powerMILL); }
/// <summary> /// Creates a new macro and reads the Macro File in. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> /// <param name="macroFile">The file with the macro to be loaded.</param> protected internal PMMacro(PMAutomation powerMILL, FileSystem.File macroFile) { _lines = new List <string>(); if (macroFile != null) { // Break the file down into lines _lines = macroFile.ReadTextLines(); } ConfigureMacro(powerMILL); }
private void ConfigureMacro(PMAutomation powerMILL) { _localIndex = 0; _powerMILL = powerMILL; _cancel = false; _executedCommands = new List <string>(); DoNotExecuteCommentsOrBlankLines = false; UseExecuteEx = false; _RunSubMacrosOption = SubMacroRunOptions.RunAllLines; }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> /// <param name="projectDirectory">The project directory path.</param> /// <param name="openReadOnly">If true it will open as read only.</param> /// <remarks></remarks> internal PMProject(PMAutomation powerMILL, Directory projectDirectory, bool openReadOnly = false) { _powerMILL = powerMILL; _projectDirectory = projectDirectory; if (openReadOnly) { _powerMILL.DoCommand("PROJECT READONLY OPEN '" + projectDirectory.Path + "'"); } else { _powerMILL.DoCommand("PROJECT OPEN '" + projectDirectory.Path + "'"); } Initialise(); }
/// <summary> /// Creates a new boundary based on its type. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> /// <param name="name">The name for the boundary entity.</param> /// <returns>The created boundary.</returns> /// <remarks></remarks> internal static PMBoundary CreateEntity(PMAutomation powerMILL, string name) { switch ( powerMILL.DoCommandEx("PRINT PAR TERSE \"entity('boundary', '" + name + "').type\"").ToString().Trim()) { case "block": return(new PMBoundaryBlock(powerMILL, name)); case "rest": return(new PMBoundaryRest(powerMILL, name)); case "selected": return(new PMBoundarySelectedSurface(powerMILL, name)); case "shallow": return(new PMBoundaryShallow(powerMILL, name)); case "silhouette": return(new PMBoundarySilhouette(powerMILL, name)); case "collision": return(new PMBoundaryCollisionSafe(powerMILL, name)); case "stockmodel_rest": return(new PMBoundaryStockModelRest(powerMILL, name)); case "contact_point": return(new PMBoundaryContactPoint(powerMILL, name)); case "contact_conv": return(new PMBoundaryContactConversion(powerMILL, name)); case "boolean_operation": return(new PMBoundaryBooleanOperation(powerMILL, name)); case "user": return(new PMBoundaryUserDefined(powerMILL, name)); default: throw new Exception("Failed to determine boundary type"); } }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMStockModelsCollection(PMAutomation powerMILL) : base(powerMILL) { Initialise(); }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMToolTaperedTipped(PMAutomation powerMILL) : base(powerMILL) { }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMill">The base instance to interact with PowerMILL.</param> /// <param name="name">The new instance name.</param> internal PMEntity(PMAutomation powerMill, string name) { PowerMill = powerMill; _name = name; }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> /// <param name="name">The new instance name.</param> internal PMToolTippedDisc(PMAutomation powerMILL, string name) : base(powerMILL, name) { }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> /// <param name="name">The new instance name.</param> internal PMBoundary(PMAutomation powerMILL, string name) : base(powerMILL, name) { }
/// <summary> /// Creates a new collection. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> public PMMachineToolsCollection(PMAutomation powerMILL) : base(powerMILL) { Initialise(); }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMPattern(PMAutomation powerMILL) : base(powerMILL) { }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMLevelOrSetsCollection(PMAutomation powerMILL) : base(powerMILL) { Initialise(); }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> /// <param name="name">The new instance name.</param> internal PMNCProgram(PMAutomation powerMILL, string name) : base(powerMILL, name) { }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMNCProgram(PMAutomation powerMILL) : base(powerMILL) { }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMill">The base instance to interact with PowerMILL.</param> internal PMToolpath(PMAutomation powerMill) : base(powerMill) { InitializeLeads(); }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMill">The base instance to interact with PowerMILL.</param> /// <param name="name">The new instance name.</param> internal PMToolpath(PMAutomation powerMill, string name) : base(powerMill, name) { InitializeLeads(); }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> /// <param name="name">The new instance name.</param> internal PMPattern(PMAutomation powerMILL, string name) : base(powerMILL, name) { }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMBoundary(PMAutomation powerMILL) : base(powerMILL) { }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMWorkplanesCollection(PMAutomation powerMILL) : base(powerMILL) { Initialise(); }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMProject(PMAutomation powerMILL) { _powerMILL = powerMILL; _projectDirectory = null; Initialise(); }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMToolpathsCollection(PMAutomation powerMILL) : base(powerMILL) { Initialise(); }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMToolTippedDisc(PMAutomation powerMILL) : base(powerMILL) { }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMWorkplane(PMAutomation powerMILL) : base(powerMILL) { }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMill">The base instance to interact with PowerMILL.</param> internal PMEntity(PMAutomation powerMill) { PowerMill = powerMill; _name = ""; }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> /// <param name="name">The new instance name.</param> internal PMWorkplane(PMAutomation powerMILL, string name) : base(powerMILL, name) { }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMSetupsCollection(PMAutomation powerMILL) : base(powerMILL) { Initialise(); }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMTool(PMAutomation powerMILL) : base(powerMILL) { }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> /// <param name="name">The new instance name.</param> internal PMToolTaperedTipped(PMAutomation powerMILL, string name) : base(powerMILL, name) { }
/// <summary> /// Initialises the item. /// </summary> /// <param name="powerMILL">The base instance to interact with PowerMILL.</param> internal PMFeatureGroupsCollection(PMAutomation powerMILL) : base(powerMILL) { Initialise(); }