Grasshopper API
GH_ArchiveWriteToFile Method |
Writes the current tree to a file.
Namespace: GH_IO.Serialization
Assembly: GH_IO (in GH_IO.dll)

public bool WriteToFile( string fileName, bool overwrite, bool rememberPath )
Public Function WriteToFile ( fileName As String, overwrite As Boolean, rememberPath As Boolean ) As Boolean
Parameters
- fileName
- Type: SystemString
Path of file to write to. If the extension is not a recognized Grasshopper extension, an exception will be thrown. - overwrite
- Type: SystemBoolean
True to overwrite file at specified location. - rememberPath
- Type: SystemBoolean
If True, the MRU path field will be updated to reflect the new path.
Return Value
Type: BooleanTrue on succes, false if file already exists and overwrite is set to false.

Exception | Condition |
---|---|
MemberAccessException | Thrown if the root of the current archive hasn't been instantiated yet. |
ArgumentNullException | Thrown if file_name is either null or empty. |
IOException | Thrown if the file_name doesn't represent a known file extension. |
