Grasshopper

algorithmic modeling for Rhino

Write text document with VB or C# component - URGENT HELP PLEASE

I am trying to write an external text document that i can open up with windows notepad.

I want to be able to adjust parts of the script but generally leaving the whole thing in the same structure (please see attached image).  

The highlighted panel corresponds to the part of the text file that I would like to write with that panel. SO in theory if I changed the green panel to 2.0 there would be a 2.0 in the text document.  

I do not know anything about VB, I just have a basic understanding of programming from using MATLAB in previous years.

I have been told this is quite simple, therefore, all I am hoping is for someone to recommend some commands I should type inside the VB component so i can generate a text document. Also if anyone knows of any tutorials that would be useful for me to look at I would highly appreciate a link or something.

I am also fine if someone would recommend using the C# component to do the same thing instead.

Please help I am really stuck!

I have attached the text document (called simple - can open with notepad) and the image try to explain what i am trying to do with the component and the ghx file.

Views: 1705

Attachments:

Replies to This Discussion

You don't need C# or VB for that, just use the format function and the Stream Contents function of the Panel to write the contents to a file; see attachment.

Attachments:

ah that is useful!!!!!

however, it is only a short term solution since i am hoping to use the script to open files in programs etc. A problem I have just been having is that I looked up the open file syntax online and it uses commands like Let and Set, however, grasshopper doesnt seem to like these. is there a reason why? I ultimately hope to open an OBJ file I am going to export in a program called meshlab, save it, then close meshlab all using a vb script from grasshopper? anyone got an idea where i should start? I have heard the 'shell' command is good to use

Hi, I found this topic and I thought to append here my question instead of opening a duplicate.
I indeed need to make a C# (or Python? VB?) component that stream the content to a .txt file like the panel would. I need to make a specific script because the panel won't handle the large quantity of characters that I need. Any hint appreciated, I'm new to scripting, only used C# once or twice.

Sorry, I just found this:
http://www.grasshopper3d.com/forum/topics/controlling-location-of-p...
I'll take it as a starting point, along with the GH SDK.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service