├── .gitattributes ├── .gitignore ├── AutoCAD-Plugin-Template ├── AutoCAD-Plugin.sln ├── ExamplePlugin │ ├── ExamplePlugin.csproj │ ├── PluginExtension.cs │ ├── Properties │ │ └── launchSettings.json │ ├── myCommands.Designer.cs │ ├── myCommands.cs │ └── myCommands.resx ├── ExamplePluginVB │ ├── ExamplePluginVB.vbproj │ ├── My Project │ │ ├── Application.myapp │ │ └── launchSettings.json │ ├── PluginExtension.vb │ ├── myCommands.Designer.vb │ ├── myCommands.resx │ └── myCommands.vb ├── Icons │ └── __TemplateIcon.ico └── PluginVsix │ ├── PluginVsix.csproj │ ├── ProjectTemplates │ ├── AutoCAD 2025 Plugin CS.zip │ └── AutoCAD 2025 Plugin VB.zip │ ├── Properties │ └── AssemblyInfo.cs │ ├── __TemplateIcon.ico │ └── source.extension.vsixmanifest ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | [Dd]ebug/ 46 | [Rr]elease/ 47 | *_i.c 48 | *_p.c 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.vspscc 63 | .builds 64 | *.dotCover 65 | **/*.vs 66 | 67 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 68 | #packages/ 69 | 70 | # Visual C++ cache files 71 | ipch/ 72 | *.aps 73 | *.ncb 74 | *.opensdf 75 | *.sdf 76 | 77 | # Visual Studio profiler 78 | *.psess 79 | *.vsp 80 | 81 | # ReSharper is a .NET coding add-in 82 | _ReSharper* 83 | 84 | # Installshield output folder 85 | [Ee]xpress 86 | 87 | # DocProject is a documentation generator add-in 88 | DocProject/buildhelp/ 89 | DocProject/Help/*.HxT 90 | DocProject/Help/*.HxC 91 | DocProject/Help/*.hhc 92 | DocProject/Help/*.hhk 93 | DocProject/Help/*.hhp 94 | DocProject/Help/Html2 95 | DocProject/Help/html 96 | 97 | # Click-Once directory 98 | publish 99 | 100 | # Others 101 | [Bb]in 102 | [Oo]bj 103 | sql 104 | TestResults 105 | *.Cache 106 | ClientBin 107 | stylecop.* 108 | ~$* 109 | *.dbmdl 110 | Generated_Code #added for RIA/Silverlight projects 111 | 112 | # Backup & report files from converting an old project file to a newer 113 | # Visual Studio version. Backup files are not needed, because we have git ;-) 114 | _UpgradeReport_Files/ 115 | Backup*/ 116 | UpgradeLog*.XML 117 | 118 | 119 | 120 | ############ 121 | ## Windows 122 | ############ 123 | 124 | # Windows image file caches 125 | Thumbs.db 126 | 127 | # Folder config file 128 | Desktop.ini 129 | 130 | 131 | ############# 132 | ## Python 133 | ############# 134 | 135 | *.py[co] 136 | 137 | # Packages 138 | *.egg 139 | *.egg-info 140 | dist 141 | build 142 | eggs 143 | parts 144 | bin 145 | var 146 | sdist 147 | develop-eggs 148 | .installed.cfg 149 | 150 | # Installer logs 151 | pip-log.txt 152 | 153 | # Unit test / coverage reports 154 | .coverage 155 | .tox 156 | 157 | #Translations 158 | *.mo 159 | 160 | #Mr Developer 161 | .mr.developer.cfg 162 | 163 | # Mac crap 164 | .DS_Store 165 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/AutoCAD-Plugin.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.9.34728.123 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExamplePlugin", "ExamplePlugin\ExamplePlugin.csproj", "{0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginVsix", "PluginVsix\PluginVsix.csproj", "{58B2EBCB-97A7-42B4-9168-88C51B574896}" 9 | EndProject 10 | Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "ExamplePluginVB", "ExamplePluginVB\ExamplePluginVB.vbproj", "{FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Debug|arm64 = Debug|arm64 16 | Debug|x64 = Debug|x64 17 | Debug|x86 = Debug|x86 18 | Release|Any CPU = Release|Any CPU 19 | Release|arm64 = Release|arm64 20 | Release|x64 = Release|x64 21 | Release|x86 = Release|x86 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Debug|arm64.ActiveCfg = Debug|Any CPU 27 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Debug|arm64.Build.0 = Debug|Any CPU 28 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Debug|x64.ActiveCfg = Debug|x64 29 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Debug|x64.Build.0 = Debug|x64 30 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Debug|x86.ActiveCfg = Debug|Any CPU 31 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Debug|x86.Build.0 = Debug|Any CPU 32 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Release|arm64.ActiveCfg = Release|Any CPU 35 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Release|arm64.Build.0 = Release|Any CPU 36 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Release|x64.ActiveCfg = Release|x64 37 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Release|x64.Build.0 = Release|x64 38 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Release|x86.ActiveCfg = Release|Any CPU 39 | {0DD752F0-2A66-499A-ABA2-3DAC36A17DB9}.Release|x86.Build.0 = Release|Any CPU 40 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Debug|Any CPU.ActiveCfg = Debug|x64 41 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Debug|Any CPU.Build.0 = Debug|x64 42 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Debug|arm64.ActiveCfg = Debug|arm64 43 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Debug|arm64.Build.0 = Debug|arm64 44 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Debug|x64.ActiveCfg = Debug|x64 45 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Debug|x64.Build.0 = Debug|x64 46 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Debug|x86.ActiveCfg = Debug|x86 47 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Debug|x86.Build.0 = Debug|x86 48 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Release|Any CPU.ActiveCfg = Release|Any CPU 49 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Release|Any CPU.Build.0 = Release|Any CPU 50 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Release|arm64.ActiveCfg = Release|arm64 51 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Release|arm64.Build.0 = Release|arm64 52 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Release|x64.ActiveCfg = Release|x64 53 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Release|x64.Build.0 = Release|x64 54 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Release|x86.ActiveCfg = Release|x86 55 | {58B2EBCB-97A7-42B4-9168-88C51B574896}.Release|x86.Build.0 = Release|x86 56 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 57 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Debug|Any CPU.Build.0 = Debug|Any CPU 58 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Debug|arm64.ActiveCfg = Debug|Any CPU 59 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Debug|arm64.Build.0 = Debug|Any CPU 60 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Debug|x64.ActiveCfg = Debug|Any CPU 61 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Debug|x64.Build.0 = Debug|Any CPU 62 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Debug|x86.ActiveCfg = Debug|Any CPU 63 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Debug|x86.Build.0 = Debug|Any CPU 64 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Release|Any CPU.ActiveCfg = Release|Any CPU 65 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Release|Any CPU.Build.0 = Release|Any CPU 66 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Release|arm64.ActiveCfg = Release|Any CPU 67 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Release|arm64.Build.0 = Release|Any CPU 68 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Release|x64.ActiveCfg = Release|Any CPU 69 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Release|x64.Build.0 = Release|Any CPU 70 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Release|x86.ActiveCfg = Release|Any CPU 71 | {FEB18611-BB48-4EE4-AA3C-1D98EF080F7D}.Release|x86.Build.0 = Release|Any CPU 72 | EndGlobalSection 73 | GlobalSection(SolutionProperties) = preSolution 74 | HideSolutionNode = FALSE 75 | EndGlobalSection 76 | GlobalSection(ExtensibilityGlobals) = postSolution 77 | SolutionGuid = {9DECB18F-25B8-4374-8686-C6E33D7F683A} 78 | EndGlobalSection 79 | EndGlobal 80 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePlugin/ExamplePlugin.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net8.0-windows 4 | ExamplePlugin 5 | enable 6 | enable 7 | x64 8 | false 9 | true 10 | true 11 | true 12 | 13 | 14 | 15 | 16 | 17 | 18 | True 19 | True 20 | myCommands.resx 21 | 22 | 23 | 24 | 25 | ResXFileCodeGenerator 26 | myCommands.Designer.cs 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePlugin/PluginExtension.cs: -------------------------------------------------------------------------------- 1 | using Autodesk.AutoCAD.Runtime; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ExamplePlugin 9 | { 10 | public class PluginExtension : IExtensionApplication 11 | { 12 | public void Initialize() 13 | { 14 | // Add your initialization code here 15 | } 16 | 17 | public void Terminate() 18 | { 19 | // Add your termination code here 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePlugin/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "ExamplePlugin": { 4 | "commandName": "Project" 5 | }, 6 | "Acad": { 7 | "commandName": "Executable", 8 | "executablePath": "D:\\ACAD\\venn\\AutoCAD 2025\\acad.exe" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePlugin/myCommands.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ExamplePlugin { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class myCommands { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal myCommands() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ExamplePlugin.myCommands", typeof(myCommands).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to MyCommand. 65 | /// 66 | internal static string MyCommandLocal { 67 | get { 68 | return ResourceManager.GetString("MyCommandLocal", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to MyLispFunction. 74 | /// 75 | internal static string MyLispFunctionLocal { 76 | get { 77 | return ResourceManager.GetString("MyLispFunctionLocal", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized string similar to MyPickFirst. 83 | /// 84 | internal static string MyPickFirstLocal { 85 | get { 86 | return ResourceManager.GetString("MyPickFirstLocal", resourceCulture); 87 | } 88 | } 89 | 90 | /// 91 | /// Looks up a localized string similar to MySessionCmd. 92 | /// 93 | internal static string MySessionCmdLocal { 94 | get { 95 | return ResourceManager.GetString("MySessionCmdLocal", resourceCulture); 96 | } 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePlugin/myCommands.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | using Autodesk.AutoCAD.ApplicationServices; 4 | using Autodesk.AutoCAD.DatabaseServices; 5 | using Autodesk.AutoCAD.EditorInput; 6 | using Autodesk.AutoCAD.Runtime; 7 | using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application; 8 | 9 | [assembly: CommandClass(typeof(ExamplePlugin.MyCommands))] 10 | [assembly: ExtensionApplication(typeof(ExamplePlugin.PluginExtension))] 11 | 12 | namespace ExamplePlugin 13 | { 14 | 15 | 16 | public class MyCommands 17 | { 18 | // The CommandMethod attribute can be applied to any public member 19 | // function of any public class. 20 | // The function should take no arguments and return nothing. 21 | // If the method is an intance member then the enclosing class is 22 | // intantiated for each document. If the member is a static member then 23 | // the enclosing class is NOT intantiated. 24 | // 25 | // NOTE: CommandMethod has overloads where you can provide helpid and 26 | // context menu. 27 | 28 | // Modal Command with localized name 29 | [CommandMethod("MyGroup", "MyCommand", "MyCommandLocal", CommandFlags.Modal)] 30 | public void MyCommand() // This method can have any name 31 | { 32 | // Put your command code here 33 | Document doc = AcadApp.DocumentManager.MdiActiveDocument; 34 | Autodesk.AutoCAD.EditorInput.Editor ed; 35 | if (doc != null) 36 | { 37 | ed = doc.Editor; 38 | ed.WriteMessage("Hello, this is your first command."); 39 | 40 | } 41 | } 42 | 43 | // Modal Command with pickfirst selection 44 | [CommandMethod("MyGroup", "MyPickFirst", "MyPickFirstLocal", CommandFlags.Modal | CommandFlags.UsePickSet)] 45 | public void MyPickFirst() // This method can have any name 46 | { 47 | PromptSelectionResult result = AcadApp.DocumentManager.MdiActiveDocument.Editor.GetSelection(); 48 | if (result.Status == PromptStatus.OK) 49 | { 50 | // There are selected entities 51 | // Put your command using pickfirst set code here 52 | } 53 | else 54 | { 55 | // There are no selected entities 56 | // Put your command code here 57 | } 58 | } 59 | 60 | // Application Session Command with localized name 61 | [CommandMethod("MyGroup", "MySessionCmd", "MySessionCmdLocal", CommandFlags.Modal | CommandFlags.Session)] 62 | public void MySessionCmd() // This method can have any name 63 | { 64 | // Put your command code here 65 | } 66 | 67 | // LispFunction is similar to CommandMethod but it creates a lisp 68 | // callable function. Many return types are supported not just string 69 | // or integer. 70 | [LispFunction("MyLispFunction", "MyLispFunctionLocal")] 71 | public int MyLispFunction(ResultBuffer args) // This method can have any name 72 | { 73 | // Put your command code here 74 | 75 | // Return a value to the AutoCAD Lisp Interpreter 76 | return 1; 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePlugin/myCommands.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | MyCommand 122 | 123 | 124 | MyLispFunction 125 | 126 | 127 | MyPickFirst 128 | 129 | 130 | MySessionCmd 131 | 132 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePluginVB/ExamplePluginVB.vbproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ExamplePluginVB 5 | net8.0-windows 6 | enable 7 | enable 8 | x64 9 | false 10 | true 11 | true 12 | true 13 | 14 | 15 | 16 | 17 | 18 | 19 | True 20 | True 21 | myCommands.resx 22 | 23 | 24 | 25 | 26 | My.Resources 27 | ResXFileCodeGenerator 28 | myCommands.Designer.vb 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePluginVB/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | Form1 5 | false 6 | 0 7 | true 8 | 0 9 | true 10 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePluginVB/My Project/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "ExamplePluginVB": { 4 | "commandName": "Project" 5 | }, 6 | "Acad": { 7 | "commandName": "Executable", 8 | "executablePath": "D:\\ACAD\\venn\\AutoCAD 2025\\acad.exe" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePluginVB/PluginExtension.vb: -------------------------------------------------------------------------------- 1 | Imports Autodesk.AutoCAD.Runtime 2 | 3 | ' This line is not mandatory, but improves loading performances 4 | 5 | Namespace ExamplePluginVB 6 | Public Class PluginExtension 7 | Implements IExtensionApplication 8 | 9 | Public Sub Initialize() Implements IExtensionApplication.Initialize 10 | ' Add your initialization code here 11 | End Sub 12 | 13 | Public Sub Terminate() Implements IExtensionApplication.Terminate 14 | ' Add your termination code here 15 | End Sub 16 | 17 | End Class 18 | End Namespace 19 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePluginVB/myCommands.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.42000 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | Imports System 15 | 16 | Namespace My.Resources 17 | 18 | 'This class was auto-generated by the StronglyTypedResourceBuilder 19 | 'class via a tool like ResGen or Visual Studio. 20 | 'To add or remove a member, edit your .ResX file then rerun ResGen 21 | 'with the /str option, or rebuild your VS project. 22 | ''' 23 | ''' A strongly-typed resource class, for looking up localized strings, etc. 24 | ''' 25 | _ 28 | Friend Class myCommands 29 | 30 | Private Shared resourceMan As Global.System.Resources.ResourceManager 31 | 32 | Private Shared resourceCulture As Global.System.Globalization.CultureInfo 33 | 34 | _ 35 | Friend Sub New() 36 | MyBase.New 37 | End Sub 38 | 39 | ''' 40 | ''' Returns the cached ResourceManager instance used by this class. 41 | ''' 42 | _ 43 | Friend Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager 44 | Get 45 | If Object.ReferenceEquals(resourceMan, Nothing) Then 46 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ExamplePluginVB.myCommands", GetType(myCommands).Assembly) 47 | resourceMan = temp 48 | End If 49 | Return resourceMan 50 | End Get 51 | End Property 52 | 53 | ''' 54 | ''' Overrides the current thread's CurrentUICulture property for all 55 | ''' resource lookups using this strongly typed resource class. 56 | ''' 57 | _ 58 | Friend Shared Property Culture() As Global.System.Globalization.CultureInfo 59 | Get 60 | Return resourceCulture 61 | End Get 62 | Set 63 | resourceCulture = value 64 | End Set 65 | End Property 66 | 67 | ''' 68 | ''' Looks up a localized string similar to MyCommand. 69 | ''' 70 | Friend Shared ReadOnly Property MyCommandLocal() As String 71 | Get 72 | Return ResourceManager.GetString("MyCommandLocal", resourceCulture) 73 | End Get 74 | End Property 75 | 76 | ''' 77 | ''' Looks up a localized string similar to MyLispFunction. 78 | ''' 79 | Friend Shared ReadOnly Property MyLispFunctionLocal() As String 80 | Get 81 | Return ResourceManager.GetString("MyLispFunctionLocal", resourceCulture) 82 | End Get 83 | End Property 84 | 85 | ''' 86 | ''' Looks up a localized string similar to MyPickFirst. 87 | ''' 88 | Friend Shared ReadOnly Property MyPickFirstLocal() As String 89 | Get 90 | Return ResourceManager.GetString("MyPickFirstLocal", resourceCulture) 91 | End Get 92 | End Property 93 | 94 | ''' 95 | ''' Looks up a localized string similar to MySessionCmd. 96 | ''' 97 | Friend Shared ReadOnly Property MySessionCmdLocal() As String 98 | Get 99 | Return ResourceManager.GetString("MySessionCmdLocal", resourceCulture) 100 | End Get 101 | End Property 102 | End Class 103 | End Namespace 104 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePluginVB/myCommands.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | text/microsoft-resx 100 | 101 | 102 | 2.0 103 | 104 | 105 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 106 | 107 | 108 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 109 | 110 | 111 | MyCommand 112 | 113 | 114 | MyLispFunction 115 | 116 | 117 | MyPickFirst 118 | 119 | 120 | MySessionCmd 121 | 122 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/ExamplePluginVB/myCommands.vb: -------------------------------------------------------------------------------- 1 | ' (C) Copyright 2011 by 2 | ' 3 | Imports System 4 | Imports Autodesk.AutoCAD.Runtime 5 | Imports Autodesk.AutoCAD.ApplicationServices 6 | Imports Autodesk.AutoCAD.DatabaseServices 7 | Imports Autodesk.AutoCAD.Geometry 8 | Imports Autodesk.AutoCAD.EditorInput 9 | 10 | ' This line is not mandatory, but improves loading performances 11 | 12 | Namespace ExamplePluginVB 13 | 14 | ' This class is instantiated by AutoCAD for each document when 15 | ' a command is called by the user the first time in the context 16 | ' of a given document. In other words, non static data in this class 17 | ' is implicitly per-document! 18 | Public Class MyCommands 19 | 20 | ' The CommandMethod attribute can be applied to any public member 21 | ' function of any public class. 22 | ' The function should take no arguments and return nothing. 23 | ' If the method is an instance member then the enclosing class is 24 | ' instantiated for each document. If the member is a static member then 25 | ' the enclosing class is NOT instantiated. 26 | ' 27 | ' NOTE: CommandMethod has overloads where you can provide helpid and 28 | ' context menu. 29 | 30 | ' Modal Command with localized name 31 | ' AutoCAD will search for a resource string with Id "MyCommandLocal" in the 32 | ' same namespace as this command class. 33 | ' If a resource string is not found, then the string "MyLocalCommand" is used 34 | ' as the localized command name. 35 | ' To view/edit the resx file defining the resource strings for this command, 36 | ' * click the 'Show All Files' button in the Solution Explorer; 37 | ' * expand the tree node for myCommands.vb; 38 | ' * and double click on myCommands.resx 39 | 40 | Public Sub MyCommand() ' This method can have any name 41 | ' Put your command code here 42 | End Sub 43 | 44 | ' Modal Command with pickfirst selection 45 | 46 | Public Sub MyPickFirst() ' This method can have any name 47 | Dim result As PromptSelectionResult = Application.DocumentManager.MdiActiveDocument.Editor.GetSelection() 48 | If (result.Status = PromptStatus.OK) Then 49 | ' There are selected entities 50 | ' Put your command using pickfirst set code here 51 | Else 52 | ' There are no selected entities 53 | ' Put your command code here 54 | End If 55 | End Sub 56 | 57 | ' Application Session Command with localized name 58 | 59 | Public Sub MySessionCmd() ' This method can have any name 60 | ' Put your command code here 61 | End Sub 62 | 63 | ' LispFunction is similar to CommandMethod but it creates a lisp 64 | ' callable function. Many return types are supported not just string 65 | ' or integer. 66 | 67 | Public Function MyLispFunction(ByVal args As ResultBuffer) ' This method can have any name 68 | ' Put your command code here 69 | 70 | ' Return a value to the AutoCAD Lisp Interpreter 71 | Return 1 72 | End Function 73 | 74 | End Class 75 | 76 | End Namespace 77 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/Icons/__TemplateIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ADN-DevTech/AutoCAD-Net-Wizards/2b5b081af0794da28f813991510c5c977fa30554/AutoCAD-Plugin-Template/Icons/__TemplateIcon.ico -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/PluginVsix/PluginVsix.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 17.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | true 9 | bin\x64\Debug\ 10 | DEBUG;TRACE 11 | full 12 | x64 13 | 7.3 14 | prompt 15 | 16 | 17 | bin\x64\Release\ 18 | TRACE 19 | true 20 | pdbonly 21 | x64 22 | 7.3 23 | prompt 24 | 25 | 26 | 27 | Debug 28 | AnyCPU 29 | 2.0 30 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 31 | {58B2EBCB-97A7-42B4-9168-88C51B574896} 32 | Library 33 | Properties 34 | PluginVsix 35 | PluginVsix 36 | v4.7.2 37 | false 38 | false 39 | false 40 | false 41 | false 42 | false 43 | Program 44 | $(DevEnvDir)devenv.exe 45 | /rootsuffix Exp 46 | 47 | 48 | true 49 | full 50 | false 51 | bin\Debug\ 52 | DEBUG;TRACE 53 | prompt 54 | 4 55 | 56 | 57 | pdbonly 58 | true 59 | bin\Release\ 60 | TRACE 61 | prompt 62 | 4 63 | 64 | 65 | 66 | 67 | 68 | 69 | Always 70 | true 71 | 72 | 73 | Always 74 | true 75 | 76 | 77 | Designer 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | Always 87 | true 88 | 89 | 90 | 91 | 92 | 99 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/PluginVsix/ProjectTemplates/AutoCAD 2025 Plugin CS.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ADN-DevTech/AutoCAD-Net-Wizards/2b5b081af0794da28f813991510c5c977fa30554/AutoCAD-Plugin-Template/PluginVsix/ProjectTemplates/AutoCAD 2025 Plugin CS.zip -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/PluginVsix/ProjectTemplates/AutoCAD 2025 Plugin VB.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ADN-DevTech/AutoCAD-Net-Wizards/2b5b081af0794da28f813991510c5c977fa30554/AutoCAD-Plugin-Template/PluginVsix/ProjectTemplates/AutoCAD 2025 Plugin VB.zip -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/PluginVsix/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PluginVsix")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PluginVsix")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Version information for an assembly consists of the following four values: 23 | // 24 | // Major Version 25 | // Minor Version 26 | // Build Number 27 | // Revision 28 | // 29 | // You can specify all the values or you can default the Build and Revision Numbers 30 | // by using the '*' as shown below: 31 | // [assembly: AssemblyVersion("1.0.*")] 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/PluginVsix/__TemplateIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ADN-DevTech/AutoCAD-Net-Wizards/2b5b081af0794da28f813991510c5c977fa30554/AutoCAD-Plugin-Template/PluginVsix/__TemplateIcon.ico -------------------------------------------------------------------------------- /AutoCAD-Plugin-Template/PluginVsix/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AutoCAD 2025 Template 6 | AutoCAD 2025 Project Template for NET 8.0 7 | __TemplateIcon.ico 8 | C#, CSharp, AutoCAD, VB., .NET8.0 9 | 10 | 11 | 12 | amd64 13 | 14 | 15 | amd64 16 | 17 | 18 | amd64 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Autodesk, Inc. All rights reserved 2 | 3 | AutoCAD .Net Wizards for Visual Studio 4 | by Cyrille Fauvel - Autodesk Developer Network (ADN) 5 | 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | this software and associated documentation files (the "Software"), to deal in 9 | the Software without restriction, including without limitation the rights to 10 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | the Software, and to permit persons to whom the Software is furnished to do so, 12 | subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AutoCAD .NET Wizards 2 | 3 | - Modern wizards for .NET Core projects 4 | 5 | - This tool uses VSIX technology to install a VS Template on Visual Studio. 6 | 7 | - All command-line instructions should run on the[ Visual Studio Developer Command Prompt.]([Command-line shells & prompt for developers - Visual Studio (Windows) | Microsoft Learn](https://learn.microsoft.com/en-us/visualstudio/ide/reference/command-prompt-powershell?view=vs-2022)) 8 | 9 | ## Steps To Build 10 | 11 | ```bash 12 | git clone https://github.com/ADN-DevTech/AutoCAD-Net-Wizards.git 13 | cd AutoCAD-Net-Wizards\AutoCAD-Plugin-Template 14 | devenv AutoCAD-Plugin.sln 15 | msbuild PluginVsix\PluginVsix.csproj /t:build /p:Configuration=Release;Platform=x64 16 | ``` 17 | 18 | - To create template packs for both C# and VB 19 | 20 | - Set `ExamplePlugin` as `Start Up Project`. 21 | 22 | - From Menubar->Project->Export Template 23 | 24 | - Repeat same for `ExamplePluginVB` 25 | 26 | ![ExportTemplate](https://github.com/ADN-DevTech/AutoCAD-Net-Wizards/assets/6602398/847a729e-f3b6-4a42-b230-5327381fe3e0) 27 | 28 | ## Steps To Install 29 | 30 | - Download and unpack https://github.com/ADN-DevTech/AutoCAD-Net-Wizards/releases/download/v2025/PluginVsix.zip 31 | 32 | - Double Click PluginVsix.vsix 33 | 34 | ![VsixInstall-1](https://github.com/ADN-DevTech/AutoCAD-Net-Wizards/assets/6602398/3c40eeed-ab2e-4e3b-afa4-17a4e7ae1211) 35 | 36 | ![VsixInstall-2](https://github.com/ADN-DevTech/AutoCAD-Net-Wizards/assets/6602398/94618cfd-40a1-4580-9b90-3971ee4702c2) 37 | 38 | ![AutoCAD-Wizard](https://github.com/ADN-DevTech/AutoCAD-Net-Wizards/assets/6602398/dc1a3cee-4519-4d05-8d0f-9561c19b166e) 39 | 40 | ### Tips 41 | 42 | - After creating the project from the template pack, edit `launchSettings.json` to change the executable path to acad.exe. 43 | 44 | - **Wizard template fetches** the AutoCAD NuGet package from the Microsoft NuGet Server. 45 | - **The template project will resolve to the local NuGet package** if it already exists at `%USERPROFILE%\.nuget`. 46 | - **To add the ObjectARX SDK or Civil SDK from a local file disk, edit the project file (.csproj).** 47 | - Add `D:\Arx2025\inc\;$(AssemblySearchPaths)`. 48 | 49 | - Select the project from solution explorer and right click. 50 | 51 | ![EdiProjectFile](https://github.com/ADN-DevTech/AutoCAD-Net-Wizards/assets/6602398/77fc0b17-f914-4d36-8f53-a6b788bab670) 52 | 53 | - A typical .NET plugin project to accomodate AutoCAD, ACA, C3D etc. 54 | 55 | ```xml 56 | 57 | 58 | net8.0-windows 59 | x64 60 | Library 61 | Example 62 | false 63 | 64 | 65 | 66 | D:\ArxSDKs\arx2025 67 | 68 | D:\ACAD\venn\AutoCAD 2025 69 | $(AcadDir) 70 | $(AcadDir)\ACA\ 71 | $(AcadDir)\C3D\ 72 | $(ArxSdk)\inc\;$(OMFMgdPath);$(AeccMgdPath);$(AssemblySearchPaths) 73 | 74 | 75 | bin\x64\Debug\ 76 | MinimumRecommendedRules.ruleset 77 | 78 | 79 | bin\x64\Release\ 80 | MinimumRecommendedRules.ruleset 81 | 82 | 83 | false 84 | false 85 | 86 | 87 | 88 | 89 | 90 | 91 | 4945;%(DisableSpecificWarnings) 92 | 93 | 94 | 95 | 96 | False 97 | $(ArxMgdPath)\acdbmgd.dll 98 | False 99 | 100 | 101 | False 102 | $(ArxMgdPath)\acmgd.dll 103 | False 104 | 105 | 106 | False 107 | $(ArxMgdPath)\accoremgd.dll 108 | False 109 | 110 | 111 | False 112 | $(OMFMgdPath)\AecBaseMgd.dll 113 | False 114 | 115 | 116 | False 117 | $(AeccMgdPath)\AeccDbMgd.dll 118 | False 119 | 120 | 121 | 122 | 123 | 124 | ``` 125 | 126 | - launchSettings for various profiles 127 | 128 | ```json 129 | { 130 | "profiles": { 131 | "Example": { 132 | "commandName": "Project" 133 | }, 134 | "Acad": { 135 | "commandName": "Executable", 136 | "executablePath": "$(AcadDir)\\acad.exe" 137 | }, 138 | "C3D-Metric": { 139 | "commandName": "Executable", 140 | "executablePath": "$(AcadDir)\\acad.exe", 141 | "commandLineArgs": " /ld \"$(AcadDir)\\AecBase.dbx\" /p \"<>\" /product C3D /language en-US" 142 | }, 143 | "C3D-Imperial": { 144 | "commandName": "Executable", 145 | "executablePath": "$(AcadDir)\\acad.exe", 146 | "commandLineArgs": " /ld \"$(AcadDir)\\AecBase.dbx\" /p \"<>\" /product C3D /language en-US" 147 | } 148 | } 149 | } 150 | ``` 151 | 152 | ### Uninstall Plugin VSIX 153 | 154 | - Through CLI 155 | 156 | ```bash 157 | vsixinstaller /u:AutoCAD2025_07DA9910-9E94-471B-BD32-565D05D4D857 158 | ``` 159 | 160 | - Through UI 161 | ![Uninstall-VSIX](https://github.com/ADN-DevTech/AutoCAD-Net-Wizards/assets/6602398/6762e962-062d-4209-aa31-3f8b07140a9a) 162 | 163 | 164 | 165 | ### Written By 166 | 167 | - Madhukar Moogala , Autodesk Platform Services (@galakar) 168 | --------------------------------------------------------------------------------