Nietmachine – Professionelle Kwaliteit

This might be the most absurd blog title – but for lack of any better idea – that’s the title. And here is what a Nietmachine looks like (for all our non-Dutch speakers)

1347816843_nietmachines-rapid-k1-10510601

So – but That is not what we want to covey today, let’s go to Dynamo…

So there is the issue to build up a Revit topography based on a DWG:

Noname

So – the DWG is strictly 2D but has height values as text elements referenced to points.

Creative thinking – let’s get the text insert point, read the value and treat it like an integer and construct a point in space by insertpoint x/y  and  value z.

What do we need – a DWG reduced to the the text entities. And I don’t care about the slight offset of the text insert point to the nearby point (which I could take into consideration since it is a static offset vector)

Noname

Take it into Revit:

Noname

Flyshit – but the point is:

Noname

Editable text… now we take Dynamo:

Capture

What happens here – we take all text note elements, extract x/y coordinate – take the text string, convert it to a value and construct a point in space. And the slab a topo onto it.

Done:

Noname

Text to Topo – the only hurdle was to get the x/y coordinates of a text note but I found and reused some python code:

Noname

And if you don’t like to type – here:

# Importing the ‘Common Language Runtime’ library
import clr
# Adding specific references: The Revit API
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
clr.AddReference(‘RevitNodes’)
import Revit
# Importing specific extension methods that allow us to gain
# information such as ‘Coord’ data
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
# Creating an empty list that we populate later
OUT = []
# Running a ‘for loop’ over everything inside our input list
# by Unwrapping them (Which is requried between Revit and Dynamo
# objects
for item in UnwrapElement(IN[0]):
# For our ‘for loop’ to work, we need to indent as Python is
# very particular about indentation. We simply then ‘nest’ in
# our line of code an appendation of each ‘looped’ item into
# our previously created empty list. We then ‘cast’ the data
# to a Point (Which dynamo can read)
OUT.append(item.Coord.ToPoint())
# Natively, Dynamo understands that the OUT is our output, so
# pushes this data through the node out port

Life is good…

Advertisements

Author: LRCZ

Platform for multiple talents

2 thoughts on “Nietmachine – Professionelle Kwaliteit”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s