How to display text outputs
Would you like to display certain outputs from your Grasshopper model as text, for example to show numerical results? Then add text outputs to your solution by following these steps.
- You configured the frames and routes for your solution.
- You configured the relevant contents such as the model(s), control panel(s), viewer(s) and datastore.
- You have a Rhino Grasshopper definition using the
Text outputcomponent(s). See the display text outputs guide for the studio for instructions.
1. Retrieve the outputs from the model
- Subscribe the control panel to the model
- Add text outputs with the
- Define type as
setTextfor outputting text.
2. Add text control to the control panel
- Define controls with names matching the
Text outputsin the Rhino Grasshopper definition and
- Set the
""since it is retrieved from the model.
The configuration should look similar to the example below:
params: kind: ControlPanel controls: sphere-volume: # must match GH model output kind: Text text: "" box-volume: # must match GH model output kind: Text text: "" subscribe: - kind: Model frame: home-frame source: model setOutputs: sphere-volume: # must match GH model output type: setText box-volume: # must match GH model output type: setText
- Create a file
solution.yamlfile with the set text output example solution file content.
- Place the example Grasshopper definition in your solutions folder.
- Deploy using the cli:
ph deploy solution -o <org-slug> <solution-name>
The solution should look like the image below.