Topography, sub-regions and building pads

Hello everybody, it’s the first time I create a topic on this forum so sorry if i made something wrong !
I work on Revit to make some constructions plan and 3D views of project. To make that I have developed a Dynamo script to model the topography of ours projects. So now I’m at a point where i want my script make some actions but I don’t know if it’s possible and if yes, how it’s possible because I don’t found the right node in Dynamo. So here are my main problems :

  • Is it possible to generate topographic surfaces in another way than by a cloud of points? (convert a polysurface or mesh into topographies?) Because we do not have the hand on the methods of calculation of the various points of the topography internally in Revit, the calculated triangulations are “at most correct” but remain random and thus distort our calculation/modelling. How to generate a topography other than by a cloud of points ? In Dynamo the only node I found to model topography is « Topography By Points » but we can’t decide the triangulation betwenn the points. Finally « Topography by mesh » doesn’t exist but this is what I research.

  • Is it possible to create a building pad from Dynamo? The manual functionality (in Revit) is simple and I would like to be able to create a building pad from lines, points, or geometrical forms that I have when I run the Dynamo script. How can I do this?

  • Same problem with sub-regions. Is it possible to generate sub-regions from dynamo? How can I do it? For example, I import a cloud of points (to have one topography and I would like to generate automatically some sub-regions (to make roads, parkings, and many other elements) with some points which I identify of with lines…

  • One more thing, it is not about topography but if you can answer too i will be happy. it is possible to mask some elements in a 3D view or in a selected view from Dynamo?

I wish I was clear and if not, I can try to explain better my issues.
Thanks !

Dear Maxime, welcome to the forum. I am not a Dynamo expert, so I can only address the pure Revit API side of things:

Q: generate toposurface:

A quote from the latter: “Developing this application is only possible in Revit 2014 (and later) in which the API library includes constructors for SiteSubRegion and BuildingPadType.”

Q: create building pad:

Yes:

Q: create subregion

Yes:

Q: create masking element?

This I don’t know, cf.:

I would suggest asking and discussing this last question in the Revit API discussion forum, continuing that thread.

Cheers,

Jeremy

Thanks you Jeremy for this informations !
In fact, my issue is to create a topography from Dynamo with modifications of another one. For example, I have a cloud of points gave by a geometer and I convert it in a topography in Revit. After that, in Dynamo I would like to take informations about this topography (points, indices, mesh, …) and change the geometry of this topography. The aim of that is to show the phases of the projects with earthworks, retainements walls and embankements…
Currently, to bypass the problem, I take the topography, i convert it into a polysurface and I apply modifications to this polysurface before creating one independant topography by element and delete the first topography. With this solution, I must create a building pad to mask it and see the modifications if they’re under the first topography.
If I have a solution to convert a polysurface into a topography, I can make all of that in one topography and all my issues will be solved !

For the buildings pads and subregions, I yet see this class in the Revit API but honestly, I’m not really good in Python and I don’t really know how to use this methods in Python to get what I want.

I will asking about masking elements in the Repit API discussion forum, you’re right!
Thakns again for your help !

Thank you for your appreciation.

For the topography, here is another link that might come in very useful:

Cheers,

Jeremy

Check out landform package by Lauren Schmidt. Not sure it has all of your topo stuff in there, but it has a lot.

Sounds like you solved the topo by polysurface, so I will skip that for now.

A brief search turned up some promising looking results if there is nothing there.

This topic’s initial post has some promising looking python for creating the sub-region from a closed loop: Creating a Subregion *then* using it to shape edit a floor

And this post has a good example of creating building pads: Building Pad creating TypeError: expected IList[CurveLoop], got CurveLoop - #2 by Tomasz

I recommend annotating these heavily when you bring them over (ie: literally write down what import clr does) by commenting at the end of each line. This will help you learn rather than keep you reliant on other’s provides code. Just add a # at the end of the line and type up what you want to do.

For the masking region: why not just use a filled region which is solid white? These are more flexible anyway - ie: when you want to make the say green they override, or if you want a crosshatch you can change the pattern. There is a node for that in the core Dynamo for Revit library.

1 Like

Thanks for your answers!
I will try to download this package and test it, I haven’t tried this package.

I already have try to create a python node with this topic but I never had the result. To be honest, each time I tried to run the script with a python node the result was “nul” without problem in the code…
I just tried to write the Tomasz’s code and it’s the same end : nothing happened. Maybe it’s because I don’t work on the same version of Revit than Tomasz ? Im on Revit 2019 with Dynamo 2.0.3.

Yes, use a filled region can be a soluce. I hadn’t thought of that, thanks !

Hello everybody,
I;m back on this topic to share you my project and my problems.
I have been trying for some time to write a python script to make medians from input “curves” but the script does not work.
My inputs are identical to Tomasz’s code but my node result is “null”.
Do you have any idea where the problem comes from? I share you my code :

# Activer la prise en charge de Python et charger la bibliothèque DesignScript
import clr
#Import Revit Services
clr.AddReference ("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
#Import Revit API
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Architecture import *
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *
#Import Revit Node
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
#Import Proto Geometry
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

import System
from System.Collections.Generic import *

#inputs
level = UnwrapElement(IN[0])
padType = UnwrapElement(IN[1])
curves = IN[2]

#necessary ID's
levelId = level.Id
typeId = padType.Id

#creating CurveLoop
loop = CurveLoop()
for c in curves:
	loop.Append(c.ToRevitType())

#get the document
doc = DocumentManager.Instance.CurrentDBDocument

#use safe transaction with Revit
TransactionManager.Instance.EnsureInTransaction(doc)

#creating pad
loops = [loop]
pad = BuildingPad.Create(doc,typeId,levelId,[loops])

#Finish transaction with task done
TransactionManager.Instance.TransactionTaskDone()

OUT = pad

Thanks for your replies

I reply concerning my code. I think I have an issue with my computer because the code works after many try !