Create cropped surface C3D - Dynamo/ Python

Hello there, I’m trying to develop a Dynamo and Python code to create a cropped surface within the same file as the source surface.
Due to my workflow it’s a waste of time do the same process over and over again (save file, select boundary, select existing/ create new file/ name/ etc). So, I’m developing a Python code based on the C3D 2025 API’s TinSurface.CreateByCropping(Database, String, ObjectId, ObjectIdCollection, Point2d) Method

So far I have written the following Pyhton code:

However, after executing it, Dynamo retrieves the following message:

"Warning: PyhtonEvaluator.Evaluate operation failed.IdentationError : (‘expected an indeted block’,(',35,17,‘src_surface = tr.GetObject (srcSurfaceId)\n’)).

Has anyone tried this before?. Can anyone please help me to troubleshoot this?

1 Like

Try
Add to line 35
ArcSurfaceId.InternalObjectId

with statements need an indent (see python syntax)

Thanks for your answers. I have tried them and modified the code; however, it still doesn’t work. I have also verified the structure based on the guide Python and Civil 3D | Dynamo

Now, it retrieves the following message:
Warning: PyhtonEvaluator.Evaluate operation failed.IdentationError : (‘unindent does not match any outer indentation level; (‘’,45,31,’ t.Commit ()\n’))

Cropped_Surface.dyn (12.7 KB)

¿Any ideas?

CHECK Parameters Method WELL