Hi @_gile I updated your tutorial for AutoCAD 2023 and Visual Studio 2022. See attached.
For others, this tutorial is based upon one that @_gile created on his website. It is also helpful for learning how to create a new project, since it contains the code for the classes necessary for a plugin to work. After you create your template, you can use it to create your first plugin.
**Updated for 2024.
Solved! Go to Solution.
Solved by Ed.Jobe. Go to Solution.
To @ joshuaW5HNW
(sorry for the tag Ed )
Just curious,
Which AutoCAD build are you using ?
Which AutoCAD builds are installed ?
Which Template ( and from where ) did you use ?
Have you had memory issues ?
Have you had a recent unsucessful windows update ?
Can you run an ACAD session normally ?
Can you load and run a previously build DLL ( that you built ) for that version ?
Can you make a new project without the template ?
// Called Kerry in my other life.
Everything will work just as you expect it to, unless your expectations are incorrect.
class keyThumper<T> : Lazy<T>; another Swamper
- Civil 3d as AutoCAD 2021,
- I have installed: Civil 3D 2021, Civil 3D, 2022, and AutoCAD 2020
- I used the template creation instructions provided here. They used to work fine apart from the
- I haven't noticed any memory issues
- Windows Updates are all installed properly
- I can run AutoCAD outside of Visual Studio normally
- When compiling the project, it successfully compiles. Just it wont successfully open AutoCAD anymore. When I start a separate instance of AutoCAD outside of Visual Studio, i can netload the DLL just fine, and it runs perfectly.
- I can make a new project without the template.
* I restarted my computer and the problem went away. But this is still occurring intermittently. Meaning I can go a day now and the project will refuse to open AutoCAD, and it's only resolved by restarting the computer.
Thanks!
Maybe the fact that the error occurs intermittently is due to the product started (Civil3d or AutoCAD).
You should try to force the start of a specific product. This can be done by modifying the command line arguments either from Visual Studio in the Debug tab; or by directly modifying the StartArguments tag in the .csproj file of the template (see this topic).
<StartArguments>/nologo /product ACAD /b "start.scr"</StartArguments>
Sure, once you create the project in VS, just add code to the project's Commands.cs file for C3D, as shown on page 6, e.g. references and using statements. Then finish creating your template. Since I don't have C3D, I can't tell you what base dll's it loads that you might want to reference. Maybe another user can tell you. You can also get a clue by looking at what gets reported when C3D loads by looking at the command line history F2. Your possible choices would be the files included in the C3D sdk.
Can't find what you're looking for? Ask the community or share your knowledge.