Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Autodesk® Revit® Customization for Mere Mortals:

Save Time (and Your Sanity) with Revit Macros


Michael Kilkelly AIA
Principal – Space Command

Join us on Twitter: #AU2013


Work smarter, not harder.

Image Credit: Shutterstock.com


Image credit: Shutterstock.com
Image credit: Shutterstock.com
Image credit: Propickupmag.com
Image credit: Rvbusiness.com
Image credit: Shutterstock.com
Image credit: Shutterstock.com
Revit is your pickup truck.

Image credit: Shutterstock.com


What is Customization?

 Get under the hood of


your software
 Application Programming
Interface
 Microsoft .Net
Framework 4.0

Image credit: Shutterstock.com


What Customization Can Do For You

 Automate repetitive
(and really boring) tasks
 Take advantage of
computer’s speed and
accuracy
 More fun writing a
macro than clicking the
mouse 1000 times
Image credit: Shutterstock.com
What Customization Can Do For You

 Extend the functionality


of the software
 New tools and
processes
 Analysis Framework
 Performance Advisor

Image credit: Shutterstock.com


What Customization Can Do For You

 How much time should


you spend?
 Save more time than
you spend
 Reuse existing macros

Image credit: Xkcd.com


Types of Customization in Revit

 Macros
 External commands
 External applications
 Database applications
The Revit 2014 Software Development Kit

 Download from
www.autodesk.com
 Install on hard drive
 Revit API help file
 Macro samples
Your first macro!
Choose a Programming Language

 Microsoft .Net Framework 4.0


 C#
 VB.Net
 Python
 Ruby
Choose a Programming Language

 History
C#  Based on C and C++
 Pros
 Lots of Revit specific code
samples available
 Cons
 Code not as readable as
other options
 Syntax is terse and case-
sensitive
Choose a Programming Language

 History
VB.Net  Evolved from MS Basic
 Pros
 Code is easier to read and
not as strict as C#
 Cons
 Code is “wordier” than C#.
 Considered not as elegant
as other options
Choose a Programming Language

 History
Python  Created by Giudo van
Rossum in 1991
 Pros
 Lots of general code
samples available
 Great for beginners
 Cons
 Not many Revit specific
code samples available
Choose a Programming Language

 History
Ruby  Created by Yukihiro
Matsumoto in 1995
 Pros
 Lots of general code
samples available
 Easy to learn
 Cons
 Not many Revit specific
code samples available
Converting Code

 Convert code from


one language to
another in
SharpDevelop
 Useful for converting
code samples
 Project > Convert
Learn to Write Code

 Patience
 Persistence
 Trial and error
 Lots of resources
available

Image credit: Shutterstock.com


Learn the Revit API

 It’s a roadmap,
not a narrative
 Namespaces
 Code samples
Troubleshooting Macros

 Debug.Print and the


Output window
 Stepping into macros
 Using breakpoints
 Commenting your code
 Dealing with exceptions

Image credit: Shutterstock.com


Macro Security

 Enable / disable macros


 Macro security options
Your next macros!
Image credit: Shutterstock.com
Additional Resources
 Blogs
 Boost Your Bim - http://boostyourbim.wordpress.com/
 The Building Coder - http://thebuildingcoder.typepad.com/
 Spiderinnet - http://spiderinnet.typepad.com/blog/
 The Proving Ground - http://wiki.theprovingground.org/revit-api

 Online Forums
 Augi - http://forums.augi.com/forumdisplay.php?218-Revit-API

 Online Courses
 Learn to Program the Revit API - https://www.udemy.com/revitapi/

 Books
 Autodesk Revit 2013 Customization with .Net How-to by Don Rudder
www.archsmarter.com
Contact Me

 michael@spacecmd.com
 @MichaelKilkelly
Autodesk is a registered trademark of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries. All other brand names, product names, or trademarks belong to their respective holders. Autodesk reserves the right to alter product and services offerings, and specifications and pricing at any time without notice, and is not responsible for typographical or graphical errors that may appear
in this document. © 2013 Autodesk, Inc. All rights reserved.

You might also like