Is there a way to add a DEM file to a surface with Dynamo?

As it says in the subject line, I’m looking for a way to add a DEM file to a surface using dynamo. My attempts at using the api documentation to write python code in Dynamo has been…discouraging…and I was hoping a tool already exists or someone could give me some pointers with the code. Any help would be appreciated!

Hi @rpriceAZEG6,

Are you looking to create a grid surface or TIN surface from the DEM?

A TIN surface from the DEM

@mzjensen Any luck with this one?


See this and need some changes

It is recommended to add a data clip boundary first to the Surface before adding one or more DEM files.

1 Like

Never tried to use it before

Thanks for this recommendation

@hosneyalaa You show a screenshot of the SurfaceDefinitionDEMFilesMembers page but I’m having a hard time locating that on the website. Could you post a link to that page?

1 Like

I’ve attempted to write Python code for this operation but I’ve run into a wall.

I think there is something wrong with the filename. I guess \ must be / or \ in Python. So use:

C:\path to file\filename.tif


C:/path to file/filename.tif

Does that help?

1 Like

I would just use a file path node and then have the path as an input to the Python node. Then you don’t have to worry about typos.

1 Like

Success! Correcting the code with / instead of \ allows my to add a DEM to a surface!

@mzjensen Wanted to leave a special callout to you and your recent episode with office hours. Before watching the class all I could accomplish with the API was crashing C3D. The code above was made using the principles y’all teach in the episode (linked below):


Glad to hear it! Nice work :muscle: