Directory.FromPath if path allready exists?

Hello all,

Probably an easy question…
I have a graph to plot different sizes of sheets in one run to a directory on the C drive.
To automate this i want to make this graph in such a way that it saves to C:\Print folder

I want to do this by just adding the Directory.FromPath node to either create or locate this path.

In test runs this node creates a new folder as desired. When this folder allready exists, nothing happens (no error message)

In short:
Can someone tell me how exactly this node works? Expecially what the node does if the directory allready exists?
Is it save to use the Directory.FromPath node to pass the folder location to the PDF Print node? (So that if a user does not yet have the folder it creates it, and when a user does allready have the folder it just does nothing except pass the directory path to the next node)

image
In this example i have entered a path as a string, when this path doesnt exist the node creates it.
What happens if that folder allready exists?
I get no error message and i cant find anything about it in the Dynamo dictionary.

This node ends up calling this code:

it does indeed create the directory if it doesn’t exist (if it can) this might fail of course.

3 Likes

That clears it up!
Good to see i can safely use this node when the directory allready exists
Thanks Michael! :slight_smile:

2 Likes