// Variant was obtained before...
Variant variant = ...
// Select desired nailboard from the variant.
Nailboard nailboard = variant.GetNailboards().First(n => n.Name == "SampleNailboard");
// Opening of the nailboard is not required.
// nailboard.Open(false, false);
// Prepare folder where you want to store exported files.
string directory = @"C:\ExportedDrawings\Nailboards";
// Export the nailboard to PDF file with name taken from HpD project.
nailboard.Export(ApiExportDrawingType.PDF, directory);
// Export the nailboard to DXF file with name taken from HpD project.
nailboard.Export(ApiExportDrawingType.DXF, directory);
// Export the nailboard to PNG file with custom name.
nailboard.Export(ApiExportDrawingType.PNG, directory, "PngNailboard");
// Export the nailboard to JPG file with custom name.
nailboard.Export(ApiExportDrawingType.JPEG, directory, "JpegNailboard.jpg");
// If the nailboard is open, close it.
// nailboard.Close();
/* Content of the selected folder:
*
* C:\
* |
* -- ExportedDrawings\
* |
* -- Nailboards\
* |- JpegNailboard.jpg
* |- PngNailboard.png
* |- SampleNailboard.dxf
* -- SampleNailboard.pdf
*
*/