Automation Prototyping: Dynamo & the Revit API

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Advertisements

CP308-1L: Working with Actions and the Action Recorder Lee Ambrosius Autodesk, Inc Sr. Technical Writer.
Working Smarter in Revit with Dynamo
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Tutorial Introduction Fidelity NTSConnect is an innovative Web-based software solution designed for use by customers of Fidelity National Title Insurance.
Understanding the Alignments and Profiles API in AutoCAD® Civil 3D®
Chapter 1 Introduction to Visual Basic Programming and Applications 1 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta.
#SEU12 Madison Miner Software Engineer EDA, Inc..
© 2011 Autodesk Autodesk ® Revit ® MEP Content Creation Lab MP5076-L Ryan Tivis CAD/Model Manager – Ring & DuChateau Dennis Hopper CAD/BIM Manager – GE.
Multi-agent Research Tool (MART) A proposal for MSE project Madhukar Kumar.
Python: An Introduction
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
© 2011 Autodesk SE4186: Getting Productive with Autodesk Revit ® Structure David Bleiman CEO, Rutherford & Chekene.
Leveraging ArcGIS Online Elevation and Hydrology Services
Developing Cross Platform Apps with the ArcGIS Runtime SDK for Qt
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Python: Building Geoprocessing Tools David Wynne, Ghislain Prince.
CIS-NG CASREP Information System Next Generation Shawn Baugh Amy Ramirez Amy Lee Alex Sanin Sam Avanessians.
Special Education Teachers and Speech Language Pathologist Effective Technology Tools By: Beth Fulks, June 23, 2014.
1.Click on the link below, this will open your web browser 2.Use “Extended Display” to project the.
1.Click on the link below, this will open your web browser 2.Use “Extended Display” to project the.
1.Click on the link below, this will open your web browser 2.Use “Extended Display” to project the.
1 Terminal Management System Usage Overview Document Version 1.1.
Presenter: Luke Johnson, What Revit Wants EVENT
The New Generation of CAD Tools
Greenfoot.
Show Me How! - Manage Design Data and Update Assets in GIS
Walk-in Slide: AU 2014 Social Media Feed
Walk-in Slide: AU 2014 Social Media Feed
Walk-in Slide: AU 2014 Social Media Feed
Development Environment
CST 1101 Problem Solving Using Computers
Walk-in Slide: AU 2014 Social Media Feed
Meetoo Tips.
Walk-in Slide: AU 2014 Social Media Feed
Walk-in Slide: AU 2014 Social Media Feed
MA9520 – Crossing the Rubicon: Migrating from AutoCAD to Autodesk Inventor Mark Flayler Senior Application Expert – IMAGINiT Technologies.
Introduction to Eclipse
Walk-in Slide: AU 2014 Social Media Feed
Advance Steel: Automatic generation
Data Virtualization Tutorial: Introduction to SQL Script
PLM, Document and Workflow Management
Introduction to Visual Basic 2008 Programming
Physical Data Model – step-by-step instructions and template
Everything You Need to Know About Autodesk® Revit® Structure View Filters Jared Rodrigues Senior CAD Drafter.
PYTHON: AN INTRODUCTION
Parts.cat.com Client training 2016.
Steering Group Member, Link Digital
Walk-in Slide: AU 2014 Social Media Feed
Walk-in Slide: AU 2014 Social Media Feed
Instructor Name Instructor Title Library Name
Introduction With TimeCard users can tag SharePoint events with information that converts them into time sheets. This way they can report.
Introduction to Computers
Walk-in Slide: AU 2014 Social Media Feed
Computer Programming.
Walk-in Slide: AU 2014 Social Media Feed
Crowd Intelligence Grocery Shopping Mobile App
Teacher Academy Workshops
What's New in eCognition 9
Computational Thinking for KS3
Smart Integration Express
Introduction to AppInventor
How to stop C programming problems at the source
Design Brief.
Delivering great hardware solutions for Windows
MyLion Registration Website | Mobile device
What's New in eCognition 9
What's New in eCognition 9
ArcGIS Online Steps for Success A best practices approach
Presentation transcript:

Automation Prototyping: Dynamo & the Revit API Nuri Miller Technical Manager at Gehry Technologies @nurimiller

Class summary The class will provide a walk-through of a sample project that is automated in the Dynamo visual programming language and also using the Revit software API . This comparison will help you to draw your own conclusions about how Dynamo and/or the Revit API fit into your current practices.

Key learning objectives By the end of this class, you will: Discover how Dynamo’s graphical programming interface compares to the Revit API. Understand Revit’s API functionality in relation to family placement and manipulation. Learn how the mix of both Dynamo and the Revit API may be most beneficial to your current project and practice. Recognize Dynamo as a way for prototyping automation solutions and for sharing existing ones by dispersing their logic for other’s experimentation.

Nuri Miller Technical Manager @ Gehry Technologies I help designers, builders and owners save time and become better informed by integrating their VDC technology ecosystem through custom software solutions. I believe wholeheartedly that AECO can be elevated through technology that takes on the burden of repetitive tasks, bridges the divide between technology platforms, and supports data exploration in building projects.

Floral Street Bridge Example The example for this tutorial was originally developed as an introduction to parametric modeling in Digital Project. It’s loosely based on a footbridge designed by Wilkinson Eyre Architects in London. The project’s twisting form provides a useful vehicle for introducing parametric relationships and how a constraint solver deals with them.

Automated Instantiation With Dynamo

A Few Helpful Hints for Dynamo The search tool is key. Watch your output as you build. Double click to create code. Sweep everything under the rug with custom nodes.

The Dynamo Definition – An Overview

Creating Context Points

Creating Context Points

Creating Context Points

Creating Context Points

Creating Context Points

Creating Context Points

Creating Context Points Right click and choose Cross Product

Creating Context Points …becomes…

Creating Context Points

Adaptive Frame Family

Adaptive Frame Family

Adaptive Frame Family EXISTING

Adaptive Frame Family

Adaptive Glazing Family EXISTING

Adaptive Glazing Family

Adaptive Glazing Family EXISTING

Adaptive Glazing Family

Adaptive Glazing Family

Adaptive Glazing Family EXISTING EXISTING

Adaptive Glazing Family EXISTING EXISTING

Adaptive Glazing Family

Final Dynamo Script

Custom Nodes in Dynamo 29 interconnected nodes …becomes… 14

Custom Nodes in Dynamo

Custom Nodes in Dynamo

Automated Instantiation with Revit’s .Net API

Core Functionality Compared double curveParm = (double)i/numInstances;   pt.Position = curve.GeometryCurve .Evaluate(curveParm, true);

Core Functionality Compared FamilyInstance instance = AdaptiveComponentInstanceUtils .CreateAdaptiveComponentInstance(doc, symbol);   ReferencePoint pt = doc .GetElement(placePointIds[j]) as ReferencePoint; pt.Position = curve.GeometryCurve .Evaluate(curveParm, true);

Core Functionality Compared ParameterMapIterator it =  paramMap.ForwardIterator(); Parameter angleParm = it.Current as Parameter;   angleParm.Set(((angleDegStep*i)+angleDegStart)*degToRad);

Core Functionality Compared if (j < 2) curve = doc.GetElement(curves[j].ElementId) as CurveElement; else { curve = doc.GetElement(curves[j-2].ElementId) as CurveElement; curveParm = (double)(i+1)/numInstances; }

All Functions (Public and Private) public void Main() {…}   private FamilySymbol FindAdaptiveComponent(Document doc, string name) {…} private void DeleteAdaptiveComponent(Document doc, FamilySymbol famSym) {…} private void InstantiateComponents (Document doc, FamilySymbol symbol, IList<Reference> curves) {…}

Main Function Workflow public void Main() { // Get the active document. Document doc = this.ActiveUIDocument.Document; UIDocument uidoc = new UIDocument(doc); 1 Acquire the active document to start pushing and prodding through the API. Dynamo does the same. When starting up it indicates the active document in the console.

Main Function Workflow // Locate Adaptive Components in file. FamilySymbol frame = FindAdaptiveComponent(doc, "FloralStreetFrame"); FamilySymbol glazing = FindAdaptiveComponent(doc, "FloralStreetGlazing"); // Check to see if family symbols were found and throw error message if not. if ((frame == null) || (glazing == null)) { TaskDialog.Show("Error","Could not locate adaptive components in this file."); return; } 2 Call a function to locate the adaptive components for this example. Then throw an error if none are found.

Main Function Workflow FilteredElementCollector col = new FilteredElementCollector(doc);             col.OfCategory(BuiltInCategory.OST_GenericModel)                 .OfClass(typeof(FamilySymbol)); fs.Family.FamilyPlacementType == FamilyPlacementType.Adaptive fs.Name == name 2 A filtered element collector allows for quick searching of the entire model without loading everything into memory.

Main Function Workflow // Delete existing instances of Adaptive Components. DeleteAdaptiveComponent(doc, frame); DeleteAdaptiveComponent(doc, glazing); 3 FamilyInstanceFilter filter = new FamilyInstanceFilter(doc, famSym.Id); ICollection<ElementId> familyInstances = collector .WherePasses(filter).ToElementIds(); doc.Delete(familyInstances); Once the existing components are collected they need to be cleared out to make way for the new instances. This feature is built into Dynamo.

Main Function Workflow // Prompt user to select curves & test that two have been selected. IList<Reference> curves = uidoc.Selection.PickObjects (ObjectType.Element, new CurveElementSelectionFilter(),  "Select two curves"); if (curves.Count != 2) { TaskDialog.Show("Error","Please select exactly two curves."); return; } 4 Error handling is an important part of writing any code. In this case we throw an error if the user doesn’t pick exactly two curves.

Main Function Workflow     public class CurveElementSelectionFilter : ISelectionFilter     {         public bool AllowElement( Element e )         {           return e is CurveElement;         }               public bool AllowReference( Reference r, XYZ p )         {           return true;         }     } 4 We could either allow the user to pick any two objects and then check to see if they are curves after the fact or create a filter to only allow curves to be chosen.

Main Function Workflow // Instantiate the adaptive components. Transaction t = new Transaction (doc, "Place Adaptive Component"); t.Start(); InstantiateComponents(doc, frame, curves); InstantiateComponents(doc, glazing, curves); t.Commit(); 5 Any time a change is made to the Revit model through the API it has to start and end with a transaction.

Main Function Workflow For each instance { Create a new adaptive component in the center of the model space; Set the adaptive component placement points based upon the calculated curve parameter position; Access the “angle” parameter and update; } 5 The pseudocode (human readable code) above summarizes the steps taken to complete the instantiation of the adaptive component.

So what does this mean for you?

It’s all about finding the right mix. Which will you choose? API and or It’s all about finding the right mix.

Automation Prototyping Dynamo can be a place to test ideas quickly and make mistakes with little time invested. Then go build a product from the ground up with more knowledge.

Logic Dispersal Dynamo can also be a platform for sharing functionality developed for larger proprietary solutions. The base logic for a Revit plugin for connecting to Google Spreadsheets can be reorganized as a set of Dynamo nodes.

Challenges that May Affect the Mix Deprecation Debugging Logic Organization & Management Packaging & Sharing User Interface/Experience

Tools to Organize your Logic Custom Nodes Zero Touch

Packaging & Sharing Windows Installer Setup Dynamo Package Manager (Cumbersome and tedious) Dynamo Package Manager (Simple, quick and available anywhere)

Know Your Audience (User Experience) Visual scripts for quick experimentation. (For those who are more technically adventurous.) A designed user interface with the primary inputs. (For those who say, “Just give me a button to push.”)

Thank you! www.nodelete.org/posts/automation-prototyping All the materials are available on the AU website… and www.nodelete.org/posts/automation-prototyping (Please leave any feedback or questions in the comments.)

Via the Survey Stations, email or mobile device Session Feedback Via the Survey Stations, email or mobile device AU 2014 passes given out each day! Best to do it right after the session Instructors see results in real-time We really value your feedback – after a class is completed you will receive an email with a link to complete a class survey… You can respond to that email on your computer, mobile device or via the Survey stations that are all over the place here at AU. The instructors compete for the prestigious Instructor Awards – and we also use your input on classes to determine the classes for next year’s AU. And each day we will give away two free passes to next year’s AU…

FREE access to Autodesk design software & apps. Students, educators, and schools now have FREE access to Autodesk design software & apps. Download at www.autodesk.com/education You heard it from Carl on main stage, Autodesk is now providing free* access to Autodesk design software and apps to students and academic institutions – worldwide. This includes full versions of Autodesk software, same as the professionals. Autodesk believes the next generation will create a better world and wants to inspire a love of design and equip in students of all ages to become engineers, architects, and digital artists. That’s why Autodesk provides free* access to professional Autodesk design software and apps to students and academic institutions.