martedì, agosto 12, 2014

Dynamo - 3 points Adaptive Component

Today I was emailing with HyunWoo Kim of Enjoy Revit about a possible workflow involving adaptive components.
I made this quick Dynamo exercise on multiple elements selection and a specific 3 points adaptive component.
The 1st and the 2nd point of the family are attached to the ends of the curve while the 3rd is attached to the mid point. The tricky part was to get Dynamo understand the corresponding parameter for the mid point, infact if you insert in the list the value "0.5" directly it returns an error because somehow 5 is passed instead.
But if you use this simple formula c=(a+b)/2, everything seems to work properly.
It also works on curves in a linked DWG.
Here you can find the definition.


The error with 0.5 is no longer an issue since I changed the Operating System settings of the decimal separator for numbers changing them from comma to point.
In order to change it you have to go to Control Panel and click for the location settings, then customize the formats for numbers specifing a point instead of a comma as decimal separator.
Thanks to Colin McCrone and a reader who actually gave me this tip in the comments below.

2 commenti:

  1. Anonimo9:25 PM

    Try using 0,5 with a ",". Or update regional settings in OS.

    1. Unfortunately using the comma returns an error in the code block, I had to change the settings of the Operating System to make it work properly, so thanks for the suggestion.