See the top rated post in this thread. Click here

Results 1 to 4 of 4

Thread: Getting Started with VS2010 and ACAD2011

  1. #1
    100 Club
    Join Date
    2002-10
    Posts
    154
    Login to Give a bone
    1

    Default Getting Started with VS2010 and ACAD2011

    First let me point out that I am new at VB.Net. So if any of this information is incorrect in any way, please reply so that everyone can have the correct information.

    I came across a few problems while trying to use Visual Studio 2010 and AutoCAD 2011. Some of the problems were my limited knowledge of Visual Studio but others were bugs and/or communication problems. I found some of the answers to my problems hard to find and some easy. So I decided to start this post to help the people out like me who don’t know that much about Visual Studio and AutoCAD.

    When I started with Visual Studio, I started out trying to use the Express version. Due to some of the l limitations for debugging, started using the Ultimate version. So if anyone can add information about the Express version that would be great.

    When you start out, it is a good idea to find a good tutorial to get your feet wet. There a few “Hello World” tutorials out there. But some of them do not give you all of the information you need to connect to AutoCAD and debug it. Below are some settings that you need to make in Visual Studio after starting a new project.
    Items 1 through 3 are accessed by going in the Solution Explorer, right click on your Project Name and go to Properties.

    1. You need to set the Target framework from “.NET Framework 4.0” back to “.NETFramework 3.5” because AutoCAD uses 3.5. This is located under Properties>Compile>Advanced Compile Options.

    2. Now you need to set the “Start external program” to your acad.exe file. This is located under Properties>Debug. Browse to find your acad.exe file. It is usually located somewhere like “C:\Program Files\Autodesk\AutoCAD 2011\acad.exe”.

    3. Now you need to add in your References. This is located under the References tab>Add. The two main ones to add are acdbmgd.dll and acmgd.dll. They are located under the same path that you found the acad.exe file. Do not select the com, but select the Browse tab and find these two files. Once you have done this, you need to change the Copy Local setting on these two references to “False”. This is found in the Properties window when you select the reference. You will not be able to run debug in ACAD unless you do this. Two other References that you might want to add are the acax18enu.tlb and axdb18enu.tlb. They are located “C:\Program Files\Common Files\Autodesk Shared”. These two files will make using AutoCAD a lot easier.

    4. Now you need to setup AutoCAD. Basically, I had to only change one file (acad.exe.config located next to your acad.exe file). I had a 3rd party software running in my ACAD so I am not sure if yours will have the same issues. My tag to for the “supportedRuntime” was commented out. I had to first uncomment it. Then AutoCAD debugged great for a while until I started accessing forms in a different way. This problem was fixed by setting the version of the supported Runtime from the 4.0 to the 2.0 framework. From what I understand is that .NET Framework 3.5 was built on the 2.0 Framework or something like that. Therefore you need to set this to the latest 2.0 that you have. You can find this by looking under “C:\Windows\Microsoft.NET\Framework”. I had a folder called v2.0.50727 so I used this. Below is what I added/modified to my acad.exe.config file.
    Code:
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v2.0.50727"/>
    </startup>
    Since I am using Windows7, I had to do a save as on my desktop and copy back to the AutoCAD folder. (if anyone knows how to turn this protection off, I would like to know too.)
    Please add or provide your corrections to my post. I found it hard to get started with all of the different things that I had to look up and figure out on my own. I thought that it would be great to post this hand have input for all of us trying to get started and not have to look all over the place to get this thing started.
    Last edited by jluker; 2010-08-10 at 01:14 PM.

  2. #2
    Member
    Join Date
    2015-11
    Posts
    9
    Login to Give a bone
    0

    Default Re: Getting Started with VS2010 and ACAD2011

    A couple of reasons I went back to VS 2008:
    1. VS 2010 wants to convert any project it opens to the new format which is not backward compatible.
    2. As of the time of this post there are no handy ARX Wizards for VS 2010.
    3. Edit and Continue stopped working on some projects.

  3. #3
    100 Club
    Join Date
    2002-10
    Posts
    154
    Login to Give a bone
    0

    Default Re: Getting Started with VS2010 and ACAD2011

    A couple of reasons I went back to VS 2008:
    1. VS 2010 wants to convert any project it opens to the new format which is not backward compatible.
    2. As of the time of this post there are no handy ARX Wizards for VS 2010.
    3. Edit and Continue stopped working on some projects.
    These settings should get you up and running so that you can debug your project. I don't know of any Arx Wizards but I have been able to use VS2010 with these modifications. As for going back to previous version, I am the only one writing code. I have no reason to go back but I can understand you not going to 2010 if you have multiple people writing code and some of them still using older versions of VS.

  4. #4
    AUGI Addict sinc's Avatar
    Join Date
    2004-02
    Location
    Colorado
    Posts
    1,986
    Login to Give a bone
    1

    Default Re: Getting Started with VS2010 and ACAD2011

    Quote Originally Posted by jluker View Post
    When I started with Visual Studio, I started out trying to use the Express version. Due to some of the l limitations for debugging, started using the Ultimate version. So if anyone can add information about the Express version that would be great.
    You can debug in the Express version, but you have to setup your own .csproj.user file manually. The UI won't let you do it.

    I've attached a sample .csproj.user file that will startup the "C3D2011" profile in Civil 3D 2011. I put the file in a zip archive, because this website will not let me upload a ".csproj.user" file. For other Autocad products, the basic idea is the same; you just need to change paths and start arguments to fit your product. You can edit this file in any basic text editor, such as Notepad.

    This file should go in the same directory as your .csproj file, and should have the same name. For example, if your project is MyProj.csproj, then this file should be MyProj.csproj.user and should be in the same directory.

    The caveat is that "Edit and Continue" is not available if you are on a 64-bit OS and you target "AnyCPU" or "x64". This is a Microsoft issue.
    Attached Files Attached Files

Similar Threads

  1. Newbie in VB VS2010 and ACAD2011x64
    By ramonvaldezz925989 in forum Dot Net API
    Replies: 2
    Last Post: 2014-08-13, 09:36 AM
  2. Getting Started
    By wags5116 in forum Revit MEP - General
    Replies: 3
    Last Post: 2009-01-12, 08:22 AM
  3. Getting started
    By rafterman in forum Revit MEP - General
    Replies: 1
    Last Post: 2006-05-31, 01:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •