Select the topography created with building pad

Hi Everybody.

I’m trying to select the topography created with building pad for calculate cut and fill. any ideas?
In this moment the quantities are of the past process.

Thanks!

Hi,

This is quite simple with a little bit of Python Code:

GetAssociatedTopo.DYN (4.9 KB)

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

clr.AddReference('System')
clr.AddReference("System.IO")
from System import *
from System.Reflection import *
from System.Collections.Generic import *
from System.IO import *
#Use elemIds = List[ElementId](ids) for ICollection(ElementId)

#Import the Revit Services
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Import the Revit Nodes
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

#Import the Revit API
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

#Import math functions
import math

def tolist(obj1):
    if hasattr(obj1,"__iter__"):
        return obj1
    else:
        return [obj1]
    

#Define Input (IN)
buildingPads = tolist(UnwrapElement(IN[0]))
output = []

# Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

for pad in buildingPads:
    topoId = pad.AssociatedTopographySurfaceId
    topo = doc.GetElement(topoId)
    output.append(topo)

#End Transaction
TransactionManager.Instance.TransactionTaskDone()

#Define Output (OUT)
OUT = output

Thaks my friend, in theory is exctly what i need. But, for some reason, dynamo don’t recognize the quantities in this model

I solve it, with transaction.end node. Thanks my friend

1 Like