AUGIWorld

Page 38

PRODUCT FOCUS

Revit 2014 THE REVIT 2014 SDK To get started, you should first install the Revit 2014 SDK. The SDK (software development kit) contains help files and sample code that will assist you as you learn to program macros. The Revit 2014 SDK can be installed from the main page of the Revit installer or it can be downloaded from the Autodesk Developer Network website: http://usa.autodesk.com/adsk/ servlet/index?id=2484975&siteID=123112 . The SDK will install on your hard drive and create the following folders and files. Take some time to review the files. The macro samples in particular are useful when you start creating your own macros. Figure 3: Macro Manager

2. Create a New Module To create a macro, you must first create a new module. A module is simply a collection of macros. Each macro within the module must have a unique name and all the macros within the module must compile without errors.

Figure 1: The SDK folder

YOUR FIRST MACRO! Ready to create your first macro? As you’ll see, the process is very straightforward. Follow these steps and you’ll be on your way to macro mastery.

1. Open the Macro Manager In Revit 2014, create a new project file. Once you have created the file, open the Macro Manager by selecting the Manage ribbon and clicking the Macro Manager icon.

Click the “Project 1” tab then click the Module button in the “Create” section. In the “Create a New Module” dialog box, title your module “MyFirstModule.” Choose VB.Net as the module’s language then click OK to create the module. Once Revit has created the module, SharpDevelop will launch in the background. SharpDevelop is the integrated development environment that’s built into Revit for programming macros.

3. Create a New Macro Now that we have a module, we’ll create a macro to go in the module. Make Revit the active application and click the Macro button in the “Create” section of the Macro Manager dialog. In the Create a New Macro dialog, title your macro “”MyFirstMacro” and set the language to VB.Net. Click OK to create the macro.

Figure 2: The Manage ribbon

Macros can reside either in the active project file or within the application. Macros saved within the project file can be used by any user who opens that file. Macros saved in the application are saved to the user’s Revit configuration. These macros can be used on any model file, but only by the user who created the macro.

Figure 4: Create macro 38

www.augi.com

March 2014


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.