Clarity on GHPY component guid

I was able to hide the obsolete component by injecting this into the precompiled ghpy

def get_Exposure(self):
        return Grasshopper.Kernel.GH_Exposure.hidden
1 Like

When you set the component with name something_OBSOLETE do you also have a component without the suffix in the same assembly? Maybe it is set to work if you have another component named the same.

Hmm _ will try that , cheers

It shouldn’t matter. I have components as obsolete that don’t have the original name anymore (because they were renamed). It obsoletes as expected. Grasshopper does as well such as an old component called Blend Color (search #blendcolor in gh and you will see it) which no longer exists because it’s functionality was combined into the interpolate data component.

1 Like

Guys, this is a nice discussion and also one that is going into the direction of “Ways of updating old components”. It generally would be better to have a dedicated topic for different subjects.

Yes, you should keep both consistent when updating (vs creating a different assembly). They should NOT be the same. Each component should keep its guid, and each assembly should keep its guid. An assembly can contain a collection of components.

Yes, I think this is the other way around, I have personally always encouraged compiling multiple components into a single GHPY. If you found it stated otherwise, please let me know so I can chat with the person who said that and figure out the reasons.

Overriding the property is the method that is supported in GHPYs. Other methods are not currently supported.

The same rules as for all Grasshopper components apply: you cannot change amounts and types of inputs/outputs. If you need to change them, then change also the component Guid, but not the assembly, of course.

Exactly. This is the same as for C# / Vb.Net.

Yes, it doesn’t do anything in GHPYs because the class lookup code is specific in GhpyLoader and I didn’t include a clause for that. Overriding the property has the same effect as renaming.

If you still have questions that do not relate to the component Guid, please may I ask to start a new thread? Cheers!

Giulio

–
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

2 Likes

Could you show an example what/where is this property to be overridden in the example compilation gh definition you’ve created?

Thanks in advance.

Update: This tutorial here:

This worked for me. I just looked at the c# documentation , then converted it to python. I noticed that the properties can be accessed if you just add a get_ prefix

2 Likes