is there possible way (script) to automate finding max or min elevation in specific area ( like the circles below) on one surface
Hi
Try
create Civil 3D surface from each region
Then you get lower height
thanks hosneyalaa
but i am looking for automation for this whole operation
or script for creating surface from each region for all regions at once
It’s hard to see exactly what is causing the errors, what do the errors say?
Sorry about that, I was using a new node (PolyCurve.Points) that I think might only be available in the version of Dynamo that ships with Civil 3D 2024.
That node is just getting the points at all the vertices of the polycurves, so it’s easily replicated. A couple options:
- Get the sub-curves within the Polycurve (PolyCurve.Curves) and then get the start/end points of those sub-curves. You’ll then need to filter out the duplicates with Point.PruneDuplicates.
- There’s a node in Camber to get the vertices directly from the polylines instead of doing the work in Dynamo. It’s called Polyline.Vertices.
Checked:
Improved Python Script for Dynamo – Get Min/Max Elevation from Multiple Surfaces ![]()
Versión en Inglés
I’ve modified the script to directly accept TinSurface objects in Civil 3D 2026, allowing it to read the minimum and maximum elevations from two surfaces. The logic can be easily expanded to support a list of surfaces.
Feel free to reach out with any feedback or questions!
Versión en Español
He adaptado el script para que reconozca directamente dos superficies (objetos TinSurface) en Civil 3D 2026 y obtenga automáticamente las elevaciones mĂnima y máxima de esos objetos. Aunque en este caso son dos, puede ampliarse fácilmente para aceptar una lista completa de superficies.
Quedo atento a cualquier comentario o duda.
Mi LinkedIn : https://www.linkedin.com/in/brian-mendoza-márquez-95976a227/
# Load the Python Standard and DesignScript Libraries
import sys
import clr
import math
# Add Assemblies for AutoCAD and Civil3D
clr.AddReference('AcMgd')
clr.AddReference('AcCoreMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AecBaseMgd')
clr.AddReference('AecPropDataMgd')
clr.AddReference('AeccDbMgd')
# Import references from AutoCAD
from Autodesk.AutoCAD.Runtime import *
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.EditorInput import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *
from Autodesk.AutoCAD.Colors import *
from System import Array
# Import references from Civil3D
from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *
# The inputs to this node will be stored as a list in the IN variables.
list_surface_obj = [IN[0], IN[1]] # Ahora IN[0] es la lista de objetos Surface directamente
surveyprecision = 1
adoc = Application.DocumentManager.MdiActiveDocument
cdoc = CivilApplication.ActiveDocument
def get_surface_elevations(list_surface_obj, surveyprecision):
"""
Obtiene la elevaciĂłn mĂnima y máxima de una superficie dada.
:param surface_obj: Objeto de superficie de Civil 3D
:return: Lista con [min_elev, max_elev]
"""
try:
with adoc.LockDocument():
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
list_surfaces = []
# Abrir los objetos de superficies
for surface_obj in list_surface_obj:
surface = t.GetObject(surface_obj.InternalObjectId, OpenMode.ForRead)
list_surfaces.append(surface)
list_elevations = []
for surface in list_surfaces:
# Obtener propiedades generales
gp = surface.GetGeneralProperties()
minel = round(gp.MinimumElevation, surveyprecision)
maxel = round(gp.MaximumElevation, surveyprecision)
list_elevations.append(minel)
list_elevations.append(maxel)
t.Commit()
return {"max_elevation": max(list_elevations),"min_elevation": min(list_elevations) }
except Exception as ex:
return ["Error: " + str(ex)]
# Llamada a la funciĂłn
OUT = get_surface_elevations(list_surface_obj, surveyprecision)
Example Node:




