0% found this document useful (0 votes)
45 views45 pages

Brug-10 01

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views45 pages

Brug-10 01

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Autodesk Revit API

How-To and Examples


Jason Grant Harry Mattison
Payette Autodesk

Michael Coviello Jim Kochman


TRO Jung|Brannen KR+H Cabinet Makers
Jason Grant

 BIM Specialist at Payette in Boston, MA.

 Responsible for all aspects of BIM Implementation:


 Training
 Day to Day Support
 Planning
 User Group
 Standards
 Anything they throw at me!

 Blogger – http://jasongrant.squarespace.com
Michael Coviello

 BIM Specialist with TRO Jung|Brannen in Boston, MA

 Responsible for :
 Support with BIM standards
 Project Setup
 Training
 Day to day support of Revit/CAD
 Network deployments
Quick Survey
What is the Revit API?
Avatech Solutions - www.avatech.com CADWERX - www.cadwerx.net
 Avatech’s Utilities for Revit is probably one of the first API examples  RevPac 1.0 is a set of productivity tools with the initial focus on user
many Revit users have seen. These utilities include room renumber, grid interface enhancements.
select, change case, door mark update, Revit City content browser,
space update, earth connection and room phase copy.
CDV Systems, Inc. - www.cdvsystems.com
 CDV Systems put together CodeBook V9 that links a project program
Revit Tools - www.revittools.info and equipment requirements into Revit which is extremely beneficial for
 Dr. Angela German created the following tools: to/from room tags, door healthcare projects.
swing, count elements, manage cad within Revit, update sheet
properties, dwg export, excel export, room/area import, renumber
elements and room parameters to doors. Emc2 Architects -
www.emc2architects.com/revit_tools.html
Tools 4 Revit - www.tools4revit.com  Emc2 Architects created Keynote Manager which allows your keynotes
to be edited through an interface instead of through the text file.
 Tools for Revit has many tools for the structural side of Revit
(Architecture and Structural) as well as a sort & mark tool for elements
and a tool that creates legends from different elements. If framing is Trelligence - www.trelligence.com
something that you use frequently, these tools would definitely help
 Trelligence created Affinity for Revit which brings additional control and
increase productivity.
abilities to architectural programming in the early phases of a project and
the ability to analyze changes to the program in later phases of the
Ideate Explorer - www.ideatexplorer.com project.

 Ideate Explorer provides an easy way to search, quantify and select the
elements within your model or view. BIM jet - www.bimjet.com
 BIM jet is a plug-in tool which allows for the transfer of BIM information
into Microsoft Project.
Revit TV - www.revittv.com
 Revit TV has two utilities: Drawing Manager which allows you to update
sheet information, various exports, drawing issues/revisions and Zach Kron - http://buildz.blogspot.com
parameter mapping. Shared Parameter Manager, currently in beta,  Zach (Autodesk Employee) on his blog shared API created by Harry (API
allows you to update, manage and rename shared parameters. Guru at Autodesk) for use in conceptual massing where there is a direct
relationship between an object and the panels. Zach also built a batch
rendering utility which utilizes the Revit journaling and VB scripts.
StrucSoft Solutions - www.strucsoftsolutions.com
 Wall panelize tool for wood and light gauge metal construction that
recognizes openings and generates stud arrangements within walls.
AVATECH UTILITIES
“LIVE DEMO”
Software Development Kit (SDK)

 Getting Started with the Revit API.doc


 Revit 2010 API Developer Guide.pdf
 Revit API Class Diagram.png
 RevitAPI.chm
 Ribbon design guidelines.pdf
 Autodesk Icon Guidelines.pdf
 Add-In Manager
Install the Software Development Kit (SDK)
PROGRAMMING
LANGUAGE

C# VB.net
PROGRAMMING REQUIREMENTS

 Created in a language compatible with Microsoft .NET


framework 3.5.
 VB.net (Visual Basic) or C# language (Visual C#).
 The decision between these languages is mostly a personal
preference. Most of the samples from the SDK are in C#.
 If you have someone you work with, a friend or a colleague that may
be able to help you with a particular programming language, I would
select that one.
PROGRAMMING SOFTWARE

www.microsoft.com/exPress

www.microsoft.com/exPress

www.icsharpcode.net – Select #develop (SharpDevelop) VSTA within Revit

www.microsoft.com/visualstudio/en-us/default.mspx
REVIT MANAGED DEBUG
( RvtMgdDbg )
“LIVE DEMO”
Start API work
and go from
STRUGGLE
to

SUCCESS
PLAN
your project
WHAT TYPE OF
COMMAND
PROGRAM?

APPLICATION
Predictability and Efficiency

 BENEFICIAL

Not just to you –


but to the project team

Courtesy of Phil Read - HNTB


Predictability and Efficiency

 BENEFICIAL
 EFFICIENT

Implementation and changes


are fast and predictable

Courtesy of Phil Read - HNTB


Predictability and Efficiency

 BENEFICIAL
 EFFICIENT
 ELEGANT

Understood by the team and


any last minutes new members

Courtesy of Phil Read - HNTB


Predictability and Efficiency

 BENEFICIAL
 EFFICIENT
 ELEGANT
 REPETITIVE
Can be used on
many projects

Courtesy of Phil Read - HNTB


Predictability and Efficiency

 BENEFICIAL
 EFFICIENT
 ELEGANT
 REPETITIVE

Courtesy of Phil Read - HNTB


REVIT INI FILE EDIT
“LIVE DEMO”
External Commands

 ECCount=(#Total Commands)
 This line should equal the total number of commands

 ECClassName(# sequentially listed 1,2,3…)=AssemblyName.ClassName


 This is used to provide the name of your command object that supports the IExternalCommand interface.

 ECAssembly(# sequentially listed 1,2,3…)= C:\(Tool Location)\Project.dll


 This is the location of the compiled .dll for use by Revit to run the command. The name of the .dll will match
the name of your project which is the AssemblyName as shown above in the ECClassName. The location can
be anywhere (local or network) as long as Revit can reconcile the location. Performance and access speed
should be considered when deciding on a location.

 ECName(# sequentially listed 1,2,3…)= “ProjectName”


 This name is what appears in the Revit Add-In Panel, External Tools menu.

 ECDescription(# sequentially listed 1,2,3…)= “Extended Project Tool Name”


 This description is displayed in the status bar when you mouse over the menu item.
External Applications

 EACount=(#Total Commands)
 This line should equal the total number of commands

 EAClassName(# sequentially listed 1,2,3…)=AssemblyName.ClassName


 This is used to provide the name of your command object that supports the IExternalCommand
interface.

 EAAssembly(# sequentially listed 1,2,3…)= C:\(Tool Location)\Project.dll


 This is the location of the compiled .dll for use by Revit to run the command. The name of the .dll
will match the name of your project which is the AssemblyName as shown above in the
ECClassName. The location can be anywhere (local or network) as long as Revit can reconcile the
location. Performance and access speed should be considered when deciding on a location.
EXAMPLES
What have we done?
Example 1 – Family Naming Convention

 Purpose: Control family names when multiple people are


generating content.

 Organization by CSI Major Division


DIVISION 01 GENERAL REQUIREMENTS/GENERAL DATA
DIVISION 02 SITE CONSTRUCTION
DIVISION 03 CONCRETE
DIVISION 04 MASONRY
DIVISION 05 METALS
DIVISION 06 WOOD AND PLASTICS
DIVISION 07 THERMAL AND MOISTURE PROTECTION
DIVISION 08 DOORS AND WINDOWS
DIVISION 09 FINISHES
DIVISION 10 SPECIALTIES
DIVISION 11 EQUIPMENT
DIVISION 12 FURNISHINGS
DIVISION 13 SPECIAL CONSTRUCTION
DIVISION 14 CONVEYING SYSTEMS
DIVISION 15 MECHANICAL
DIVISION 16 ELECTRICAL
Example 2 – STC & OpenSavePage

Purpose: Synchronize with Central cancels unless view is on Open/Save Page.


Example 2 – STC & OpenSavePage

This example utilizes C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Autodesk.Revit;
using Autodesk.Revit.Events;

namespace Payette.Revit.SDK
Example 2 – STC & OpenSavePage

{
public class OpenSaveCheck : IExternalApplication

public IExternalApplication.Result
OnShutdown(ControlledApplication application)
{
return IExternalApplication.Result.Succeeded;
}
Example 2 – STC & OpenSavePage
public IExternalApplication.Result OnStartup(ControlledApplication application)
{
try
{
// Registering Events
application.DocumentSynchronizingWithCentral += new EventHandler
<Autodesk.Revit.Events.DocumentSynchronizingWithCentralEventArgs>
(app_SWC);
}
catch (Exception)
{
return IExternalApplication.Result.Failed;
}
return IExternalApplication.Result.Succeeded;
}
Example 2 – STC & OpenSavePage
public void app_SWC(object sender,
DocumentSynchronizingWithCentralEventArgs swcArgs)
{
Document doc = swcArgs.Document;
Autodesk.Revit.Elements.View m_view = doc.ActiveView;

{
if (m_view.Name != "OpenSavePage")
{
//cancel the Synchronize With Central process
swcArgs.Cancel = true;
MessageBox.Show("Synchronize With Central Cancelled -
Activate the OpenSavePage to Synchronize With the Central
Database.");
}
Example – KR+H Cabinet Makers

www.cabinetmakers.com

VIDEO
Example 3 – Door/Wall Fire Rating

 Purpose: Set a doors fire rating based on the hosting walls Fire Rating

 Rule of Thumb for a doors fire rating applies to ~95% of instances


 Based on 2006 International Building Code®

Wall Fire Door Fire Rating


Rating
3 Hour 120 Minute
2 Hour 90 Minute
1 Hour 45 Minute
Smoke 20 Minute
Partition
Example 4
Create Sheets
Purpose: To reduce the time,
frustration and clicks required to
create numerous View Sheets.
Additional API Ideas
 Add Fire Rating Line
 Export Settings
 Revisions on Sheets
 Room Data Sheets (RDBLink)
 All Elements in a Room
 Room/Area Creation
 Timer
 Write Errors to Journal
 Straighten lines off Axis
 Get Room Dimensions
 Reset Mark Values
 Center Room Object Tag
 Levels and Objects
AUGI Wish List 2009
 Advanced Text Editor
 Non-Vertical Walls
 Select All Instances in View
 Custom Elevation Tags
 Print Window Options
 Adjust Material Layer
 Hide Element in All Views
 Tagging Elements in Revit Link
 Photo Backgrounds in Rendering
 Automatic Consultant Sheets
AUGI Wish List 2009
 Advanced Text Editor
 Non-Vertical Walls
 Select All Instances in View
 Custom Elevation Tags
 Print Window Options
 Adjust Material Layer
 Hide Element in All Views
 Tagging Elements in Revit Link
 Photo Backgrounds in Rendering
 Automatic Consultant Sheets
Additional Ideas

 Graphic Revision Schedule


Additional Resources
 Blogs
 The Building Coder by Jeremy Tammik
 http://thebuildingcoder.typepad.com
 Bolt out of the Red by Guy Robinson
 http://redbolts.com/blog/
 CAD Application Development by Matt Mason
 http://cadappdev.blogspot.com/
 Revit Programming by Ed Pitt
 http://revit-programmer.blogspot.com

 Forum
 Autodesk Users Group International – Revit API Forum
 http://forums.augi.com/forumdisplay.php?f=218

I will also be posting information and downloads on the AU site and at


http://jasongrant.squarespace.com/
API FUN
HARRY MATTISON
EXAMPLES
“LIVE DEMO”
Announcements
 Next Meeting
 Mid March

 Topics being Discussed


 Revit 101
 What’s New in 2011
 Revit Templates
 Revit in the Construction Process
 Sharing Models among Consultants

You might also like