Grasshopper

algorithmic modeling for Rhino

another question,if i have definited a class in C# component,how can i use this class in another Gh file?

Thank you very much!!!

Views: 2122

Replies to This Discussion

Hi Andrea,

'Manage Assemblies' is for importing assemblies (.dlls) from .dll files.
You can write a class library (.dll = dynamic link library) in VS using C# or Vb.Net or Managed C++ and then load it though that command.

At the same time, I do not think it is possible to load a script from another .gh file directly.

I hope this helps,

- Giulio
________________
giulio@mcneel.com

Hi Giulio,

When a plugin has a separate dll file in its folder, do we need to load it through the Manage Assemblies option in this menu? What is a dll used for in the case of plugins?

Many thanks!

Arthur

A .gha is really a .dll file that is renamed and is meant to be used in Grasshopper only.
For plug-in do you mean an add-on, like, say, Kangaroo or Firefly?

Sometimes, developers opt to have some code in different .dll files, so they can keep track of who wrote the code, which version it is, which license it is released with, etc... Was this the answer? Do you have a deeper question in mind?

- Giulio
________________
giulio@mcneel.com

Thanks Giulio. Yes Kangaroo for example comes with a dll file as well as a .gha. I usally place the .dll file in the components folder with the .gha file but not sure if this is right...

So the .dll file is more convenient to keep information than a .gha? I guess developpers just add this file in the installation folder just for their information...This is the answer, no deeper question ;) I saw .dll as title so I thought I would try to find out.

> I usally place the .dll file in the components folder with the .gha file but not sure if this is right...

If it works it probably is. The developer might request you put it into a specific position.

Also, you need to ask case-by-case why they split their project: it is a subjective choice most of the times. The .gha could possibly contain all the source at once.

>> A .gha is really a .dll file that is renamed and is meant to be used in Grasshopper only.
Dll and Gha are the same type of file.

Thanks,

- Giulio
_______________
giulio@mcneel.com

thankyou for helpful reply,Giulio,and can i  compile the script (wittrn in gh)in the VS enviroment and then make it become a dll file then insert it in the new gh C# component as assembly?if it is possible can you tell me the process of how to compile?,thankyou very much

Hi Andrea, did you have a look at Giulio's amazing new wizard?

thankyou ,i am looking it!

To compile a .Net .dll you need a C# or Vb.Net or Managed C++ compiler. People often use an IDE, like Visual Studio or MonoDevelop to help them, but this is not necessary really. A class library, or .dll, is really just a (standalone) collection of compiled data.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service