Adding trusses to dynamo

Hey guys,

So i’ve been trying to make a script parametrically design a industrial hall made of steel.
Now i’ve got it working (eventually) for a building made form ordinary structural framing.
But i want to add trusses to it too.

Can i do this with the structural truss family, or do i have to sketch it out and using seperate structural framings for all parts?

Structural Trusses are line-based family instances, meaning that for placing them on your project using dynamo, you have to input a location line and a truss family-type (and other info maybe like reference level) to a family instance by line node.

I think im doing something wrong,

But i really cant figure out what…

Could you help me out?

I think you need to use the OOTB node StructuralFraming.BeamByCurve

1 Like

Hello all,

I’m trying the same thing as the topic starter.

But the StructuralFraming.BeamByCurve node doesn’t work.

I tried the FamilyInstance.ByLine from the archilab package,
And the FamilyInstance.ByCurve from the clockwork package.

But in the end it just doesn’t work. Does anyone got a simple explanation?

Hi,

Have you already figured it out?

Apologies for my inaccurate earlier reply. It seems trusses are on their own in terms of element creation.
Please use this code in a python node to create a truss (or trusses). Input 0 needs a LIST of dynamo lines, input 1 needs Truss Family Type. It is assumed that trusses are to be placed on a vertical plane:

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
from Autodesk.Revit.DB import Plane as RevitPlane

DynamoLines = IN[0]
Truss_symbol = UnwrapElement(IN[1])


TransactionManager.Instance.EnsureInTransaction(doc)

rvtLines = [i.ToRevitType() for i in DynamoLines]
elements = []
for i in rvtLines:
	pl = RevitPlane.CreateByThreePoints(i.Evaluate(0,True),i.Evaluate(1,True),i.Evaluate(0,True)+XYZ(0,0,1))
	sp = SketchPlane.Create(doc,pl)
	instance = Truss.Create(doc, Truss_symbol.Id,sp.Id,i)
	elements.append(instance)

TransactionManager.Instance.TransactionTaskDone()

OUT = elements

2 Likes

Thx for your reply.

But when i run de script it gave me an error.

okay my mistake, i forgot the List.Create node. It needs a list of lines.

hi,
How would it be possible to make it working on several trusses at the time?
Thanks