Skip to main content
Skip table of contents

Download Export

Premium Feature
File exports are only available to users with a paid ShapeDiver subscription. The export components from the ShapeDiver plugin can be used freely by everyone inside Grasshopper but the export buttons will not be available to free users. Additionally, each paid subscription comes with different limits for file exports. Read more about those limits here.

The Dowload Export component can be used to export multiple file types straight from the viewer resulting from the Grasshopper algorithm uploaded on ShapeDiver. On the ShapeDiver platform, this translates with a download button in the viewer controls. The button shows the name that was given to the component in Grasshopper, and it cannot be changed again in the Edit mode. The download can also be triggered through the API.

The component has three parameters: the Data (D) to be exported, the export Options (O) and the Name (N) of the exported file. Consider the example below:

This definition will create an export button in the online model that lets users download a 3DM file after picking which version of 3DM (5, 6 or 7) they want the file to use. The resulting file downloaded from the platform (or any other web application) will be called test_export.3dm.

The component can typically be used to export production files for CNC machining and 3d printing, images and data for printing quotes and order summaries, or even the full 3d geometry created by the definition itself.

Available file formats for exporting

Find all currently available file formats for exporting in this article: Export Options .

For all available file formats, it is possible to define export options using the Export Options components. Export options for each CAD file type correspond to the options offered when exporting using Rhino. Other format types come with custom options offered by the ShapeDiver plugin.

Export geometry including document properties

Download the Grasshopper definition of this example here.

Using the Download Export and Email Export components of the ShapeDiver plugin, one can define file exports from the ShapeDiver model created from a Grasshopper definition. Using the ShapeDiver attribute system, one can attach reserved attributes to geometry elements which will be mapped to standard document properties of the exported files. The currently supported document properties are the following: name, layer, nestedlayer, color, plotcolor, plotweight, material.

Make sure that the exported file format supports the properties you are using from the list above. As an example, obj files do not support layers, and therefore layer attributes will be ignored in the export process.

Consider the following definition, where attributes (name, layer and color) are injected in a mesh object before it is connected to both a Display component (for online display) and a Download Export component:

The file exported with the export component will feature the cube, and the three defined attributes will map to document properties of the 3dm file. This can be tested locally by right-clicking on the export component on “Export locally”, and again after uploading to ShapeDiver, where an export button will be included in the model view page:

In both cases, opening the exported file in Rhino will show that the exported mesh includes all 3 properties defined by the attributes:

Read more about export attributes.

Layer management

Since version 1.16, the ShapeDiver plugin supports nested layers. For backwards compability reasons, this is not done using the layer attribute but rather a new attribute called nestedlayer.

The behaviour of the layer attribute is unchanged: it only contains the bottom sublayer for the object.

The nestedlayer attribute, on the other hand, contains the whole hierarchy of layers the object belongs to in a double colon separated string.

If both the nestedlayer and layer attributes are used for exporting, the layer attribute is ignored and only nestedlayer is used.

Read the nestedlayer attribute in imported files:

  • Write the nestedlayer attribute before exporting:

Export geometry including user text

Download the Grasshopper definition of this example here.

Using the Download Export and Email Export components of the ShapeDiver plugin, one can define file exports from the ShapeDiver model created from a Grasshopper definition. Using the ShapeDiver attribute system, one can attach custom attributes that will map to User Text in the exported files.

User Text are a Rhino feature which is natively stored in 3dm files, and maps to equivalent object properties in some other file formats, but not all. Make sure the file format you are exporting too supports User Text as defined by Rhino (for example, open a file of this format in Rhino and check if User Text can be found in imported objects).

Consider the following definition, where attributes (with keys “example_key_1” and “example_key_2”) are injected in a mesh object before it is connected to both a Display component (for online display) and a Download Export component:

The file exported with the export component will feature the cube, and the two defined attributes will map to user text of the 3dm file. This can be tested locally by right-clicking on the export component on “Export locally”, and again after uploading to ShapeDiver, where an export button will be included in the model view page:

In both cases, opening the exported file in Rhino will show that the exported mesh includes the 2 user text key-value pairs defined by the attributes:

Local testing

Right-click on the component and select “Export locally” to test the exported files on your local machine before uploading to ShapeDiver.

Naming the export

Rename the component to your liking in order to define the name of the export asset, both in the platform and in the various APIs. In the example above, the nickname of the component was set to “Download now!”, which results in the following control in the ShapeDiver platform:

Export multiple files

The component does not itself allow the export of multiple files. However, it is possible to make use of the Create Stream and Zip Streams components to export a zip archive containing multiple files. This can be done by using as input the memory stream created with the Zip Streams component, and using the Stream Export Options component with the zip content type specified.

image-20240730-094651.png

Download this example definition here.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.