When I inherit this class in another component, like this below and I have two the same components on grasshopper canvas. One of them will overwrite/change variables such as preview, bbox, m, lines, directory or other variables from base class. Will it only be affected/changed for one component only while other will have initial values?
That should work fine. This is what I use for GhShaderNodes as well, where I actually have a chain of base classes:
I have a CyclesNode class deriving from GH_Component. This is where I essentially dynamically create the inputs and outputs based on the types in ccl.ShaderNodes.* and some extra stuff for the heavy lifting. Then for the math nodes I have yet another base class MathBaseNode deriving from CyclesNode.