Author Topic: How can I get acad.exe args from .net?  (Read 1678 times)

0 Members and 1 Guest are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
How can I get acad.exe args from .net?
« on: October 25, 2012, 03:33:20 AM »
AutoCAD 2013 x86 SP 1.1
Windows XP x86 SP3

I tried such code:
Code - C#: [Select]
  1. Process proc = Process.GetCurrentProcess();
  2. String arguments = proc.StartInfo.Arguments;
  3.  
At the "Debug" tab of my project (in MS Visual Studio 2010), I set such command line args:
Quote
/nologo /p "C:\AdminCAD\Dependent\17.2\etc\Profiles\GPSM Profile v.3.0.arg" "C:\__temp\Drawing1.dwg"
When I run debug, all arguments applies. But in my code the "arguments" variable has empty string as value.

Why? How can I get acad.exe arguments?

huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
Re: How can I get acad.exe args from .net?
« Reply #1 on: October 25, 2012, 04:28:30 AM »
You can look at the results of System.Environment.GetCommandLineArgs()

This will give a list of strings of all the command switches.


See also: http://www.theswamp.org/index.php?topic=43021.0
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: How can I get acad.exe args from .net?
« Reply #2 on: October 25, 2012, 04:33:53 AM »
You can look at the results of System.Environment.GetCommandLineArgs()

This will give a list of strings of all the command switches.


See also: http://www.theswamp.org/index.php?topic=43021.0
Oh, thank's! I forgot about this property. :)