EP2: Setting up Visual Studio, Revit API References, Choosing .NET Framework

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
and we're back thank you so much I've received a lot of positive responses on my last video I promise to keep this tutorial simple to the point and answering all of your questions about coding with c and the rabit API so we're just about ready to get started with some heavy stuff with some interesting stuff but we still need to complete some installations so I just want to walk you through that that today for those who might be having challenges with the installation the first thing we need to check for is that we have all of our dll files we're going to go into what they are in subsequent videos I'm trying to give you information in bite-sized pieces to get you feeling confident with coding and then we're going to drill down into like the technicalities and what does this mean and what does this do but I found as a self thought programmer myself that if you start getting too bogged down by details too early it's overwhelming it's too much to know so let's start first I promise I'm going to explain everything be patient with me stick with me the website is asking us to have our Revit api.dll and our Revit API .dll installed it's typically located in the Revit program directory if you have an active Revit installation you already have these two files you do not need to do anything in addition I'm going to show you where you can find them navigate to your C drive if this is your personal laptop it should have your name on it go into your program files folder not program files x86 not program data not Autodesk program files inside of program files go into the Autodesk folder and then navigate to your active Revit installation it's very important that you go to the Revit version that you are trying to make a plugin for so if you're trying to build a plugin that you test on rev 2020 or 22 doesn't matter go to that folder and you're going to see a bunch of files the two files they've asked us to be concerned with are the revid API you and the Revit api.dll file and if you scroll down you're going to find them very easily this is the Revit api.dll file and this is the Revit API ui. dll file it's very easy to find them and you don't need to do anything with them for now just confirm that you have them the second thing I'm going to walk you through is how to install visual studio now Visual Studio is an IDE it's an integrated development environment which means it's how you compile your code it's how you go from having lines of text to a program that works now there are several options for visual studio there's Visual Studio the application that most beginner programmers have probably experienced which is Visual Studio code that is not an IDE it is a kind of coding environment that's more friendly for beginner level experimenting with python and so on the IDE is either Community or professional or Enterprise now Community is the only free version and because we like to keep things free and accessible we're going to be working with Visual Studio community so if you search for visual studio on the web it's going to bring up this website make sure you're on Visual Studio community and click on download my download has started it's a simple exe setup file make sure your antivirus is not taking this file away it's free so you don't need any cracks you don't need to disable any fire walls it's a free application you don't need to do anything you just need an active internet connection and to allow the download to run next you're going to navigate to the folder where the file has been downloaded you're going to right click on that file and click on run as administrator sign some license agreements as soon as you are done installing you're going to see this very interesting popup window now this is where you set up visual studio for the first time if you remember in the last video you would remember that I said it's a Net Framework so we want to set up our IDE our coding environment to be NET Framework compatible so we're going to scroll down you can see we have some options here for asp.net no JS if you're a web developer python if you're a newbie developer or you just want to build simple tools to automate your everyday tasks what we want is net desktop development if you're using the latest versions of Visual Studio it should be net desktop development if it's some other form of net development you can pick that if you're using an earlier version of Visual Studio but we really want to be on desktop development because Revit is a desktop application not to be confused with multiplatform app UI development which if you can read the description this is for building Android iOS or Mac apps that's what we want to do so when you click on net development on the right hand side you're going to see a list of optional tools now we want to be on the latest version of net so you can see here it's installing NET Framework 4.7.2 development tools we would also want the 4.8.1 development tools because we want to have the latest tools so that our software runs on the latest build so we're going to select that for now we can ignore everything else don't worry it's very easy to come back to this screen if you forgot to choose all of this and then you click on install and it's going to start installing it's going to take some time to download the files while you wait grab a cup of coffee go get your lunch get yourself relaxed cuz you're about to become a c developer okay and once it's done downloading you should see the option to launch visual studio so click on launch and let's get started at this point you're going to need to create a visual studio account with your email and it's going to try to sign you in with that account if you were asked to create one at the time of downloading you You' be able to sign in with those same credentials the next thing we want to do is to create a new project so there are four options when you start up visual studio for the first time you can clone a repository so if you want to clone a repository for example you found some code online using some of the resources that I've discussed on the channel like the building coder blog for example and you want to just clone that code into your computer so you can build off of that code please please never copy and paste anyone's code ever besides the rules of plagiarism which makes it very illegal to copy someone else's work you can never control how another person's code works for you you can open an existing project or solution so when you create a visual studio project you have a bunch of files that support the coding process the actual file that contains your script the actual file that will contain your main code code is called a solution if you look at my recent files the file format isln those are the solution files the project file is a folder of different files but the one you want to be opening is the solution so you can also open a local folder where you have your files but what we want to do right now is to just create a new project as we've clicked on that we're going to see more options what kind of project are we trying to create is it a console app is it a class library is it uh Windows forms app is it a Windows forms app with a Net Framework you have so many options for us what we want to do is to create a class library that targets the net or net standard if you look below you'll see cop Android Linux macx it's important to know which of the class Li Li you are selecting because if you look just below you can see a Visual Basic version of the class library because we're going to be coding in C what we want is the C Class library and so if you click on that and click on next you are given a chance to name your project the class Library we want to make has to be named without spaces as a general rule guys computer programming does not like spaces you will often see underscores or symbols in between to demarcate between words if you've ever copied a URL which is like google.com for example a domain name sometimes you see this funny looking symbols like percentages or s's or dollar signs that's because computers hate spaces code is unable to interpret spaces so as a general rule do not use spaces some of the more common conventions for naming code are cam case or capitalizing each word in this case I'm going to capitalize each word and I'm going to call it our first Revit plugin if you're an advanced C program or watching these please don't crucify me I know that there are conventions for naming in C I'm teaching people who have no coding experience and I'm trying not to get you bugged down in the very you know find Details we're going to get there we're going to go from not knowing how to code at all to being semi-professional Okay so we've named our first D plugin and I'm going to say next please note the location that the files are being saved to you can change this location I don't need to change them because I'm already familiar with navigating to that folder but when your Solutions are built for the first time that's where they're going to go into that's where you can find the file again if you don't want to find them through Visual Studio you can copy and paste that URL to a sticky note or a notepad on your desktop if you click on next this is a chance to choose which NET Framework you want to work with the one you choose is based on the Revit build typically using the latest. Net Framework will work with the latest version of Revit and using an earlier version of net will work with an earlier version of Revit I'm going to recommend that you download and install the latest version of Revit because that's what I'll be using for this tutorial and we're also going to be selecting The latest. NET Framework which is 8.0 and we click on create it's creating our project and voila we have liftoff guys we are in we are ready to code it's time are you excited I know I sound hyped but trust trust me getting to this point this is where things start to get interesting if you've made it this far you're ready you're invested you can do this I'm selftaught and I've been able to build code that has been globally recognized as you can see that people have been referencing my thesis work where I made a plugin using cop and rid API guys this is exciting I'm very happy you made it this far don't go anywhere stay subscribed in the next video I'm going to be walking you through the visual studio interface so that you're a bit more familiar with what the thing does and then we're going to dive right into building our first ever program thank you for watching see you soon
Info
Channel: The BIM Mentor
Views: 436
Rating: undefined out of 5
Keywords:
Id: FtOU-g89oQw
Channel Id: undefined
Length: 12min 40sec (760 seconds)
Published: Mon Mar 18 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.