Join Josh Modglin for an in-depth discussion in this video Create a project using the Autodesk wizard, part of AutoCAD Add-ins Using VB.NET.
- [Instructor] Now that we've gotten an overview of Microsoft Visual Studio. And also gotten our resources and everything that we need downloaded, installed, ready to go. Let's go ahead and create a new project. So for our start page, we're going to start new project. I'm going to choose from our templates. We're going to go to their Visual Basic templates. I'm going to expand and look at some of the subcategories. Notice there is a subcategory named Autodesk. And what we're going to do because we're building for AutoCAD 2018 we're going to change the .NET Framework to 4.6.
And notice right away we have our AutoCAD 2018 VB plugin wizard that we installed for the develop AutoCAD autodesk.com page. And it's ready to go, go ahead and create this. You notice I have this unchecked with create a directory for this solution. We're going to leave the name the same. We'll even put it right here under projects for now. And you can store it wherever you want. We're going to go ahead and put it in our exercise files.
So let's go ahead and do that. On our desktop, of course, we have our exercise files. If you don't have them downloaded already, we can go ahead and create a directory called exercise. And under chapter two here, we're going to create a folder. If that folder's not there select that folder, and then we're going to name it MyFirstPlugin. So we have everything set up, go ahead and click OK. And it will pop open a configurator.
What it's trying to do is it's trying to establish where to find those three files we talked about. And notice these three files are already checked. They're required to build any type of plugin to AutoCAD using the AutoCAD API. There's quite a few other optional, additional interfaces or tools that are malleable, and we can connect to those as well. But where going to focus on these three. All it needs to do is know where they're installed, where they're located.
So we're going to browse to where the ObjectARX page, that STK, that software development kit that we downloaded and installed. It placed it in the C:, Autodesk, and notice the default location there, so I'm going to select that. And we're actually going to go a little bit farther here. Let me browse open, and notice it's got all these other folders underneath. Just choose the INC folder, and click OK.
Now it finds its location. It also needs to know where the AutoCAD executable is because when we run or test our program, it will launch AutoCAD for us. So we're going to find that by browsing. So that'll be in our program files under AutoDesk. And then choose a course, our AutoCAD 2018. It will find it, we can even choose what version of AutoCAD. In other words, if we have vertical products, Civil 3D, or Mac, or AutoCAD Architecture, or any of that.
We can run it as that version, that vertical application. We're going to just run it as straight AutoCAD, and click OK. So the only thing we really said is we chose that we wanted the VB.net plugin. We had to make sure the framework was correct, 4.6. And then the configurator, we just set these two paths. And once we've set it once it remembers it. So I go ahead and click OK. It creates our first plugin project for us.
And what did it create? Well, we can take a look at solution explorer. If you don't have that option there, you can choose to view your solution explorer from the dropdown, it opens up, and here is our first plugin. So what we're going to do is we're going to see a little bit more about what is inside our first plugin, right after we create. And we're going to see what's in our first plugin in our next exercise.
- Creating a project using the Autodesk wizard
- Creating classes, command routines, and functions
- Manually creating projects
- Basic .NET functionality
- Working with database properties
- Working with transactions and TableRecords
- Getting a user-specified point and distance
- Creating and inheriting a base class object
- Creating a window interface