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

@anton.opanasenko
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

http://docs.autodesk.com/CIV3D/2019/ENU/API_Reference_Guide/html/f0f1dedc-bae9-a2ed-a2ce-3aa457181755.htm

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

SurfaceBoundary

import System
import clr

clr.AddReference('AcMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AeccDbMgd')

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:
	            	boundaryEntities.Add(object.InternalObjectId)
	            # Parse enumeration
	            boundaryType = System.Enum.Parse(SurfaceBoundaryType, boundaryType)
	            # Add boundary entities to surface boundary collection
	            surfBoundaries.AddBoundaries(boundaryEntities, midOrdinateDistance, boundaryType, useNonDestructiveBreakline)
	            surf.Rebuild()
	            t.Commit()
	            pass
	return surface

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

1 Like

@zachri.jensen thanks

Hi @zachri.jensen

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

Thanks a lot

this option is very useful to me I am new to python & dynamo so kindly help me with How to load this python script.

I have pasted it directly in python script it is not working in my dynamo for civil3d

hi
The problem is in the word I put “Outer”

Capture

Could you please upload your .dyn file I think I am doing a mistake

How to add TIN surface boundaries test01.dyn (10.3 KB)

error

Could you please upload exp drawing file

Capture
no (3)

Capture0

yes it is working changed 2 to 3 thank you

is there option for volume surface and quantity in dynamo for civil3d