How to add TIN surface boundaries

Hello everyone

I am new to dynamo, I wonder if there is a way to add tin Surface boundaries, to an existing surface.
This is how it looks like and how i need it from dynamo skript:

Thanks in advance

See this

1 Like

Hi hosneyalaa

Thank you for your answer, but this is not, what i am looking for.
I need a use case, where my input is existing surface and 2D-polylines.
With dynamo i need to cut out the holes in surface.
So my first step was to add 2D-polylines as breaklines (it works), and next step should be add boundaries (boundary type: hide), but i can’t find node, where it would be possible.

I’m guessing you want

Read this

Because I’m on vacation I can’t help you well but you need Make a new python script
And add borders through the link

Convert picture to python script

It looks like, it should be the right way, but to be honest, i never did anything in python.

Hi @anton.opanasenko,

Here’s a Python script for you to try. I did it quickly and did not do extensive testing, so use at your own risk.

IN[0] = surface
IN[1] = boundary elements (e.g. Polylines)
IN[2] = mid-ordinate distance for curves
IN[3] = boundary type as a string, can be “Show”, “Hide”, “Outer”, or “DataClip”
IN[4] = boolean for whether to use non-destructive breaklines or not


import System
import clr


from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *

from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *
from Autodesk.Civil import *

adoc = Application.DocumentManager.MdiActiveDocument

def AddSurfaceBoundaries(surface, boundaries, midOrdinateDistance, boundaryType, useNonDestructiveBreakline):
	global adoc
	if not isinstance(boundaries, list):
		boundaries = [boundaries]
	with adoc.LockDocument():
	    with adoc.Database as db:
	        with db.TransactionManager.StartTransaction() as t:
	            surfId = surface.InternalObjectId
	            surf = surfId.GetObject(OpenMode.ForWrite)
	            surfBoundaries = surf.BoundariesDefinition
	            # Create collection of boundary entity IDs
	            boundaryEntities = ObjectIdCollection()
	            for object in boundaries:
	            # Parse enumeration
	            boundaryType = System.Enum.Parse(SurfaceBoundaryType, boundaryType)
	            # Add boundary entities to surface boundary collection
	            surfBoundaries.AddBoundaries(boundaryEntities, midOrdinateDistance, boundaryType, useNonDestructiveBreakline)
	return surface

OUT = AddSurfaceBoundaries(IN[0], IN[1], IN[2], IN[3], IN[4])

1 Like

@mzjensen thanks

Hi @mzjensen

I testes it a little bit more, and it works pretty well.

Thanks a lot