Hi all,
Revit developers finaly gave us in Revit 2024 an option to work with layered terrain, even with 3D subregions. At first glance it sounds amazing. But after you play with it for a bit you notice that there is a big problem. Subdivision can only folow phase of toposolid. So its unusable. So what now? We can go and split the Toposolid then we can do phasing of different parts as we want … but we can’t merge them, so we can get stuck again.
I was thinking a bit and found a solution. Subdivisions are great for getting the points to morph the topology. So we can can points from subdivision, get boundary lines from subdisivion and based on those create a new Toposolid. This way we can get phasing as we want, we can update the boundaries of subdivision and update Toposolid and we even get “Subdivision” which has layers.
Hope this will help somebody.
You can see the simple version of .dyn, and python script below.
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Architecture import *
import System.Collections.Generic
from System.Collections.Generic import List
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference('RevitServices')
from RevitServices.Transactions import TransactionManager
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
# Get input variables
toposo = UnwrapElement(IN[0])
lvl = UnwrapElement(IN[1])
topotype = UnwrapElement(IN[2])
points = IN[3]
# Place your code below this line
pts = []
for i in points:
pts.append(i.ToRevitType())
skid=toposo.SketchId
skt = doc.GetElement(skid)
skp = skt.Profile
cloop = CurveLoop()
for c in skp:
for cc in c:
cloop.Append(cc)
TransactionManager.Instance.EnsureInTransaction(doc)
loops = [cloop]
topo = Toposolid.Create(doc,loops,pts,topotype.Id,lvl.Id)
TransactionManager.Instance.TransactionTaskDone()
# Assign your output to the OUT variable.
OUT = topo