How to add TIN surface boundaries

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

@mzjensen thanks

Hi @mzjensen

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

This script works for me, thanks mzjensen for yet another solution. Can you add this to Camber?

I’ll add it to the list. No guarantees on timeline.