I don’t know how to code using python (or much of anything else), but I’m trying to use the python node as a way to create corridor surfaces. I’ve tried to use various sample scripts found on this forum as a guide, but I’m coming up short. Can someone please review my code to get me back on track? It will create a single corridor surface, but there are three remaining issues: CreateCorridorSurface.dyn (6.3 KB)
I cannot get it to create multiple corridor surfaces given a list of names
I’m getting a TypeError: “expected str, got CorridorSurface”
The surface that get’s created is not activated in the Corridor properties.
I resolved all three of these issues, but created a new one. I need the output to be a list of the created surfaces. It’s successfully creating the surfaces, but I get an empty list on the output.
This method demonstrates how to create corridor surfaces from an existing corridor.
:param names: List of corridor surface names to create
:return: A list of corridor surface names
if names is None:
if not isinstance(names, list):
names = [names]
result = 
# Get the active document in the AutoCAD session:
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
# Ask the user to select a corridor to create a new corridor surface from
opt = PromptEntityOptions('\nSelect a Corridor')
opt.SetRejectMessage('\nObject must be Corridor.')
corid = ed.GetEntity(opt).ObjectId
cor = t.GetObject(corid, OpenMode.ForRead)
# Creates a new surface
for n in names:
except Exception() as ex:
OUT = create_corridor_surfaces(IN)