DeclaraCAD can currently export models as igs, step, stp, svg, and vrml. Models can be exported either via the Export node or by using the UI.

Using the UI

Use File --> Export model.. from the menu.

Export menu

Select the type and set choose a filename. Additional options can be set based on the export type. Then click Export.

Export dialog

Export node

You can now also export models directly from the model code using the Export node. Either set the shapes attribute or embed the nodes you want to export, set a filename, and specify any options to pass to the exporter as a dictionary.

Note: The filename must be set and have an known extension to tell it which exporter to use.

For example, the following will generate models for all terminal blocks with 2 to 11 pins and export them in the step format.

enamldef Assembly(Part):
    Axis:
        pass
    Looper:
        iterable = range(2, 12)
        Export:
            filename = f"5EHDRC-{loop.item:02}P.step"
            options = {
                "name": filename,
                "author": "Author",
                "company": "My Co"
            }
            TerminalBlock: terminal_block:
                n = loop.item

Exported model loaded into Horizon-EDA

CLI

There is also a command line interface for exporting. Simply run

declaracad export -m <model.enaml> -o <output.step>

Note: Export options can be provided by passing a json encoded dictionary to the --options argument. For example --options '{"name": "My Name"}'