Jump to content

Close and open the AutoCAD Build to generate the DLL in VB Express 2008


FELIXJM

Recommended Posts

I am developing a DLL in VB.NET and configured AutoCAD to load this DLL automatically direct the folder that is generated by BUILD in VB 2008 Express.

 

The problem is that standing still with AutoCAD open after running the DLL can not regenerate by BUILD in VB Express 2008 because of an error that the DLL is being used by another process and then have to close AutoCAD, generating BUILD AutoCAD and open again.

 

OK.

Link to comment
Share on other sites

Instead of manually opening AutoCAD, NETLOADing the DLL, then attempting to rebuild... why not simply DEBUG from withing VSIDE???

 

Open Visual Studio, open your project, then DEBUG... which if your project's settings are correct will automagically launch AutoCAD... then when done, or a code change is needed, switch back to VSIDE and STOP the debug. Revise code. Repeat.

Link to comment
Share on other sites

I'm having trouble understanding your post RenderMan. Where exactly would you have to configure visual studio to automatically launch AutoCAD and do the whole debugging story?

 

I recognize the debugging procedure you are decribing from writing .exe programs, but .dll always requires manual loading, F5 gives me the 'dll has to be loaded in its parent program' story.

Link to comment
Share on other sites

Going from memory here, as I typically devlop with Visual Studio 2010 Express & .NET Wizard, and am posting from an iPhone LoL - in Visual Studio (Professional):

 

Project Properties > Debug Tab > Start Application > Browse to the desired AutoCAD version's acad.exe

 

Express does not allow this method, but one can manually edit the *proj file's XML to add the appropriate start application node, etc. or simply use the wizard which does this automagically.

 

HTH

Link to comment
Share on other sites

You're a genius, thanks :'D Guess this also answers the initial question, just use the regular debug / stop debug procedure.

 

As for the initial question: the DLL still has to be loaded into AutoCAD after F5 (debug), this can be done in many ways but I do it by adding the dll path to the search paths and adding (command "netload" "") to acad.lsp

Link to comment
Share on other sites

You're a genius, thanks :'D Guess this also answers the initial question, just use the regular debug / stop debug procedure.

 

That is kind of you to say; glad my post helped you. :)

 

As for the initial question: the DLL still has to be loaded into AutoCAD after F5 (debug), this can be done in many ways but I do it by adding the dll path to the search paths and adding (command "netload" "") to acad.lsp

 

There is a simpler method, that won't leave 'residue' in your Support File Search Paths (SFSP)... Consider adding a Script to your .NET project. :wink:

 

Open a blank text file (Notepad?), and add the following:

 

netload "[color=red]FileName[/color].dll" 

... Save this file to your .NET project directory with a .SCR file extension. For this example, we'll use "autoNetload.scr" but you can use any name you like.

 

Next, in your .NET project, go to > Project's Properties > Debug Tab > Start Options > Add this:

 

/b "[color=red]VisualStudioProjectFilePath[/color]\[color=blue]autoNetload[/color].scr"

Now Debug using Visual Studio... Tada! Your debug compiled .DLL was just NETLOADed automagically. Lemon Squeezy. :thumbsup:

 

 

 

** Note- The reason that the script can load the DLL without providing a full file path is due to the fact that "Drawing1.dwg" is opened in the ..\bin\Debug\ folder. To confirm, simply try (getvar 'dwgprefix) at the command line.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...