Skip to content

Commit b34ac88

Browse files
committed
FIX: add output to component for better debug
1 parent 1dc468a commit b34ac88

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

src/gh/components/DF_export_results/code.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import System
44

55
from ghpythonlib.componentbase import executingcomponent as component
6-
import Grasshopper as gh
6+
import Grasshopper
77

88

99
def add_button(self,
@@ -24,7 +24,7 @@ def add_button(self,
2424
"""
2525
param = ghenv.Component.Params.Input[indx] # noqa: F821
2626
if param.SourceCount == 0:
27-
button = gh.Kernel.Special.GH_ButtonObject()
27+
button = Grasshopper.Kernel.Special.GH_ButtonObject()
2828
button.NickName = ""
2929
button.Description = ""
3030
button.CreateAttributes()
@@ -33,7 +33,7 @@ def add_button(self,
3333
Y_param_coord - (button.Attributes.Bounds.Height / 2 - 0.1)
3434
)
3535
button.Attributes.ExpireLayout()
36-
gh.Instances.ActiveCanvas.Document.AddObject(button, False)
36+
Grasshopper.Instances.ActiveCanvas.Document.AddObject(button, False)
3737
ghenv.Component.Params.Input[indx].AddSource(button) # noqa: F821
3838

3939
class DFExportResults(component):
@@ -52,7 +52,8 @@ def RunScript(self, i_dump: bool, i_export_dir: str, i_results):
5252
if i_dump is None or i_export_dir is None or i_results is None:
5353
return None
5454

55+
o_path = None
5556
if i_dump:
56-
i_results.dump_serialization(i_export_dir)
57+
o_path = i_results.dump_serialization(i_export_dir)
5758

58-
return None
59+
return o_path

src/gh/components/DF_export_results/metadata.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@
5050
"typeHintID": "ghdoc"
5151
}
5252
],
53-
"outputParameters": []
53+
"outputParameters": [
54+
{
55+
"name": "o_path",
56+
"nickname": "o_path",
57+
"description": "The file path of the generated .diffCheck files.",
58+
"optional": false,
59+
"sourceCount": 0,
60+
"graft": false
61+
}
62+
]
5463
}
5564
}

0 commit comments

Comments
 (0)