Skip to main content

VIM Revit Core C# Library

If you are familiar with C# Revit plugin development, you can use the VIM Revit Core C# Library to embed the VIM exporting process within your own plugin.

Requirements

Please contact us for the following:

  • The Vim.Revit.Core.zip package
  • A valid VIM license string

Setup

  • Download and extract Vim.Revit.Core.zip
  • In your C# Revit plugin project, add a reference to Vim.Revit.Core.dll and make sure to copy it and its dependencies to your build output directory.

Sample Code

To export a VIM file from your own plugin, you will need to call the static function Vim.Revit.Core.Exporter.Export, for example:

namespace MyPluginNamespace
{
public static class MyPluginClass
{
/// <summary>
/// Sample export function
/// </summary>
/// <param name="revitDocument">The Revit document to export from</param>
/// <param name="view3dName">The name of the 3D view to export</param>
/// <param name="vimFilePath">The name of the output VIM file path</param>
/// <param name="myVimLicense">The VIM license string</param>
public static void MyExportFunction(
Autodesk.Revit.DB.Document revitDocument,
string view3dName,
string vimFilePath,
string myVimLicense)
{
var options = new Vim.Revit.Core.ExportOptions
{
View = view3dName,
VimLicenseString = myVimLicense,
// ... enable other options ...
};

// Run the export process.
Vim.Revit.Core.Exporter.Export(revitDocument, vimFilePath, options);
}
}
}

ExportOptions Class

The Vim.Revit.Core.ExportOptions class provides configuration options for exporting VIM files.

ParameterDescription
Log stringThe path to which export logs will be written.
View stringThe name of the 3D view to export.
FallbackToDefaultView bool?(Default: true) Determines whether to export a default 3D view if the given view name is not found.
ForceDefaultView bool?(Default: false) Forces the exporter to export a default 3D view; ignores any given View property.
ViewLevelOfDetail intDetermines the level of detail to apply to the view prior to exporting.
  • -1: Use the view's current level of detail
  • 0 to 15: For increasingly high tessellation
  • 8: For normal tessellation
Render3dView bool?(Default: true) Determines whether the 3D view will be rendered as an image and stored within the VIM file.
OptimizeMeshes bool?(Default: true) Determines whether VIM's mesh optimization is applied. This typically improves the mesh quality of curved surfaces like pipes.
OptimizeInstances bool?(Default: true) Determines whether VIM's instance optimizations are applied. This may save on export times.
StoreAllViewInfo bool?(Default: false) Determines whether the information of all the existing views in the Revit document should be stored.
StoreAllGroupInfo bool?(Default: false) Determines whether all the existing groups in the Revit document should be stored.
Export3d bool?(Default: true) Determines whether the 3D export process should be executed.
ImageDpi int(Default: 150) Determines the image dpi (dots per inch) settings to apply when rendering a 2D view. Valid values are: 600
ImagePixelSize int(Default: 4096) Determines the size in pixels of the image major dimension when rendering a 2D view.
ImageFileTypePng bool?(Default: true) Determines whether a PNG image is stored when rendering a 2D view.
ImageFileTypeTiff bool?(Default: false) Determines whether a TIFF image is stored when rendering a 2D view.
ImageFitHorizontal bool?(Default: true) Determines whether to fit the image horizontally when rendering a 2D view.
ImageFitToPage bool?(Default: false) Determines whether to fit the image to the page when rendering a 2D view.
StopOnError bool?(Default: false) Determines whether to halt the export process if any errors occur.
TempExportDir stringThe temporary directory path used during the export process. If left unspecified, the following path will be used: %USERPROFILE%\AppData\Local\Temp\VIM\Revit Exporter\
CleanTemp bool?(Default: true) Determines whether the temporary files will be deleted after the export process. Used for debugging purposes.
Trace bool?(Default: false) Determines whether to emit a detailed trace file of the export process.
This trace file appears alongside the exported .vim file.
StoreShapeOutlines bool?(Default: false) Determines whether to store line shape outlines when rendering a 2D view.
StoreSystems bool?(Default: true) Determines whether to store MEP system information.
StoreRoomGeometry bool?(Default: true) Determines whether to store room geometry.
StoreMaterialUsage bool?(Default: true) Determines whether to store material usage per element.
StoreParameters bool?(Default: true) Determines whether to store element parameters.
IgnoreEmptyParameters bool?(Default: false) Determines whether to ignore empty parameters. This may improve export times, but empty parameters cannot be audited.
ParameterNameAllowList stringThe pipe-separated list of parameter names to process. If empty, all parameters are processed.
StoreAll3DCameras bool?(Default: false) Determines whether the information of all the existing 3D views in the Revit document should be stored.
Schedules string(Default: "") The pipe-separated schedule names to store.
ForceFaceTriangulation
LevelOfDetail bool?
(Default: false) Determines whether the face triangulation level of detail is forced to a specific value.
FaceTriangulationLevelOfDetail double(Default: 1.0) Controls the face triangulation level of detail. This value should be between 0.0 and 1.0, where 1.0 is the highest level of detail. Only applies if ForceFaceTriangulationLevelOfDetail is true.
RfaMaxLevelOfDetailOverride bool?(Default: true) When set to true, exporting a Revit family file (.rfa) will automatically apply the maximum level of detail to the geometry.
ViewSheetSets stringThe pipe-separated view sheet set names to store.
HideLevelIndicators `bool?(Default: true) When set to true, the circular level indicator geometry will be hidden.
LinkTitleAllowList stringThe pipe-separated list of linked Revit document titles to process. If empty, all links are processed.
VimLicenseString stringThe VIM license string. This must be assigned to a valid VIM license string to successfully export a VIM file.