Skip to content

About

AutoCAD .Net Wizards for Visual Studio

Resources

Security policy

Stars

143 stars

Watchers

37 watching

Forks

Repository files navigation

AutoCAD .NET Wizards

Steps To Build

git clone https://github.com/ADN-DevTech/AutoCAD-Net-Wizards.git
cd AutoCAD-Net-Wizards\AutoCAD-Plugin-Template
devenv AutoCAD-Plugin.sln
msbuild PluginVsix\PluginVsix.csproj /t:build /p:Configuration=Release;Platform=x64
  • To create template packs for both C# and VB

    • Set ExamplePlugin as Start Up Project.

    • From Menubar->Project->Export Template

    • Repeat same for ExamplePluginVB

      ExportTemplate

Steps To Install

InstallWiz_01

InstallWiz_02

InstallWiz_03

VSWiz_01

Tips

  • After creating the project from the template pack, edit launchSettings.json to change the executable path to acad.exe.

    • Wizard template fetches the AutoCAD NuGet package from the Microsoft NuGet Server.
    • The template project will resolve to the local NuGet package if it already exists at %USERPROFILE%\.nuget.
    • To add the ObjectARX SDK or Civil SDK from a local file disk, edit the project file (.csproj).
      • Add <AssemblySearchPaths>D:\Arx2027\inc\;$(AssemblySearchPaths)</AssemblySearchPaths>.
  • Select the project from solution explorer and right click.

    EdiProjectFile

  • A typical .NET plugin project to accomodate AutoCAD, ACA, C3D etc.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net10.0-windows</TargetFramework>
    <Platforms>x64</Platforms>
    <OutputType>Library</OutputType>
    <RootNamespace>Example</RootNamespace>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
  </PropertyGroup>
  <PropertyGroup>
     <!--Edit ArxSdk to local ObjectARX Path-->
    <ArxSdk>D:\ArxSDKs\arx2027</ArxSdk>
     <!--Edit AcadDir to AutoCAD 2027 Install path-->
    <AcadDir>D:\ACAD\AutoCAD 2027</AcadDir>
    <ArxMgdPath>$(AcadDir)</ArxMgdPath>
    <OMFMgdPath>$(AcadDir)\ACA\</OMFMgdPath>
    <AeccMgdPath>$(AcadDir)\C3D\</AeccMgdPath>
    <AssemblySearchPaths>$(ArxSdk)\inc\;$(OMFMgdPath);$(AeccMgdPath);$(AssemblySearchPaths)</AssemblySearchPaths>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
    <OutputPath>bin\x64\Debug\</OutputPath>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
    <OutputPath>bin\x64\Release\</OutputPath>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
  <PropertyGroup>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
  </PropertyGroup>
    <ItemGroup Condition=" '$(UsingMicrosoftNETSdk)' == 'true' or '$(CLRSupport)' == 'NetCore' ">
        <FrameworkReference Include="Microsoft.WindowsDesktop.App" />
    </ItemGroup>
    <ItemDefinitionGroup Condition=" '$(CLRSupport)' == 'NetCore' ">
        <ClCompile>
            <DisableSpecificWarnings>4945;%(DisableSpecificWarnings)</DisableSpecificWarnings>
        </ClCompile>
    </ItemDefinitionGroup>
  <ItemGroup>
    <Reference Include="acdbmgd">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>$(ArxMgdPath)\acdbmgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="acmgd">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>$(ArxMgdPath)\acmgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="accoremgd">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>$(ArxMgdPath)\accoremgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="AecBaseMgd">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>$(OMFMgdPath)\AecBaseMgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="AeccDbMgd">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>$(AeccMgdPath)\AeccDbMgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <!--Add any other references here -->  

  </ItemGroup>
</Project>
  • launchSettings for various profiles
{
  "profiles": {
    "Example": {
      "commandName": "Project"
    },
    "Acad": {
      "commandName": "Executable",
      "executablePath": "$(AcadDir)\\acad.exe"
    },
    "C3D-Metric": {
      "commandName": "Executable",
      "executablePath": "$(AcadDir)\\acad.exe",
      "commandLineArgs": " /ld \"$(AcadDir)\\AecBase.dbx\" /p \"<<C3D_Metric>>\" /product C3D /language en-US"
    },
    "C3D-Imperial": {
      "commandName": "Executable",
      "executablePath": "$(AcadDir)\\acad.exe",
      "commandLineArgs": " /ld \"$(AcadDir)\\AecBase.dbx\" /p \"<<C3D_Imperial>>\" /product C3D /language en-US"
    }
  }
}

Uninstall Plugin VSIX

  • Through CLI (Use the Id field value in from .vsixmanifest file)
vsixinstaller /u:AutoCAD2027NETWiz_bfb2bba3-407d-4438-8408-80da1b122d65
  • Through UI uninstallWiz

Written By

  • Madhukar Moogala , Autodesk Platform Services (@galakar)

Updated By

  • Sreeparna Mandal

About

AutoCAD .Net Wizards for Visual Studio

Resources

Security policy

Stars

143 stars

Watchers

37 watching

Forks

Releases

Packages

Used by

Contributors

Languages