Grasshopper

algorithmic modeling for Rhino

I copied Arend's idea of using a text file to embed code into a scripting component. This way you can use Visual Studio or any other alternative as the editor.

It works real-time, the scripting component is run every time the file is saved. The code is also stored inside the component, so if you want to send the file to someone else, you just need to send the .gh. They don't need the text file or any additional plugin.

I haven't tested it much yet.

Things not working:
- You have to type the input arguments manually if you want intellisense for them.
- If you want to add assemblies you have to do it both in the scripting component and VS and manually add the using line.

Views: 1261

Comment

You need to be a member of Grasshopper to add comments!

Comment by Vicente Soler on September 1, 2014 at 5:16am

I forgot to add, if you want to build the .gha you need to add the script.gha reference in the plugin project.

Visual Studio won't allow you to reference files other than .dll. To work a round this you can copy/rename the file as a .dll, add the reference, close the project, open the .csproj file in a text editor and rename script.dll to script.gha. Remember to set copy local as false.

tzl: The .gha file is linked in a comment bellow.

Comment by David Stasiuk on September 1, 2014 at 3:49am

Yes! Thanks for sharing.

Comment by Marios Tsiliakos on September 1, 2014 at 2:15am

Ohhhh! Very nice indeed. 

Comment by tzl on August 31, 2014 at 9:22pm

incredible !! where can i download the GHA?

Comment by Thibault Schwartz on August 31, 2014 at 5:11pm

Great idea!

Comment by Luis Fraguada on August 31, 2014 at 4:47pm

Congrats Vicente.  The benefits of a real development environment!  Thanks for sharing.

Comment by Mateusz Zwierzycki on August 31, 2014 at 3:54pm

Hi Vicente,

I will take a look at it tomorrow, thanks.

Comment by Vicente Soler on August 31, 2014 at 3:33pm

If you want to try it, what I did is create in VS a Grasshopper plugin project, added a new .cs file, pasted all the default code from a scripting component and added some missing references (optional).

The commented lines 

// <Custom code>

// </Custom code>

// <Custom additional code>

// </Custom additional code>

are needed for the component to know what code to place where.

Comment by Vicente Soler on August 31, 2014 at 3:28pm

Hi Mateusz,

I just posted the source code, it should be very simple to make it work in VB.NET as well.

Comment by Vicente Soler on August 31, 2014 at 3:26pm

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service