Grasshopper

algorithmic modeling for Rhino

how to export each path in a different txt file

Dear all,

I have a data component with n path and I'd like to export eact path in a separate file.

For one file I usually use this C# code:

private void RunScript(string file, string data, bool append, bool enable, ref object A)
{
if (!enable)
return;

if (data == null)
return;

if (append)
System.IO.File.AppendAllText(file, data + Environment.NewLine);
else
System.IO.File.WriteAllText(file, data);
}

What I can do for having multiple files?

Thank you

Views: 348

Replies to This Discussion

I solved just using graft in the name of the file, in order to create the same number of file as the number of the path. Automatically, the same C# code can export each path in a different file with a proper name.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service