Keyboard ALT + g to toggle grid overlay

David Echols

SD11192: Advanced Revit Code Refactoring—C# Language Features and Design Patterns Can Help

(Duration 01:03:01)

  • Save to my AU Saved

Key Learning

Key Learning

  • Learn how to add extension methods to existing Revit API objects to add functionality
  • Learn how to utilize Action class delegates combined with lambda expressions to encapsulate functionality and simplify code
  • Learn how to create LINQ expressions to select and process operations on groups of objects
  • Learn how to use design patterns to separate code responsibilities and provide uniform code interfaces

Description

Description

This class will explain how code based on the Revit software API can be refactored to simplify usage, isolate functionality, and improve maintainability. Class material will cover the use of C# language features and industry best practices to refactor code in Revit software add-ins and supporting library modules. A detailed look will be taken at extension methods, the Action and Func delegate classes, Microsoft LINQ, and design patterns. We will show specific before and after samples of code running in a production add-in. We will explore extension methods to show how you can attach functionality to the responsible object. We will use delegates to encapsulate code, making it less complex and more maintainable. We will demonstrate LINQ by selecting and processing groups of objects. Finally, we will show design patterns that separate command functionality from the user interface.

Target Audience

Target Audience

Advanced developers who want to refactor Revit® code to reduce complexity, isolate functionality and increase maintainability

Speakers

Speakers

David Echols

I began using CADD in 1986 using Prime Medusa. I first started with AutoCAD in 1988 with version 2.6. I have written programs for AutoCAD in Autolisp, C/C++, Visual Basic and .NET. I have been developing add-ins for Revit since Revit 2009 using .NET.

Related Classes

Related Classes

Tags

Published

  • 2015
  • SD11192
  • AU Las Vegas

Software

  • Revit for MEP Engineers
  • Revit for Architects
  • Revit for Structural Engineers

Industry

  • Architecture Services

Topics

  • BIM (Building Information Modeling)
  • Developers
  • CAD Management and IT