Help with FileSystem.GetDirectoryContents

Hello, I’m a Dynamo beginner looking for some help:

I can’t figure out why the FileSystem.GetDirectoryContents node isn’t working for me when I connect it to the DirectoryPath node. (See diagram Below)

The error message reads:

Warning: FileSystem.GetDirectoryContents expects argument type(s) (DirectoryInfo, string, bool) but was called with (string, string, bool).

It seems that FileSystem.GetDirectoryContents expects a variable (maybe?) as input, but DirectoryPath supplies a string, and therefore it doesn’t work. Can I convert the string to a variable so the node will accept it?

I am using Dynamo Core, Dynamo Revit, with Revit 2019.2

You are feeding a directory path, not a directory. Search your library for ‘directory from path’ and you should see the node which needs to be placed in between.

The Object.Type node can help ID these in the future. :slight_smile:

1 Like

That worked! Thank you very much!

For anyone else, here’s what the final result looked like:

1 Like

hi, what if its

Warning: Roof.ByOutlineTypeAndLevel expects argument type(s) (Curve, RoofType, Level), but was called with (Autodesk.DesignScript.Geometry.Curve, Revit.Elements.Element, Revit.Elements.Level).


thanks in advace