コード例 #1
0
        /// <summary>
        /// Connect to an instance of PowerMill that is passed in (this should be the COM object)
        /// </summary>
        /// <param name="powerMillComObject">The COM object of PowerMill to connect to.</param>
        public PMAutomation(dynamic powerMillComObject)
        {
            _powerMILL = powerMillComObject;

            // Dialogs are on by default
            _isGUIVisible = true;

            // Initialise the Macro substitution tokens collection
            _substitutionTokens  = new PMSubstitutionTokensCollection();
            IssueEchoOffCommands = false;
        }
コード例 #2
0
        /// <summary>
        /// Calls down to the base class to start PowerMILL based on the specified
        /// option.
        /// </summary>
        /// <param name="instanceReuse">Specifies how to start the application (e.g. use the running instance, create a new instance).</param>
        /// <param name="applicationMode">Represents the GUI option in PowerMill.</param>
        /// <remarks></remarks>
        public PMAutomation(InstanceReuse instanceReuse, Modes applicationMode = Modes.WithoutGui)
        {
            _applicationMode = applicationMode;
            Initialise(instanceReuse);

            // Ensure PowerMILL has started properly
            while (DoCommandEx("PRINT \"TEST\"").ToString() != "TEST")
            {
                System.Threading.Thread.Sleep(1000);
                DoCommand("ECHO OFF DCPDEBUG UNTRACE COMMAND ACCEPT");
            }

            // Dialogs are on by default
            _isGUIVisible = true;

            // Initialise the Macro substitution tokens collection
            _substitutionTokens  = new PMSubstitutionTokensCollection();
            IssueEchoOffCommands = false;
        }