domenica, maggio 14, 2017

Set multiple parameters at once with Dynamo

It is common practice  using Dynamo to get and set objects parameters from Revit, I'd say this is one of the best features in Dynamo actually, something that empowers all the stakeholders in a workflow to communicate information and data seamlessly using the Revit model as an aggregator. What good is the BIM if we still have to populate the "I" manually, right?

It's also true that if you don't have Dynamo principles clear in mind, graphs tend to be messy, let's say not too elegant. There are even subtle mistakes that could actually prevent the graphs from executing correctly.

In the image above the example on the left is wrong, and as a matter of fact crashes Dynamo because there are two parallel branches in the graph that modify the same element on the same parameter. What should be the result in this case, value 1 or value 2? There is no good answer actually. On the right instead a sample of how it is supposed to happen from a graph flow point of view. It doesn't make much sense to change the same parameter but it's something that could potentially happen and it is better to avoid.

So in case of multiple parameters I very often see long chains of Set Parameter By Name nodes, one after the other, big space on the graph calling over and over the same function. It's working I know but the graph is not very concise.

Let's elements a collection of #n Revit elements, let's parameters a list of parameters names that these elements share, finally let's values a list of values with the following structure organized in a list of lists: each item of the main list is made of the values.

Now if you run this graph the result is not what one would expect.
Not all the elements are taken into consideration, the parameters are not set correctly because the replication calculations here are not helping. Changing lacing on the node won't affect the result in the way one would want in this case. There is need either for a new data structure that could cope with the difference in the rank on the input or for replication guides to force the execution of the Set Parameter Value By Name with a function.

Dynamo nodes

The Set By Parameter Name takes input of rank 0 (single values) but the elements and the parameters have rank 1 and the values rank 2. By default, the elements of the input that are occupying the same index position are combined together in the node function. In this example:

  • the first element
  • the first parameter name
  • the first LIST of values
The first element is combined with multiple values over and over for the same parameter and it ends with the last value of the list. Sounds familiar? it's the same thing happening in the green group of the first image, definitely not ideal and, more importantly, wrong.

It is possible to introduce a list with rank 2 for the parameters, List of  repeated items, the same amount as the elements, rearrange the values with a Transpose to have the same amount of sub lists (this won't change the rank but only how the data is structured). The following graph will now work as intended.

Replication guides

Remember that each node in Dynamo is a function that can be recalled in its literal form (e.g. try Node to Code).
In DesignScript it is possible to drive the replication calculations and force how the functions handle the input. The replication guides are defined with one or more "< n >" after the name of an argument in a Code Block. It's like writing a series of nested for loops in Python, the lowest numbers come first.

In this case it would be something similar to:

for p, v in parameters, values: # Level 1
    for e, vi in elements, v: # Level 2
        e.SetParameterByName(p, vi)

Which in replication guides terms translates as follows.
The final output from the two methods is different but they are only one Transpose away.
This is something I recommend to start to use in your graphs to keep them tidy and use DesignScript at its full capabilities.

mercoledì, febbraio 08, 2017

Finding Nodes in the Graph

One of the most annoying things with large Dynamo Graphs is to find a specific node given some properties, like the name for example, and have Dynamo to jump right on top of that node.
This video demonstrates a concept I've been working on using the Dynamo API.
It works using the name of Nodes, Notes and Groups.
The weird thing I couldn't explain is why after the execution one has to click on Zoom Out to center the node... but it's definitely better than nothing!

This also implies the usage of some best practices when creating the graph, renaming is the oldest trick that still makes the difference.

lunedì, novembre 21, 2016


When you look around and the first thing that comes to mind is a cross-product lacing strategy...

venerdì, novembre 18, 2016

Control Splines in Revit with Dynamo help

For those of you who never tried the spline through points tool in the Revit free form environment, here is a little explanation of how it works.

Let's start simple, create two reference points

Select them and click on the tool, what you have in return is a segment attached to these two reference points

Now add a third point and, just to make things a little more interesting, make sure that it is not aligned with the previous two, you could drag it on its Z axis for example
If you select all three reference points and click on spline through points you will get a spline passing through the points, again, a spline, not an arc

You got the idea, very simple indeed, but what if you have a higher number of points? something like this

If you use the tool now this is what you get in return

Not pretty... so here comes Dynamo in rescue.
Through Dynamo it is possible to generate reference points, these objects are more than simple geometry entities, they have a dedicated shelf in Dynamo for Revit, this means that the resulting objects are dynamically associated to the script that generated them.
It is possible to use these points to create other Revit objects and maintain this dynamic relationship with the script.
Assuming that the amount of points is known we could easily generate a straight sequence of points,

and then use this to create a spline through points (yeah I know it looks like a straight line but in reality we have many control points inside)

These splines are defined through the reference points, but what if we used Dynamo to update the reference points location? The splines have to follow, and here is the result

Besides, you can even control the points manually and tweak the forms as you like, save the points coordinates back to Excel, rerun the scripts as long as you need.
Once again Dynamo saved the day.

giovedì, novembre 17, 2016

First Ever Public Revit Roadmap

Link to the original article:

At Autodesk, we know that feedback from you is what makes our products better. Not only do we want to hear your thoughts about what we've released and shipped so far, we also want your feedback on our plans.

While we've always tried to share our product roadmaps, it's not necessarily been easy information to come by.  But times are changing, and we’re excited to have the chance to try something new: we’re sharing our product roadmaps with all of our customers, publicly.

Before we dive into the roadmaps, let’s establish some ground rules: 

  1. We're sharing some of the highlights of our product development roadmap to give you a sense of the general direction Revit is headed. There's a lot more work going on behind the scenes and this roadmap doesn't reflect everything our development teams are working on.
  2. We plan to periodically update the roadmap because it is subject to change. When we can, we'll also share videos that show off some of the work-in-progress software.
  3. Roadmaps are plans, not promises. We're as excited as you to see new functionality make it into the products, but the development, release, and timing of any features or functionality remains at our sole discretion.
  4. These roadmaps should not be used to make purchasing decisions.

To better explain the roadmap, for each discipline, we've grouped our plans by theme:

  • Create: Efficiently create information that captures design intent.
  • Optimize: Optimize designs for best results.
  • Connect: Empower teams by connecting workflows for team-based project delivery.
  • Automate: Boost productivity by automating tasks.
  • Extend: Support the full project lifecycle.
  • Modernize: Create a modern and effortless experience.
  • Strengthen: Build a solid foundation for product reliability and efficiency.

We use disciplines, themes, and colors to keep track of the roadmap details. 

Delivered in Revit 2017.1
Planned (Some features are currently available for testing in Revit Preview)

Next, let’s dive into some of the exciting work happening in the Factory!


“What is Revit Core?” you may ask. Revit Core (often referred to as Platform) is the glue that holds Revit together. It includes technologies and features that are common across disciplines. It is the part of your everyday Revit experience that helps you get your job done.

When we imagine the future of Revit Core, we see a robust toolkit that doesn’t get in your way. The tools you need are there. They do what you want. This leaves you time to focus on creating better designs - time to be an Architect or Engineer, not a software wrangler. We believe that this future is powered through a cloud-connected experience that enables efficient collaboration and massive computational power, and by software that understands you and what you need to get done.

With that in mind, let’s explore some of the functionality that will help us get there.


One of our key goals is to help you be more effective. To boost your productivity, we strive to create increased efficiency of design that is proactive, captures design intent, and eliminates tedious workflows.

To begin, we want to capture design intent in the model. By embedding the logic that you previously had to reapply every time you made a change, we can help you spend more time designing and less time managing changes. Next, we want to help eliminate tedious, repetitive tasks. We do this by providing tools that automate your workflows and simplify painful multi-step processes. Further, we provide our partners with access to Revit data, so they can develop tools to help you get your work done.


The future of making things is a team sport, and we know a large part of your job involves working with other team members.  That often requires sharing data between multiple products, across disciplines, with teams located around the world. We believe BIM’s future lies in connecting project teams together by supporting integrated, accessible BIM data regardless of product. 

At Autodesk, we spend a lot of time figuring out how to optimally connect teams and the products they use. It’s a really challenging problem that’s aggravated by file formats and geometric incompatibilities. We believe the solution to this problem lies in making Revit data more accessible to other products both through improved APIs and direct access to data.

Additionally, we understand the need to reference non-Revit data in your designs. We seek to provide connected workflows that incorporate data from other products in lightweight and project-centric ways.


A big part of our future for Revit is to create an experience that puts you, the customer, first instead of putting you in a position where you need to fight with the software.  We are investing in creating a modern experience that understands who you are, makes the tools you need available when you need them, and allows you to focus on your model instead of dialog boxes.

We are focused on supporting the hardware that you already own, with multi-monitor support and support for high resolution monitors.  We are also investing in how properties of elements are displayed and enabling better contextual access to tools for elements. Further, we are investigating ways to allow you to work better in 3D. 


As we invest in new functionality to extend Revit Core, we cannot lose sight that we must build an infrastructure based on a continuous focus on our customers.  It is therefore essential that we strengthen the core by maintaining an emphasis on creating high-quality solutions that address customer needs.

We are thrilled to add a few top Revit Ideas requests that address gaps in Revit Core to our roadmap. Thank you for sharing your feedback on the Idea Station. Please keep up your submissions, we are listening!


For this part of the roadmap, let’s take a look at the features and functionality we are investigating for architects.  The major focus here is to enable designers to fully model and document their buildings and leverage of the power of true Building Information Management.  Our goal is to give architects the power and flexibility to design the way they want to design and remove software barriers to creativity. 


We want allow architects to focus on the things they care about and at the same time, ensure that they are working in a collaborative way with all project stakeholders.  For architects, connecting with others is about capturing design information and collaborating without having to redo work.  
To start, we are looking at how to connect conceptual designers better into the Design development phase of projects.  This is about allowing modelers to use their tool of choice and not lose information when it is brought into the BIM environment. 

We also are looking at how architects can better collaborate and share design information with civil engineers and surveyors.  We are striving to allow terrain to be accurately shared to ensure that both engineers and architects are working with the “same dirt”.     

In the Create theme for architects, we are working to better allow architects to capture and document their design intent by supporting high detail, complex modeling, and letting architects get started with their models fast.

Starting with stairs and railings to support multi-story stair towers, we are investing in making it easier to model larger buildings. We want to ensure that when changes are made to the height of the building stories in the project, the stairs and railings update in a truly BIM way.  At the same time, designing stairs and railings can be difficult, so we are investing in small usability improvements to make it easier to get your modeling done.

Another aspect of creating that we are investigating is how to make modeling in Revit more immersive and allow you to design within the context of your project.  We are focused on modeling in perspective views so you can better understand the impact of design decisions.


Optimizing a design is a key part of the iterative workflow that architects use throughout the course of a project.  We believe that we can help you by providing better access to simulation and visualization tools so that you can better understand your design and work in a truly iterative way.
To start, in Revit 2017.1 we delivered an integrated experience with Autodesk Insight 360, making it much easier to utilize energy modeling to optimize your designs. Further, we are working on integrating the newest tool for immersive visualization from Autodesk, Autodesk Live.


Let's look at some of the things we are investigating for MEP customers of Revit, Plant 3D, P&ID, and our Fabrication products.
First, a brief introduction:  The Systems Engineering group is made up of several teams that work together to streamline workflows across multiple technologies (the MEP functionality within Revit, AutoCAD P&ID, AutoCAD Plant 3D, CADmep, ESTmep, and CAMduct).  By harnessing the power of the cloud, these interactions can become very transparent.  So while you may be a Revit MEP, Plant 3D, or CAMduct user, behind the scenes you may be using technology from a mix of these products, along with other capabilities that many other teams are developing within Autodesk, like Collaboration for Revit and BIM 360 Docs.


These are modeling activities related to capturing the intent of your design or detailed model.  They can be related to physical elements, like duct and pipe elements, or analytical data, such as energy settings and circuiting.  The information created is used downstream and consumed by activities in the remaining themes.

We’re continuing to refine the fabrication capabilities in Revit to improve its ability to produce construction ready models. Some of the work we have planned in the Connect and Extend themes will improve the processes by which that model is utilized for downstream activities.
We’re also starting to re-focus on analytical data modeling.  So far, our work has focused on improvements for circuit analysis and improvements related to the building energy model.


Optimization is the process of refining your model to create a more efficient system.  This optimization can be related to the energy efficiency of the delivered solution, or efficiency in terms of construction processes. 

Over the years, feedback has indicated that the larger the connected model, the slower the modeling interactions become. To address this, we’re moving to a paradigm where process-intensive computations, such as flow and pressure drop, are computed in the background on additional processors, giving priority to modeling interactions. 

We're also replacing the computation engine with a fluids solver, previously known as Dalton on Autodesk Labs.  This solver provides simulation in addition to analytical capabilities.  While we aren't making direct use of the simulation capabilities yet, we are leveraging the engine to provide more robust analysis.  For example, we’re refining the workflow to incorporate mechanical equipment to be more tailored to their purpose, such as pumps reporting their flow and head requirements, and pressure drop being computed through the entire pipe loop (instead of being divided between supply and return). 


Project data is created using a variety of products, whether it is energy analysis using Insight 360, process diagrams like P&ID, physical model representations like Revit, or isometrics in Plant 3D.  Connecting this data enables project participants to contribute their expertise and allows information to flow more easily, without having to import, export, or re-enter data created by other project stakeholders.

We’re creating the foundation on which engineering data will be shared across project stakeholders.  This will start to enable Revit, P&ID, Insight 360, and related workflows to share information and communicate more transparently.  This isn’t about providing new ways to import and export data. It is about eliminating manual tasks related to data translation.  By connecting the project through cloud-connected experiences, schematics and models can be intelligently connected, information can be easily shared across stakeholders, and data can easily flow through the project lifecycle across a variety of products.


Various project stakeholders use the data authored and optimized during modeling for a variety of downstream tasks, like creating spools for pipe fabrication, outputting CAM data for sheet metal fabrication, creating reports for procurement of material, and tracking project elements.  The Extend theme is all about leveraging the connections to the data created and optimized during the authoring phases of the project, and providing workflows to keep stakeholders apprised of information relevant to them.

One of the first areas we are focusing on is to extend the connected technologies to streamline workflows for generating piping isometrics from detailed fabrication piping models.  Currently, it is possible to export a MAJ file from Revit, open that file in CADmep, write the result out to PCF, open that PCF in Plant 3D, and then generate DWGs that can be printed for the shop for pipe fabrication.  Possible, but not practical.  We plan to streamline this process and provide a workflow to generate isometrics utilizing Autodesk cloud services for document management.  We’re very early in this process, but the feedback has been positive.


This part of the roadmap is focused on structural workflows from Design to Fabrication, supporting the key construction methods for Steel, Reinforced Concrete, and Precast Concrete.

In this space, Revit is considered as a multi-material modeling and documentation authoring environment to capture both Design-intent and Fabrication execution as appropriate.


These are modeling and documentation investments related to capturing the intent of design and providing detailed instruction for further production and construction execution.  The information created is used downstream and consumed by functionalities in the remaining themes. The purpose is to enhance Revit so that it can help in transitioning from traditional 2D CAD documentation tools to BIM-based modeling and documentation authoring. Our goal is to let designers and engineers provide accurate design intent models and give engineers and detailers the ability to develop models to a higher level of fidelity for fabrication and installation purposes. In a nutshell, our investments are focused on making modeling easy.


Optimization is the process of refining a model and making it aligned with several criteria related to quality and completeness, structural analysis, code design and constructability. Our investments in this area are centered around BIM-centric structural analysis and code checks, as well as structural contribution to the generative design and parameter-driven optimization of forms and model configurations. This includes a fabrication level of detail.


We are looking at ways to facilitate project-centric collaboration among structural stakeholders, from the conceptual phase through to detailed design and fabrication. When this focus is combined with the instant connectivity that cloud, social, and mobile technologies provide, successful hand-offs between stakeholders involve integrated model data. As part of the focus on collaboration, we seek to understand and support each stakeholder, recognizing their unique perspectives and concerns, their needs for differing levels of model fidelity, and their review approval processes. By improving structural workflows across products and by consolidating functionality around key platforms to provide a higher level of automation, we are working to streamline the overall process and support more effective collaboration among structural stakeholders.    


Our main goal is to support the full project lifecycle, extending from the office to the shop and the field. That’s why we’re making investments that enable model information consumption for manufacturing and installation. This includes support for paperless design to construction processes, as well as working to make fabrication and installation instruction delivery tasks modern and automated. This will enable broader accessibility to information across the full project lifecycle.


There are a variety of other discussions and work related to connecting workflows from design through to fabrication and beyond.  So, if you don’t see something listed here, it doesn’t mean that it isn’t on our radar.

We’ll post updates periodically, and your feedback helps!  Let us know what you think. If there are specific areas of interest, you can submit requests through Revit Ideas -  

If you would like to provide feedback on these capabilities, we would be happy to involve you in our beta program (Revit Preview).  Reach out to to join Revit Preview.

The Factory

mercoledì, novembre 16, 2016

Dynamo Art

This morning I was writing a little Python to sort points and I think I've exaggerated a bit.
I've started using a  point cloud randomly generated.

Here is the script if you are interested so you can try for yourself.

sabato, ottobre 08, 2016

Temporary Dynamo Panic

Picture this scene in your mind: you are at the customer office, you are about to give the best you have got for the very last day of a so far very successful workshop, you click on the Dynamo icon in Revit 2017 and that's what appear before you:

Computers uh? ok, let's try one more time... nothing, same message, let's try sandbox.. it doesn't even show up, let's reboot... nothing, let's uninstall clean and reinstall... nothing, let's uninstall all the Dynamo versions you could possibly find..., let's upgrade to the latest version... let's try a different version of Revit, 2016, 2015... nothing, nothing, nothing!!!

There must be something on Dynamo Forum that explains how to solve this, right? well guess what.. nothing there. Ok let's ask Google... same as above.

"The file exists", over and over the same message!

What file? What are you talking about? Why are you messing up with me? Why this window does have no title?!?!??

Can you feel that uncomfortable sensation growing inside? and when the workshop is over you think of all the other projects where you absolutely need Dynamo to work as you are running out of options,  plus it is the weekend so you can't really do much about it until Monday.
New laptop, new software, a trip to a holy place to clean of your sins? 

What worked for me was a little quiet time in an aircraft watching "the secret life of Walter Mitty" on the small screen in the empty seat next to mine because the remote in my seat wasn't responding (not a lucky day for devices around me).

I open Revit, I go back to my good old fashion macros and try to find some comfort there where I've never been let down before...and the SDA.exe threw an error! Perfect.
But at least I finally had something to debug, Visual Studio popped up and this is what I read:

So after 24 hours struggling to understand what went wrong with Dynamo it turns out that is this mscorlib.DLL (dirty little lier) that is causing me all the pain!

When I touched the ground again it was easy to lookup for a solution: my TEMP folder was full, way beyond the maximum number of files for which the GetTempFilePath() method in the mscorlib.dll raises the exception that prevented me from launching Dynamo or Visual Studio or the Revit macro environment.

As you might know numbers are infinite, even integer numbers, but in computer science there are many number "flavours" so to speak, and in particular not all the numbers can be represented using a specific flavor.
In other words in computer science I can have a maximum and a minimum value for a given number flavour.

For the TEMP folder the limit is 65535 files, which is the maximum value for a ushort integer (or unsigned 16-bit integer). So I cleaned my TEMP folder (if you don't know where it is just type %TEMP% in the address bar in your Explorer) and everything went back to normal.

I've already asked the good people in the Dynamo development team to introduce a preliminary test when launching the application so that the user can be informed if a cleanup of the TEMP folder is needed (you need the user input on this because you are deleting files at your own risk). Hopefully nobody will have to go through the same panic situation as I did.

You can find more information on Value Types here.

giovedì, settembre 29, 2016

Section View in Revit API / Dynamo

It happend before, I made it to Jeremy Tammik's blog The Building Coder helping a colleague with a Revit API question about sections creation/orientation.

The whole story though started from Dynamo!

I needed to automate the creation of Section Views and what I came up with was to decompose and recreate a CoordinateSystem object to have the section on the right side of the Bounding Box.

Translating what I did in Dynamo nodes into Revit API led me to the solution reported in the blog link.

Knowledge is powerful and you never know where and when a help might come from, I have to say that getting to know and teaching Dynamo to others made a whole lot better "programmer" (I prefer logical thinker) and I'm saying this even if I started my Dynamo journey with an open mind but with no real expectations.
Well, the more you know, the better.

giovedì, settembre 08, 2016

Arc By Three Points returns wrong parameters

I was dealing with Sandbox and found a weird behavior with the angle parameters of an Arc By Three Points in Dynamo.
The Constructor is working fine but the angles are somehow wrong, I tried to use them to create a new arc by center point radius angle and the result did not overlap with the original arc.
I used some extra nodes to retrieve the correct angles using some auxiliary geometry (second image) but it works only in the XY plane.
It should be an easy fix for the Dynamo Team.

lunedì, agosto 22, 2016

Self-Redefinition in DesignScript

I just stumbled upon this interesting fact of the default language block you have in Code Blocks:

It looks kind of weird at first right? you would expect that the result is 1, not 2, if you do the same in a Python script you have right 1:

Note how there is only one output port on the Code Block, this is because the variable in play is called x on both lines, plus the default language block is Associative which means that each assignment is re-executed, some sort of recursion, to update all the variables values.

At first x = 0, on the second line the same variable x is then assigned to an expression x + 1, which returns x = 1, but since 1 is different form 0 it means that the value associated to x has changed so the Associativity kicks in and it re-executes the assignment that yields 1 + 1 = 2   which is totally correct in terms of DesignScript Associative language block context.

There are a couple of options to get the "standard" value 1 out of a Code Block:

Look at the number of output ports on the right side of these Code Blocks, just be thoughtful when you are using DesignScript because you need to know its own rules.

domenica, agosto 07, 2016

GraPHIcal definition of the Golden Section

One of those number deeply embedded in nature, the limit of the ratio of two consecutive members of a Fibonacci sequence, the so called number phi (1,618....) or golden section.
Just for fun, I threw in also the graphical method to extract the square root of a number, can you see it?