The joy of using a pressure cooker..

I admit – i (sometimes these days) like to cook – and the pressure cooke is a childhood memory…

610Gh2-UW6L._SX355_

So – now there is this project that I am not supposed to talk about but it is a pressure cooker of sorts – only bigger and we need to model a perfect structural model for some interesting analysis.

So our pressure cooker looks like this:

untitled.19

And the challenge was to auto-join all walls to the floor plate above to create a clean analytical model:

Noname.png

And that is a 50 second Dynamo – probably the first one I wrote that worked untested – take a look:

Capture

What we do here – first we select the walls and the floor above in Dynamo. We analyze the categories and filter for walls and floors:

Noname

Then we join using lacing longest:

Noname

Element.JoinGeometry is from the Clockwork package.

If you want to go hardcore and not use custom packages – this is the relatively siple Python behind it:

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
from System.Collections.Generic import *
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
items1 = UnwrapElement(IN[0])
items2 = UnwrapElement(IN[1])
i = 0
booleans = list()
TransactionManager.Instance.EnsureInTransaction(doc)
for item1 in items1:
    try:
        JoinGeometryUtils.JoinGeometry(doc,item1,items2[i])
        booleans.append(True)
    except:
        booleans.append(False)
    i += 1
TransactionManager.Instance.TransactionTaskDone()

OUT = booleans

And life is good…

Advertisements

About LRCZ

Platform for multiple talents
This entry was posted in Uncategorized. Bookmark the permalink.

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