Design Review API and embedding in .net c# winform for automating local workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This post is twofold: first, to share what I found (or rather, didn’t find) and second, for my future reference in case I need to recall how I did any of this.
I understand the migration to cloud-based solutions, but I don’t believe the cloud works for the type of workflow we need, or are currently using. There are too many factors as to why, and too many to list here. So, having said that…
With what seems to be the slow and silent death of ADR, there is little to no information out there on how to automate a DWFx workflow using the API for local use, file storage, etc. I spent way more time on this than I should have. But I did finally get something working that I can use at our firm in an automated process. How long this will work really depends on how long Autodesk allows the existing API calls to remain functional.
The Project
I created a WinForms app that can query our data systems, pull job info, and DWFx files generated from the latest releases of AutoCAD. The app lists open jobs that need processing. The designer can click the list, load the DWFx into the viewer, mark it up, and save it. The app then notifies another designer of the markups. The DWFx is loaded into the original DWG with the markup information ‘overlayed’ (or underlaid?) and the designer can use the markup palette in AutoCAD to process them. The process can be repeated or sent out. It’s fairly straightforward and, from my understanding, is exactly what the DWFx and ADR process was supposed to be.
The How
I tried everything I could—every blog, every hack, trick, and old blog post I could find. At one point, I even ended up on a shady Chinese site with what looked like an API reference PDF and some C# sample code. But no luck—just a handful of viruses and a new meme coin. Nothing worked on my state-of-the-art, bad-ass Dell with Visual Studio 2022, all the updates and patches, AutoCAD 2025, ADR 18 (or 24?). I even tried good ol' ChatGPT, Rufus, Dufus, Copilot—name it.
What I ended up doing was setting up a new 32-bit environment:
Install VirtualBox from Oracle (free) https://www.virtualbox.org/
Download/Install Windows 7 32-bit ISO from Archive.org
<i removed the link - but googles your friend,>Download/Install Visual Studio 2013 Community from Archive.org
<i removed the link - but googles your friend>Download/Install Autodesk Design Review for 32-bit https://download.autodesk.com/us/support/files/designreview/2018/EXE/enu/SetupDesignReview.exe
Test App:
- I started a new WinForms C# desktop app using all the defaults (defaults to .NET Framework 4.5).
- I used the trick you see everywhere: right-click your toolbox and choose "Add Items": C:\Program Files\Common Files\Autodesk Shared\DWF Common\AdView.dll
I was then able to drag the control onto the WinForm and wire things up for testing.
You may still encounter a crash if you click the control and mess with properties or the solution explorer, but I read somewhere that closing them out makes it a little more stable. That trick does work—of course, your mileage may vary.
I also changed the build to x86 from “Any CPU,” compiled it, copied it to my main PC, and boom, it all worked. Yay!
For completeness, I’m including the sample source code I used in my test app. It has a couple of buttons, a DataGridView, and the DWF control. Straightforward.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PeekABoo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (dgvFiles.SelectedRows.Count > 0)
{
string filePath = dgvFiles.SelectedRows[0].Cells["FilePath"].Value.ToString();
axCExpressViewerControl1.SourcePath = filePath;
}
}
private void button2_Click(object sender, EventArgs e)
{
LoadDwfFiles();
}
private void LoadDwfFiles()
{
string folderPath = @"C:\Temp\dwfs"; // Change this path to where your DWF files are stored
if (!Directory.Exists(folderPath)) return;
var files = Directory.GetFiles(folderPath, "*.dwf")
.Select(f => new { FileName = Path.GetFileName(f), FilePath = f })
.ToList();
dgvFiles.DataSource = files;
dgvFiles.Columns["FilePath"].Visible = false; // Hide full path column
}
private void Form1_Load(object sender, EventArgs e)
{
this.axCExpressViewerControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
}
}
}