TheSwamp

Code Red => .NET => Topic started by: Kerry on January 13, 2007, 07:34:07 PM

Title: AutoStart Netload when debugging.
Post by: Kerry on January 13, 2007, 07:34:07 PM
I've been sucessfully using a startup script to Autoload (into AutoCAD) the net Assembly currently being edited/Debugged in VS2005.

In vs2005, from the Project Properties, make the following changes :-

. Add the Start Action -> external Program : < qualified path to Acad.exe >

. Add the Start Options -> Working directory : Essentially a 'start-in' folderPath. I use it for test drawings for all projects, data and the Startup script for each project   

. Add the Start Options -> Command Line Arguments : Similar to the Command line switches used in batch files and from Icons. [ refer Acad help ]. The last parameters will be :-  /b <project script file qualified path&Name >

. Build a script file in the Working directory with a unique name to be used with a specific project. [ see sample ]


When you start debugging from VS2005 ( using F5 or from the menu ) Autocad will start and the script file will execute, NETLOADing the nominated DLL.

As a result of the ScriptFile Name being saved in the Project properties, when you change projects and start debugging, the correct DLL will always be loaded

Feedback appreciated ..

The sample Script code :
Code: [Select]
;; LayoutsAndPlots.scr
netload
"k:/Visual Studio 2005 Projects/_cad/CsMgdAcad-LayoutsAndPlots/CsMgdAcad-Template1/BIN/DEBUG/CsMgdAcad-LayoutsAndPlots.dll"
;;;;

and some piccys :-   
Title: Re: AutoStart Netload when debugging.
Post by: Kerry on January 13, 2007, 07:42:07 PM
additional note:
The text displayed (in this case) is defined as part of the current class Initialise() Method.

There is a sample here : http://www.theswamp.org/index.php?topic=14465.msg174209#msg174209
Title: Re: AutoStart Netload when debugging.
Post by: Jeff_M on January 13, 2007, 08:56:40 PM
Thanks for this, Kerry. I've been using my acad.lsp file to load them, but I didn't really like that solution since I also need to do real work and I don't like having my test apps loading into my working environ. This should solve that problem.
Title: Re: AutoStart Netload when debugging.
Post by: Kerry on January 13, 2007, 09:18:45 PM
my pleasure Jeff

.. necessity is the mother, heh !
Title: Re: AutoStart Netload when debugging.
Post by: jmaeding on January 14, 2007, 11:43:37 AM
Thanks for giving the pics you did, I had been wondering if the start arguments were for the acad prog  or the tool (although classes will not have command line arg's only exe's) - obviously they are for the debug prog so that is cool.
Another thing besides scripts I will use that for is setting the profile.
My profile for doing designing/drafting has all kinds of menus and tools loaded, it slows down the opening.  So I will make a "bare" profile and use that for debugging, should speed up the startup.
thanks
Title: Re: AutoStart Netload when debugging.
Post by: Kerry on January 14, 2007, 04:21:05 PM
Happy to share James ..
I'm now using that line for profile and template .dwt as well .. also with the goal of speeding up the initialisation/load of ACAD.