Exemplo n.º 1
0
        public static List <RevitProcess> ListRunningRevits()
        {
            var runningRevits = new List <RevitProcess>();

            foreach (Process ps in Process.GetProcesses())
            {
                if (RevitProcess.IsRevitProcess(ps))
                {
                    runningRevits.Add(new RevitProcess(ps));
                }
            }
            return(runningRevits);
        }
Exemplo n.º 2
0
        public static List <RevitProcess> ListRunningRevits()
        {
            var runningRevits = new List <RevitProcess>();

            // lets handle exceptions just in case user can not read processes
            try {
                foreach (Process ps in Process.GetProcesses())
                {
                    if (RevitProcess.IsRevitProcess(ps))
                    {
                        runningRevits.Add(new RevitProcess(ps));
                    }
                }
            }
            catch (Exception ex) {
                logger.Debug($"Error getting Revit processes. | {ex}");
            }

            return(runningRevits);
        }