Starting on release 2013 it is possible create a RevitLinkType, which defines the link to a .rvt file, and then insert a new RevitLinkInstance on the project.
// Ask for the file name
System.Windows.Forms.OpenFileDialog
openFileDlg = new OpenFileDialog();
if (openFileDlg.ShowDialog() != DialogResult.OK)
return Result.Cancelled;
string rvtFileName = openFileDlg.FileName;
// Get the active document
UIDocument uiDoc = commandData.
Application.ActiveUIDocument;
Document doc = uiDoc.Document;
// Create the Revit Link Type
FilePath mp = new FilePath(rvtFileName);
RevitLinkOptions lnkOp = new RevitLinkOptions(false);
RevitLinkLoadResult loadedLnkType =
RevitLinkType.Create(doc, mp, lnkOp);
// Create the Revit Link Instance
RevitLinkInstance lnkInstance =
RevitLinkInstance.Create(doc, loadedLnkType.ElementId);