Example snippet for GH_TagArtist

yes it is stupid and yes I did restart rhino after deleting it

anyways I put the one Dani uploaded. I’m gonna fix my script.

I’m glad that it is stupid :smiley: Goodluck!

That image shows creating an object that inherits another object. The instance occurs when you use new and the object constructor, i.e. when you reserve a place in memory to store it.

Is a static property of Brushes class in System.Drawing.dll.

It’s a programmer’s function (he created a function called just like that). You only have to fit the arguments of the function to be able to subscribe it to the event. When the event is triggered (at any time) that function subscribed to the event is executed.

About how this is implemented in Python, I have no idea.

1 Like

The thing is in python you don’t use new you simply assign to a variable, but I can’t find the proper way to do it. :frowning:

About PaintEnd what confuses me is that He creates a function with that name and then he uses the name inside the same function as if it was a variable with -= another_variable. I have never seen such syntax in python.

The class (or “type” if you prefer) itself is derived from another class called GH_TagArtist. GH_TagArtist in turn is an abstract class which implements the IGH_TagArtist interface. You could choose to implement that interface directly, in this case it’s not particularly gruelling. I usually provide an interface -> abstract class style api since that allows me to add methods to an interface later and implement them as virtual methods in the abstract class without breaking existing plugins.

The exact same pattern is used for example with IGH_Goo -> GH_Goo<T>, IGH_Component -> GH_Component and IGH_Param -> GH_Param<T:IGH_Goo>.

All of this just concerns the type-system and it’s what you deal with during design-time/compile-time. An instance of a class (or type) is what happens during run-time when you reserve a bit of memory and construct the class.

1 Like