Friday, 11 January 2019

Dynamo IF node

For quite some time I have run into issues with the IF node in Dynamo. It seems to have issues when you are presenting lists of different lengths. To avoid this I have created a little Python script that does the work for me. The python code might not be to pretty but so far it works.

The code >

# Enable Python support and load DesignScript library
# Daniel Gijsbers from Azoros
import clr
from Autodesk.DesignScript.Geometry import *

ToF = IN[0]
List1 = IN[1]
List2 = IN[2]

#Empty list
Result = []

if ToF == "true":

# Assign your output to the OUT variable.
OUT = Result

< End of Code

This Python node produces a nested list. See image at number 1. After doing a bit of research (Googling a bit) I found that Python doesn't seem to have an easy flattening command. Therefore I am flattening the data after the Python node.
The output of this node goes into another Python node that creates worksets.
Credit to John from sixtysecondrevit for that bit of Python Code.

Thursday, 15 November 2018

Dynamo Functions

Being busy with Dynamo there is so much you can spend time on learning. I haven't taken the time to look into functions in Dynamo. Which I regret now, I could have saved myself a lot of time. Tonight I thought let's look into this as I found myself repeating something in Dynamo a lot. I often need to get a vector from a curve's start to endpoint. There are curves being created in dynamo that are straight and for which this function may work. This function of course could create havoc for any none straight curves. These straight curves typically come from PolyCurves, edges from flat surfaces and isolines from flat surfaces.

So after reading the dynamo primer for 1 minute.
A bit of node to code and typing.

  1. Are the original nodes
  2. Is the function I defined at Number 3 in a Code Block
  3. The actual code

In other words this is embarrassingly simple... 

The code: 

/*This is a function for getting a vector from:
a curve start to endpoint*/

def VectorCurveSEPoints(curve1)
point1 = Curve.StartPoint(curve1);
point2 = Curve.EndPoint(curve1);
vector1 = Vector.ByTwoPoints(point1, point2);
return vector1;

Tuesday, 9 October 2018


A good friend of me has a computer which is completely water cooled. His setup is really cool, very quiet and very fast. He knows quite a bit about tweaking performance so we had a go at my machine.

I tend to work on a mobile workstation. I don't call it a laptop because the thing is rather heavy to carry around... He told me that a lot of processors can do with a lot less voltage than what they get by default from the factory. The factory tends to do this for stability and because not every processor is or behaves the same. The disadvantage of the higher voltage is that the temperature of the processor becomes higher. You might think so what. Laptop processors tend to reduce the clock speed once a processor gets to a certain temperature. My processor, Intel i7 8700K (unlocked), throttles  back when it reaches 85º celsius. It tends to go from 4700 mHz to 3700 Mhz. Revit performs better at higher clock speeds of the processor. (Revit is mostly a single threaded application, more cores hardly benefits Revit.) So if I can keep the temperature down than the processor won't throttle back.

So we did a little bit of testing with reducing the amount of volts and the setting the maximum Mhz to see if it would run stable. By default the processor was set to 1300 millevolts. We reduces it to 1085 millevolts and it runs now stable at 4400 Mhz constantly. The bios allows for setting the maximum mHz per core. Next thing I will try is see if I can have one core running at a bit higher clock speed and still stay stable and stay cool. After that setting I just have to test to see if Revit will pick that core that is running at a slightly higher clock speed.

After a bit of tinkering and the inevitable blue screens we found a setting that that gives me, stable,  more performance for Revit and Dynamo.

The two screenshots show the low and the high fluctuations in voltage usage. It Also shows the current clock speed and the temperature of each core.

To test the stability we ran this tool called: Prime from:
This tool uses every available core of your machine to calculate prime numbers.

For a little bit ore detailed info we also used: HWInfo.

In the end we also ran a benchmark that would both stress the video card and the processor to see if the extra heat from the video card would cause any issues. It didn't!

Next thing I have to do is turning of the hyper threading as this tends to also benefit Revit.

So that was a bit of fun tinkering!

Tuesday, 11 September 2018

Levels and Grids

Recently I received an email from Autodesk with Revit tips. One tip caught my eye right away: Turn all Level and Grids off in linked models in your entire project
Although the tip is fine and well explained I must say I do not favour this methode. For many years I tell, and many others, to Revit users, not to use Worksets for visibility purposes.

If you want to turn of Levels in a linked file you can do this with a filter. If the models are properly setup than you can use these parameters to filter upon.
Building Story and Structural are good parameters to use.
So basically you will turn of levels based upon parameter values:
Grids do not have this option, Grids only have few parameters. I tested what happen if would assign levels and grids to a scope box in the host model.  I could only get it to work if the filter setup was: See image below.
If I was filtering for a specif Scopebox name only found in the host model it would not work.(bug???)
What does work but is less elegant:
If you change the name of your levels and grids slightly you can filter on that. (In the example below I added DGi to the name of the levels and grids)
So the filter option might be a bit more tricky to get it to work for you but it when done right you only have to set it once. You don't have to traverse 20 linked files.... 
Put the filter in a view template and you are flying!

Friday, 7 September 2018


Over the summer I have been developing Dynamo scripts based upon the CivilConnection package developed by Paolo Serra from Autodesk. We are helping a customer creating and updating views for a tunnel project. 

  • The alignment is not yet fixed in position. 
  • The tunnel segments need to be modelled in Revit. 
  • The sections and floor plans have to follow the alignment. 
The CivilConnection package allows us to directly read the information from the Civil 3D file and work with that information in Revit. (We read the corridor information and use the baseline.)

In the movie below I test the scripts on a different dataset and it works. When the alignment changes, the views update and all the annotations remain. Below a screengrab movie of the script on a different dataset.

The OTB nodes won't allow us to read the Civil 3D information and the OTB nodes tend to recreate the sections and so loose all the annotations. 

Wednesday, 22 August 2018

Dynamo Scripts

If you develop scripts like me then after a while al lot of nodes are showing their results. (Dynamo < 2.0)
(Image from dynamoprimer)
When it's time to tidy up you might want to close them all and that could become a tedious job when you have a lot of nodes. Since you are automating. Open you script in a text editor like Notepad++ and do a find and replace on: isPinned="true" and change it to isPinned="false" 
For Dynamo 2.0 and higher it seems all you have to do is change this to first open to close:

Next tip: Packages (Dynamo < 2.0)
If you are missing a package and you do not know which one. Do a search on Function=
Quite often you will be able to see which package it is in the text close to function. 
For Dynamo 2.0 and higher Find: ConcreteType
Look for stuff that is not DynamoCore

Tuesday, 27 February 2018



Most of the time I like to write about something that I got to work. This time it's slightly different. So far I don't get this thing to work. I am looking into this node called move by vector. It allows for moving elements in Revit by a vector. The vector can be created using two points. I wanted to experiment with this node after a tweet from Luke Johnson about shared coordinates. we need to change Shared Coordinates.

the reason for wanting to move all these elements is to see if I could fix a file whose shared coordinates have been set up incorrectly. Why do I want to fix a file when there are OTB functionalities for  making things appear they are in the right location? Well, I just want to know what is possible.

I wanted to test to see if I could move all the elements in a file to a new location. A small test on furniture worked just fine. But that are simple point families. I got walls to move as well which is nice as these are line based families. But then the real test came let's try ducts....
So far the only thing I got is a complete mess. I tried to move all the elements that are connected to ducts. The flex ducts do not seem to want to behave. The ducts them self also seem to take directions into their own hand. See below.

The duct fittings don't want to go either. I suspect that it has to do in the order that things get moved. Now I am moving stuff per category. Let's try to move elements per system. Or maybe I am simply expecting to much of this node and is the translation of elements rather complicated.

the script so far that does not want to work.

Let's try one system at the time. The system I want to move is coloured red. To ease selection I use the select model elements node to select all the elements from the same system.

After the translation, and 23 errors I got this. It's seems to me to me that this Element.MoveByVector moves one element at the time and in between tries to maintain all kind of constraints which it obviously can't do.
So far no luck. I'll have a chat with some colleagues first and see if it is possible.

Google+ Badge