Using the Modelup platform, you can add a button that triggers the download of an output file.

Example configurator

Below is an example demonstrating this feature. The control panel includes a Button which, when clicked, triggers the download of a PDF file. This PDF contains a Make2D representation of the geometry and is generated using the PDF+ plugin.

download-pdf-example.gif

Example: A button used to download a PDF containing a Make2D view of the current configuration.

This example configurator can be tested using this link: https://configurator.modelup3d.com/?projectId=lRu6WbH2&token=eyJhbGciOiJIUzI1NiJ9.eyJ2NW4iOjEsImlkIjo4NSwicDdkIjoibFJ1NldiSDIiLCJwOXMiOlsiYzVlIiwicl9jMTVhIl0sIm1pIjp7ImRpc2FsbG93Ijp7ImUiOlsxXX19fQ.ff5cV7VNcJxi4XXVevyRiC1AHIeJ5o1re0EbhbTDiME&configurationState=a_484ce966-88e1-4d4d-b764-5b080f09b67f_x_5_y_2_z_5

Underlying Grasshopper file

This example illustrates how to configure the setup. Note that it requires the PDF+ Grasshopper plugin.

  1. Add a Button to the control panel using the “Button” component. Right-click the button to set the label text, tooltip, and icon. The icon can either be a URL to an SVG image or selected from one of the available presets: download or mail.
  2. Connect a “Download output effect” component to the Button. This effect requires a text input that matches the ID of the output you want to download.
  3. Create the output using the Create Stream Output component. Ensure the output is in stream format - convert any file to a memory stream before passing it on.
  4. Connect the output to the Modelup output component. Right-click it and uncheck “Show in scene” and “Send to host”.
  5. Connect an IoMeta component and assign an ID to the output. This ID must match the one used in the Download output effect in step 2.

gui-button-open-mail-client-02.png

Download the example file here:

gui-button-download-output.gh

<aside> ⚠️

NOTE! PDF+ is a Grasshopper plugin that is only available on windows. The example file will not work if you open it from a Mac computer.

If you are on Mac and still would like to use