Skip to content

Commit 344289f

Browse files
committed
added example component
1 parent 7e8ea33 commit 344289f

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Do something silly.
3+
4+
This component does nothing useful, it's only a kitchen sink example showing most available options.
5+
6+
Args:
7+
x: X value
8+
y: Y value
9+
z: Z value
10+
Returns:
11+
result: The sum of all three values.
12+
"""
13+
from ghpythonlib.componentbase import executingcomponent as component
14+
15+
16+
class KitchenSinkComponent(component):
17+
def RunScript(self, x, y, z):
18+
self.Message = "COMPONENT v{{version}}"
19+
return x + y + z
2.69 KB
Loading
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"name": "Kitchen sink component example",
3+
"nickname": "Everything",
4+
"category": "Componentizer",
5+
"subcategory": "ALL",
6+
"description": "This is an example with the everything and the kitchen sink in it, just to show all available options.",
7+
"exposure": 4,
8+
"instanceGuid": "cdd47086-f902-4b77-825b-6b79c3aaecc1",
9+
"ghpython": {
10+
"hideOutput": true,
11+
"hideInput": true,
12+
"isAdvancedMode": true,
13+
"marshalOutGuids": true,
14+
"iconDisplay": 2,
15+
"inputParameters": [
16+
{
17+
"name": "X",
18+
"nickname": "x",
19+
"description": "The X value of the component.",
20+
"optional": true,
21+
"allowTreeAccess": true,
22+
"showTypeHints": true,
23+
"scriptParamAccess": "item",
24+
"wireDisplay": "faint",
25+
"sourceCount": 0,
26+
"typeHintID": "float",
27+
"reverse": true,
28+
"simplify": false
29+
},
30+
{
31+
"name": "Y",
32+
"nickname": "y",
33+
"description": "The Y value of the component.",
34+
"optional": true,
35+
"allowTreeAccess": true,
36+
"showTypeHints": true,
37+
"scriptParamAccess": "item",
38+
"wireDisplay": "default",
39+
"sourceCount": 0,
40+
"typeHintID": "float",
41+
"simplify": true
42+
},
43+
{
44+
"name": "Z",
45+
"nickname": "z",
46+
"description": "The Z value of the component.",
47+
"optional": true,
48+
"allowTreeAccess": true,
49+
"showTypeHints": true,
50+
"scriptParamAccess": "item",
51+
"wireDisplay": "faint",
52+
"sourceCount": 0,
53+
"typeHintID": "float",
54+
"flatten": true
55+
}
56+
],
57+
"outputParameters": [
58+
{
59+
"name": "result",
60+
"nickname": "result",
61+
"description": "Result of the computation",
62+
"optional": false,
63+
"sourceCount": 0,
64+
"graft": true
65+
}
66+
]
67+
}
68+
}

0 commit comments

Comments
 (0)