3.4: Input- and Output-Plugs
Now it is time to add the input- and output-plugs to the new component. This is the listing of the first few lines of “TensionElimComponent.cs” which implements this functionality:
Line 1 to 4 get automatically created by the GH-wizard. Lines 6 and 7 are important: they make the classes available (i.e. Model, Param_Model, GH_Model, Element, ...) which reside in the namespaces “Karamba.Models” and “Karamba.GHopper.Models”. This allows to define the component input in lines 20 and 21. Objects that are used as component input or output need to be wrapped so that GH can handle them. In Karamba3D these wrapper classes are named after the class they wrap preceded by “Param_” and “GH_”. Lines 26 to 32 specify the output plugs. Supplement “TensionElim- Component.cs” with the above lines, compile the project and copy the resulting “TensionElim.gha” as before. Restart Rhino. Fig. 3.4.1 shows the component with input and output-plugs.
Last updated
Was this helpful?