Grasshopper

algorithmic modeling for Rhino

General question. When to use custom component vs a vb script component

Can anyone explain why a custom component created using the grasshopper sdk is better than simply rewriting the same routine in a vb script component? 
One advantage of a script component is that it can be saved in the document to be reused and edited downstream by a user or the owner
A custom component is inaccessible and requires the down stream user to also have installled the ciusrom component from the vendor.

I could understand if the custom component processes data faster or if it has more methods accessible from .net vs a script component.

Also in gh 0.7 what is the difference between a user component and a custom component?

Views: 278

Replies to This Discussion

Hi Duck,

that reason cuts both ways. Some people don't want their code to be 'accessible' to others. It's also much easier developing inside Visual Studio than the Grasshopper code editor. Especially if you're writing a bunch of classes in addition to the script.

Until recently, custom components were much more flexible in terms of UI as well. They could have their own icons, they could have their own tabs, they can override the menu and double clicking response etc. etc. Some of these functions will become available to VB and C# script components eventually though.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks for the reply.

Makes sense what you say. Is there a speed difference when running a script in a VB component vs the same script compiled and executed within a custom component?

Also, what does the term user object refer to in GH 0.7?

Cheers
Hi Duck

it is a little bit faster when you have build a solution

the term of user object is for e.g you can setup a integer slider or setup a function component with a already set function or something you always change @a component because it is not your default setup
There is no difference in speed of the actual code, however the Script components do spend extra cycles (and extra memory) on data translation. When you're developing your own components you can choose to access data in a more efficient fashion, but this also means more responsibility.

User Objects in 0.7 are files (*.ghuser extension) that contain a single Grasshopper object including all the settings. This is not something developers need to worry about, though I suppose it would make a lot of sense to redistribute your VB and C# script components as User Objects.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
To add a further comment, in my opinion the number of times the component will be repeated/reused is the biggest driver for deciding whether to do a custom component of a script component (coupled with the risk of needing to implement a future change). If a component is effectively a once off, a script component is perfect.

If there's a risk you want to implement future changes (or fix problems), then the problem with a script component is that you need to locate all instances and update the source code. If it's a custom component, you can make the change, compile and all models using these components will update. If you have to alter input/output types this might be a little less straightforward.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service