Author Topic: AcCoreConsole causes AutoCAD to flicker  (Read 6378 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 5854
AcCoreConsole causes AutoCAD to flicker
« on: June 07, 2012, 07:52:02 pm »
Has anyone had the same the problem with AcCoreConsole causing AutoCAD to flicker.
 
 
It causes AutoCAD to flicker if ran from a AutoCAD command or from a total different .exe(WinForm, WPF, etc...)
 
 
Is it something that can be changed in the creation of the process object?
 
Code - C#: [Select]
  1.  
  2.        static Task<CoreConsoleResult> RunAcCoreConsole(CoreConsoleStartInfo ccsi)
  3.        {
  4.            Task<CoreConsoleResult> task = Task.Factory.StartNew<CoreConsoleResult>(() =>
  5.            {
  6.                CoreConsoleResult ccr;
  7.                using (Process process = new Process())
  8.                {
  9.                    ProcessStartInfo startInfo = new ProcessStartInfo();
  10.                    startInfo.FileName = acCoreConsolePath;
  11.                    string ApplicationArguments = string.Format("/i \"{0}\" /s \"{1}\" /isolate CoreConsole", ccsi.FileName, ccsi.ScriptFilePath);
  12.                    startInfo.Arguments = ApplicationArguments;
  13.                    startInfo.UseShellExecute = false;
  14.                    startInfo.CreateNoWindow = true;
  15.                    startInfo.RedirectStandardOutput = true;
  16.                    process.StartInfo = startInfo;
  17.                    process.Start();
  18.                    process.WaitForExit();
  19.                    ccr = new CoreConsoleResult(ccsi.FileName, process.StandardOutput.ReadToEnd());
  20.  
  21.                }
  22.                return ccr;
  23.            });
  24.            return task;
  25.        }
  26.  
  27.  

 

Andrey Bushman

  • Swamp Rat
  • Posts: 860
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #1 on: June 08, 2012, 03:27:13 am »
I think that it is the next bug in AcCoreConsole realization. It is are additional problem to problems which are listed here.

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #2 on: June 09, 2012, 05:18:04 pm »
Noticed it causes every window to flicker, Outlook, IE, etc........
 
It is like they are iterating through all the windows.
 
« Last Edit: June 09, 2012, 10:00:06 pm by Jeff H »

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #3 on: June 14, 2012, 05:28:39 am »
ADN reported they could not reproduce the error so threw this together for them to test
Also notice it with ADN example from here
Just pay attention while selecting different drawings in list box or when run a command.

I will be attaching some code that was thrown together quickly and sloppy just for a example to see if you experience the same issue, I am using a total different approach but this still shows the problem. So pay NO attention to efficiency, style or anything alike but is just for producing a issue. Also no error handling

Especially watch the "BIG A" at top left, but still notice it with ADN example but not so noticeable as doing one drawing.

Some notes about code:
The path to accoreconsole.exe is hard-coded to
"C:\Program Files\Autodesk\AutoCAD 2013\accoreconsole.exe" in CoreConsole class. So might need to change it

It will create a script file to your MyDocuments folder but delete it if no errors(could handle that in finally block).
It should create create a process for each core on your machine and when one finishes it will create another until all files have been done.   
So for a quad core machine then no more than 4 accoreconsole.exe processes should run at one time and creating a new one when one of them finishes.
or for a duo core same as above but max of 2 accoreconsole.exe  processes should run at one time.
 
If debug or run .exe in release folder you should click the button on WPF form and it should let you select folder.
Then for every drawing in the folder it will change all entities in ModelSpace to a random different color.

Depending on your machine here are some different size drawings to test with. They all have at least 24 drawings with 500 to 15,000 entities.

Below are some links with dwg's you can test with.
These folders contain drawings with just lines. circles, & arcs.
Contains 24 drawings with 500 entities each.
https://dl.dropbox.com/u/17374049/Test_500_24.zip
Contains 48 drawings with 500 entities each.
https://dl.dropbox.com/u/17374049/Test_500_48.zip
Contains 24 drawings with 5000 entities each.
https://dl.dropbox.com/u/17374049/Test_5000_24.zip
Contains 24 drawings with 15000 entities each.
https://dl.dropbox.com/u/17374049/Test_15000_24.zip


Added a webbrowser that defaults to the TheSwamp for no particular reason.
Should notice accoreconsole' running in taskmanager but all windows flicker when process id changes.
The button opens a FolderBrowserDialog box to select one folders downloaded from above.

 

 
Source code attached at bottom.
 
Again I am using a different approach than this example but this was just thrown together for ADN to see if they expirence the same problem, but basiclly uses the WaitAllOnebyOne appraoch with a limit on total number of processes at one time.
 
Code - C#: [Select]
  1.  
  2.  int cores = 0;
  3.            foreach (var item in new System.Management.ManagementObjectSearcher("Select * from Win32_Processor").Get())
  4.            {
  5.                cores += int.Parse(item["NumberOfCores"].ToString());
  6.            }
  7.            int numofFiles = fis.Length;
  8.            int fileIndex = 0;
  9.            List<Task<CoreConsoleResult>> tasks = new List<Task<CoreConsoleResult>>();
  10.            int totalTaskCreated = 0;
  11.            if (numofFiles > cores)
  12.            {
  13.                for (int i = 0; i < cores; i++)
  14.                {
  15.                    CoreConsoleStartInfo ccsi = new CoreConsoleStartInfo(fis[fileIndex].FullName, scriptPath);
  16.                    Task<CoreConsoleResult> t = RunAcCoreConsole(ccsi);
  17.                    tasks.Add(t);
  18.                    fileIndex++;
  19.                    totalTaskCreated++;
  20.                }
  21.            }
  22.            else
  23.            {
  24.                for (int i = 0; i < numofFiles; i++)
  25.                {
  26.                    CoreConsoleStartInfo ccsi = new CoreConsoleStartInfo(fis[fileIndex].FullName, scriptPath);
  27.                    Task<CoreConsoleResult> t = RunAcCoreConsole(ccsi);
  28.                    tasks.Add(t);
  29.                    fileIndex++;
  30.                    totalTaskCreated++;
  31.                }
  32.            }
  33.            int done = 0;
  34.            while (done < numofFiles)
  35.            {
  36.                int index = Task.WaitAny(tasks.ToArray());
  37.                done++;
  38.                tasks.RemoveAt(index);
  39.                if (totalTaskCreated < numofFiles)
  40.                {
  41.                    CoreConsoleStartInfo ccsi = new CoreConsoleStartInfo(fis[fileIndex].FullName, scriptPath);
  42.                    Task<CoreConsoleResult> t = RunAcCoreConsole(ccsi);
  43.                    tasks.Add(t);
  44.                    totalTaskCreated++;
  45.                    if (fileIndex < numofFiles - 1)
  46.                        fileIndex++;
  47.                }
  48.            }
  49.            sb.DeleteScriptFile();
  50.        }
  51.  
  52.        static Task<CoreConsoleResult> RunAcCoreConsole(CoreConsoleStartInfo ccsi)
  53.        {
  54.            Task<CoreConsoleResult> task = Task.Factory.StartNew<CoreConsoleResult>(() =>
  55.            {
  56.                CoreConsoleResult ccr;
  57.                using (Process process = new Process())
  58.                {
  59.                    ProcessStartInfo startInfo = new ProcessStartInfo();
  60.                    startInfo.FileName = acCoreConsolePath;
  61.                    string ApplicationArguments = string.Format("/i \"{0}\" /s \"{1}\" /isolate CoreConsole", ccsi.FileName, ccsi.ScriptFilePath);
  62.                    startInfo.Arguments = ApplicationArguments;
  63.                    startInfo.UseShellExecute = false;
  64.                    startInfo.CreateNoWindow = true;
  65.                    startInfo.RedirectStandardOutput = true;
  66.                    process.StartInfo = startInfo;
  67.                    process.Start();                  
  68.                    ccr = new CoreConsoleResult(ccsi.FileName, process.StandardOutput.ReadToEnd());
  69.                    process.WaitForExit();
  70.                }
  71.                return ccr;
  72.            });
  73.            return task;
  74.        }
  75.  

Will post approach I am taking when I get time to do more testing and refactor.
 
 
 
Windows 7 64 bit.

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #4 on: June 15, 2012, 11:15:17 am »
I do not know ADN says they cannot reproduce it.
 
Here is a screencast of ADN running it but they changed to show the window and not redirect output.
ADN ScreenCast
 
I tried those same settings but here is how it works on 2 machines I tested.
Notice how it flickers and the mous disappears the Big A up top disappears.
My ScreenCast
 
Any idea what would cause this?

vegbruiser

  • Guest
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #5 on: June 18, 2012, 05:44:15 am »
I've just downloaded, compiled and run the console app you wrote.

I noticed a little bit of flickering in the app itself, which I assume is down to it attempting to maintain focus? But none of my other programs had any problems. (I have Outlook and Google Chrome open in perpetuity.)

Sorry I can't be of any further help.

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #6 on: June 18, 2012, 10:26:41 am »
Thanks.
 
It might have something to do with dual moniters??

vegbruiser

  • Guest
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #7 on: June 18, 2012, 10:31:42 am »
I do have a dual monitor set-up if that's any consolation.?

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #8 on: June 18, 2012, 10:33:14 am »
I have no idea what it is but mine flickers like crazy,
 
 
thanks again

TheMaster

  • Guest
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #9 on: June 18, 2012, 12:31:57 pm »
I have no idea what it is but mine flickers like crazy,
 
 
thanks again

Just a note on your approach to asynchronous processing with Core Console.
It doesn't need to be that complicated.

I would just get a list of all files to process, and run it through Parallel.ForEach or
call AsParallel().Select(...) on the list, if there is a result for each file.

Asynchronous programming shouldn't require the programmer to be concerned
with how many CPU cores are available, and Parallel LINQ takes care of all of
that for us.

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #10 on: June 18, 2012, 12:42:18 pm »
I tried Parallel.ForEach() but it would launch 2-100+ accoreconsole processes(depending on number of drawings) and that was the only way I knew to keep it down to a certain number.
 
Did not try PLINQ approach.
 
 
 
 
 

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #11 on: June 20, 2012, 11:38:03 am »
ADN did not notice the flicker but confirmed the cursor disappearing while continuing to work and has reported it, so hopefully it gets fixed, because might as well freeze up the UI instead cursor dissappearing every second or two, which  deafeats he main reason for using it for this context.

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #12 on: September 11, 2014, 05:53:43 am »
Sweet looks like they fixed it in 2015.
Downloaded project and upgraded to .NET 4.5 and change path to 2015 accoreconsole.exe and updated references to point to 2015 dll's.
 
I created a folder with a drawing containing 30,000 circles and copied file in folder then pasted it, copied all files in folder, pasted them, repeat etc.....
Anyways changed the color of 30,000 circles in 768 drawings in couple of minutes.
Time to refactor and fix it up.
 
I got 2 errors out of 768 files looks like the license engine can not keep up.
 

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #13 on: September 16, 2014, 01:06:24 pm »
Starting to refactor, and need to finish cancelation and progress, .......
Code - C#: [Select]
  1.        private ConcurrentQueue<FileInfo> fileQueue;
  2.        public async void ProcessFiles(ICollection<FileInfo> fileInfos, Action<ProgressInfo> pinfo)
  3.        {
  4.            fileQueue = new ConcurrentQueue<FileInfo>(fileInfos);
  5.            int cores = Interop.User32.NumberOfCores();
  6.            Task[] tasks = new Task[cores];
  7.            for (int i = 0; i < cores; i++)
  8.            {
  9.                tasks[i] = Task.Run(() => RunAcCoreConsole(fileQueue, CTokenSource.Token));
  10.            }
  11.          await Task.WhenAll(tasks);
  12.        }
  13.        private  Task RunAcCoreConsole(ConcurrentQueue<FileInfo> que, CancellationToken ct)
  14.        {
  15.         return  Task.Run(() =>
  16.            {
  17.                FileInfo file;
  18.                while (que.TryDequeue(out file))
  19.                {
  20.                    if(ct.IsCancellationRequested) return;
  21.                    using (Process process = new Process())
  22.                    {
  23.                        process.StartInfo = CreateProcessStartInfo(file);
  24.                        process.Start();
  25.                        process.WaitForExit();
  26.                    }
  27.                }
  28.            }, ct);
  29.        }
  30.  
  31.  

weslleywang

  • Mosquito
  • Posts: 3
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #14 on: January 30, 2015, 01:31:34 pm »
Hi Jeff:

  I just tried to migration some of my code to use your code here and AU2012, CP3338 Using .NET Programming to Create New Possibilities with the AutoCADŽ Core Consolehttp://au.autodesk.com/au-online/classes-on-demand/class-catalog/2012/autocad/using-net-programming-to-create-new-possibilities-with-the-autocad-core-console by Augusto Goncalves. It really help me start and works really well.
  Now I have this issue, it take a long time for some task (e.g. print to PDF) for some drawings, some other drawing it just hang. How you handle this situation? Does timeout solve this problem? for timeout, I mean, if a Task (process of AcCoreConsole) take longer than a certain time, I will kill it and move to next drawing.


Thank you so much
Wes
AutoCAD (ACA, Map) 2014, Vault 2014, VS 2012 and Windows 7 64

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #15 on: January 31, 2015, 02:27:33 am »
See how this performs.
Probably easiest to just attach a little WPF app and let me know if any problems.
Project attached at bottom
  • Put dwg files in folder DwgFiles located in solution's root folder. Drawings in List Box on Left
  • Put script files in folder ScriptFiles located in solution's root folder. Files in List Box on right
  • Click Settings and make sure path to accoreconsole.exe is correct and change maximum seconds to run process before killing it if not yet finished.
Select a script file a click run script and see how performance is.

 
 
Class that does most of the work
Code - C#: [Select]
  1. using System;
  2. using System.Collections.Concurrent;
  3. using System.Collections.Generic;
  4. using System.Diagnostics;
  5. using System.IO;
  6. using System.Threading;
  7. using System.Threading.Tasks;
  8. namespace WpfTestAcCoreConsole.Scripting
  9. {
  10.    public class ScriptProcessor
  11.    {
  12.        public string AcCoreLocation { get; set; }
  13.        public string ScriptFilepath { get; set; }
  14.        public string Language { get; set; }
  15.        public string Isolate { get; set; }
  16.        private CancellationTokenSource CTokenSource;
  17.        private int MaxTime { get; set; }
  18.        private string Arguments(string drawingPath)
  19.        {
  20.  
  21.            return String.Format("/i \"{0}\" /s \"{1}\" /l \"{2} \"/isolate\" {3}", drawingPath, ScriptFilepath,
  22.                Language, Isolate);
  23.        }
  24.  
  25.        public ScriptProcessor(string acCoreLocation, string scriptFilePath, string isolate = "CoreConsole",
  26.            string language = "en-us")
  27.        {
  28.            AcCoreLocation = acCoreLocation;
  29.            ScriptFilepath = scriptFilePath;
  30.            Isolate = isolate;
  31.            Language = language;
  32.            CTokenSource = new CancellationTokenSource();
  33.            MaxTime = Properties.Settings.Default.MaxWaitTime * 1000;
  34.        }
  35.        private ProcessStartInfo CreateProcessStartInfo(FileInfo fi)
  36.        {
  37.            return new ProcessStartInfo()
  38.            {
  39.                FileName = AcCoreLocation,
  40.                Arguments = Arguments(fi.FullName),
  41.                UseShellExecute = false,
  42.                CreateNoWindow = true
  43.            };
  44.        }
  45.        public void Cancel()
  46.        {
  47.            CTokenSource.Cancel();
  48.        }
  49.        private ConcurrentQueue<FileInfo> fileQueue;
  50.        public async void ProcessFiles(ICollection<FileInfo> fileInfos, IProgress<ProgressInfo> pinfo)
  51.        {
  52.            fileQueue = new ConcurrentQueue<FileInfo>(fileInfos);
  53.            int cores = Interop.User32.NumberOfCores();
  54.            Task[] tasks = new Task[cores];
  55.            for (int i = 0; i < cores; i++)
  56.            {
  57.                tasks[i] = RunAcCoreConsole(fileQueue, CTokenSource.Token, pinfo);
  58.            }
  59.            await Task.WhenAll(tasks);
  60.        }
  61.  
  62.  
  63.        private Task RunAcCoreConsole(ConcurrentQueue<FileInfo> que, CancellationToken ct, IProgress<ProgressInfo> pinfo)
  64.        {
  65.            return Task.Run(() =>
  66.            {
  67.                FileInfo file;
  68.                while (que.TryDequeue(out file))
  69.                {
  70.                    ProgressInfo pi = new ProgressInfo(file.FullName, "Processing");
  71.                    DateTime orgDateTime = file.LastWriteTimeUtc;
  72.                    if (ct.IsCancellationRequested)
  73.                    {
  74.                        pi.Status = "Canceled";
  75.                        return;
  76.                    }
  77.                    pinfo.Report(pi);
  78.                    try
  79.                    {
  80.                        using (Process process = new Process())
  81.                        {
  82.                            process.StartInfo = CreateProcessStartInfo(file);
  83.                            process.Start();
  84.                            if (!process.WaitForExit(MaxTime))
  85.                            {
  86.                                pi.Status = "Max Time Reached";
  87.                                process.CloseMainWindow();
  88.                                if (!process.WaitForExit(2000))
  89.                                {
  90.                                    process.Kill();
  91.                                }
  92.                                continue;
  93.                            }
  94.  
  95.                        }
  96.                        file.Refresh();
  97.                        pi.Status = orgDateTime < file.LastWriteTimeUtc ? "Updated" : "Not Processed";
  98.                    }
  99.                    catch (Exception)
  100.                    {
  101.                        pi.Status = "Error";
  102.                    }
  103.  
  104.                }
  105.            }, ct);
  106.        }
  107.    }
  108. }
  109.  
  110.  

weslleywang

  • Mosquito
  • Posts: 3
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #16 on: February 02, 2015, 12:28:46 pm »
Hi Jeff:

  I cannot say thank you enough, it works prefect. I will digest and absorb every piece of it.


Thank you a thousand
Wes

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #17 on: February 02, 2015, 01:21:32 pm »
Just quickly off the top of my head so might be off but the main difference is previous version was creating a task for each drawing and this one creates a task for each core then each grab info from a Concurrent Collection.

So for a 4-core processor at first were creating 400 tasks and 400 process for 400 drawings,
but now 4 tasks and 400 process(100 each) for 400 drawings.

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #18 on: August 22, 2015, 12:34:46 am »
Looks like 2016 they made some changes but for the good.

It now correctly redirects the command line, and seems to run faster.

Attached is a updated version that displays the selected processed drawings command line.


djee

  • Newt
  • Posts: 48
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #19 on: August 25, 2015, 01:53:09 pm »
This is awesome work! Is it normal that it's not using the hyperthreaded cores (Logical Cores)... I got a 24 cores computer & i'm only seing 12 threads working? Also, could it be modified for selecting a script file (FilePrompt) instead of putting it in the script folder?
Nice work & thanks for sharing...
« Last Edit: August 25, 2015, 08:44:24 pm by djee »

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #20 on: August 25, 2015, 02:53:12 pm »
Is it normal that it's not using the hyperthreaded cores...
Do not know what those are so not sure
Here is what gets them
Code - C#: [Select]
  1.            int cores = 0;
  2.            foreach (var item in new System.Management.ManagementObjectSearcher("Select * from Win32_Processor").Get())
  3.            {
  4.                cores += int.Parse(item["NumberOfCores"].ToString());
  5.            }
  6.            return cores;
  7.  

and hyperthreaded cores and ManagementObjectSearcher bring this link up
http://stackoverflow.com/questions/1542213/how-to-find-the-number-of-cpu-cores-via-net-c

Also, could it be modified for selecting a script file (FilePrompt) instead of putting it in the script folder?
The same type of object is used for .dwg files that is used for .scr files.
Look button that adds .dwg from files of folders and can do the same for .scr.


Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #21 on: August 26, 2015, 12:59:06 am »
Just updated for setting xrefs path to relative and just batched 188 files in 2~3 minutes setting all xrefs path to relative if anyone wants new version uploaded. Still in testing phase if not already obvious.




tbrammer

  • Mosquito
  • Posts: 2
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #22 on: November 10, 2015, 05:59:51 am »
Hi there,

I'm using ACC 2016 (SP1) for batch "plotting" with a very similiar approach to this discussed here.
I also start up to <NuberOfCores>-1 parallel instances of the ACC with ::CreateProcess().
And I also noticed the flicker problem on my 2-monitor system.

Q1) Flicker:
Is the flicker-issue gone for ACC 2016 and your latest changes?
If so: Can you tell what made it go away?

Q2) Script out of sync problem:
I put "plotting" in quotes becaus I actually create file output like PDF, PNG,...
ACC is started with pre-created .scr files like this:
Code: [Select]
FILEDIA
0
EXPERT
5
;---
_-PLOT
_no
1
A4-PDF


_no
_yes
;----
_-PLOT
_no
1
A4-PNG


_no
_yes
;
----

The two blank lines before _no _yes choose the default Device and default filename given in the page setup.
Problem: I don't know the output filename. So it may happen that the file already exists. In this case ACC will ask me whether I want to overwrite the file (regardless of the EXPERT value). Thus the rest of the script gets mis-interpreted.

Is there a way to determine the output plot-filename for a given page setup?
It would also help to find out the filename extension (.pdf / .png).
I could provide a meaningful output filename than and make sure it does not exist.
Obviously the name will depend upon the PC3-file used. Any ideas?

Cheers
--Thomas

tbrammer

  • Mosquito
  • Posts: 2
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #23 on: December 14, 2015, 06:25:52 am »
I've done a lot of R&D around the ACC of AutoCAD 2016 in the past weeks.
For me the flicker-issue disappears, if I use /isolate <regkey> <work_dir> and /p acad switches as argumets of accoreconsole.exe.

If you want to run multiple instances of ACC parallel it is absolutely required to use /isolate <regkey> <working_dir> :

   accoreconsole /i c:\drwA.dwg /s c:\myscript.scr /isolate user1 c:\temp\acc1
   accoreconsole /i c:\drwB.dwg /s c:\myscript.scr /isolate user2 c:\temp\acc2
   ...
   accoreconsole /i c:\drwX.dwg /s c:\myscript.scr /isolate user7 c:\temp\acc7


See also http://adndevblog.typepad.com/autocad/2015/02/parallel-aggregation-using-accoreconsole.html

ACC will create a temporary registry path like
  HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R20.1\CoreUser\user2
It will always contain the user profiles <<Unnamed Profile>> and acad.
Never specifiy a non-existing profile name!  /p acad  works great in my tests.

Jeff H

  • Needs a day job
  • Posts: 5854
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #24 on: December 14, 2015, 08:59:22 pm »
Thanks for info tbrammer!

CADbloke

  • Bull Frog
  • Posts: 281
  • Crash Test Dummy
Re: AcCoreConsole causes AutoCAD to flicker
« Reply #25 on: October 25, 2017, 10:33:09 pm »
I tried Parallel.ForEach() but it would launch 2-100+ accoreconsole processes(depending on number of drawings) and that was the only way I knew to keep it down to a certain number.
yeah, years later but this may be handy for Googlers - you can limit the parallelism there. see https://stackoverflow.com/a/9290531/492

I haven't really been near core console since they broke it in v2015: https://forums.autodesk.com/t5/net/accoreconsole-exe-in-2015-doesn-t-do-system-console-writeline/td-p/5539352