Create Object ID Collection

The AddBoundaries method for civil 3d surfaces requires an object ID collection of the polyline boundaries. How can I create an object id collection in python. In my case, there will only be 1 polyline in this collection.

I’m using this example as a guide.
http://help.autodesk.com/view/CIV3D/2020/ENU/?guid=GUID-7C32E309-9B54-42A0-A4DC-C6FD592071F2

coll = ObjectIdCollection()
coll.Add(plineId)

What is the correct way to feed in the boundary type? I did what the Developer’s Guide example has, but it did not work.

g)

try just Autodesk.Civil.SurfaceBoundaryType.Outer

EDIT: what are the import statements at the top of your file?

Hi @keith.sowinski

please drop here your complete code, it will help others who is trying to help and give you solution.

import clr

# Add Assemblies for AutoCAD and Civil 3D APIs
clr.AddReference('acmgd')
clr.AddReference('acdbmgd')
clr.AddReference('accoremgd')
clr.AddReference('AecBaseMgd')
clr.AddReference('AecPropDataMgd')
clr.AddReference('AeccDbMgd')
clr.AddReference('AeccPressurePipesMgd')
clr.AddReference('acdbmgdbrep')
clr.AddReference('System.Windows.Forms')
clr.AddReference('Civil3DNodes')
clr.AddReference('AutoCADNodes')

# Add standard Python references
import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import os
import math

# Add references to manage arrays, collections and interact with the user
from System import *
from System.IO import *
from System.Collections.Specialized import *
from System.Windows.Forms import MessageBox

# Create an alias to the Autodesk.AutoCAD.ApplicationServices.Application class
import Autodesk.AutoCAD.ApplicationServices.Application as acapp

# 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 *

# Import references for Civil 3D
from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *

# Import references for Dynamo for Civil 3D
from Autodesk.Civil.DynamoNodes import Surface as DynSurface
from Autodesk.Civil.DynamoNodes.Selection import SurfaceByName
from Autodesk.AutoCAD.DynamoNodes import Document as DynDocument

I got it to work by adding

from Autodesk.Civil import *
2 Likes

but without “Land”, correct?

Correct.

So, I ended up with:

surface.BoundariesDefinition.AddBoundaries(col, 100, SurfaceBoundaryType.Outer, True)
2 Likes