Another day, another challenge – we’re on a quite interesting model right now that we need to get computing in a structural analysis package. The analytical model looks like this:

It looks like a steam cooker and for the sake of the conversation let’s refer to it as a steam cooker. Challenge is that we have some walls in there that we don’t want to have in the analysis package but still we’ll want to have their weight represented as loads in the analytical model.
Turing of the analytical model for those guys – nope. They just fade away.
So the idea is – and stay with us here – this is ongoing – is to analyse all walls with the analytical model being turned off and get their Start-/Endpoints, calculate the load from their volume and generate a line load in the model using Dynamo.
The prototype to this looks like this:

The code in the Python:
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
dataEnteringNode = IN
startPs = IN[0].ToXyz()
endPs = IN[1].ToXyz()
force = IN[2].ToXyz()
moment = IN[3].ToXyz()
LLType = UnwrapElement(IN[4])
plane = IN[5]
TransactionManager.Instance.EnsureInTransaction(doc)
lineloads = LineLoad.Create(doc,startPs,endPs,force,moment,LLType[0],plane)
TransactionManager.Instance.TransactionTaskDone()
OUT = lineloads
And that is not my wisdom, I am referring to other brilliant minds work here.
But we got the picture, next sequel is how to replace the code block with actual values from the model – so stay tuned.
And life is good…