AreaLoad Force Direction, CMake, SDK Access

Here are some of the topics I dealt with in the last couple of days:

CMake and YoAudio

I spend some time last week learning the basics of CMake to help Chris set up a build system for their stand-alone YoAudio C++ audio environment and the accompanying YoAudioEditor.

CMake provides a pretty efficient way to handle multi-platform configuration, once figured out, as explained in the comparison with using make for cross platform compilation.

Once we had the build environment set up, we still needed to figure out how to access the required C++ symbols from within the DLL, either by exporting all symbols at once, or, as we ended up doing, using __declspec(dllexport) on each individual symbol.

AutoCAD and Revit SDK Access and Content

Question: I have an add-in for Revit 2017, so I have to compile it against the Revit 2017 assemblies.

Is there an SDK or lightweight download for these assemblies, or do I have to install Revit 2018 in parallel with 2017?

Also, is there any SDK available for AutoCAD?

Answer: Let's start from the end:

Is there an SDK for AutoCAD?

Yes, several. AutoCAD sports a Lisp interface, the ObjectARX C++ API, and the AutoCAD.NET .NET API.

Please refer to the AutoCAD developer centre at www.autodesk.com/developautocad for more information.

Is there an SDK or lightweight download for the Revit assemblies, or do I have to install Revit 2018 in parallel with 2017?

You may very well be able to run your Revit API add-in compiled for Revit 2017 unmodified on Revit 2018.

You would have to test, of course. It will only cause problems if you use Revit API calls in the Revit 2017 API that have been removed or modified in the Revit 2018 API. This is probably not the case.

You can download the Revit SDK only without a full Revit installation for the last couple of SDK releases from the Revit developer centre at www.autodesk.com/developrevit.

However, you do not need the SDK at all to compile or run your add-in.

The SDK contains documentation and sample code, nothing else.

All you need to compile the add-in are the Revit API assemblies, e.g. RevitAPI.dll and RevitAPIUI.dll. These are included with the Revit product installation in the same folder as Revit.exe.

As you know, you need to launch Revit.exe to run the add-in.

Determining AreaLoad Direction and Value from its Force Vectors

This topic came up in the Revit API discussion forum thread on direction and a value of AreaLoad from its 3 force vectors:

Question: There can be 2 or even 3 directions of AreaLoad: ForceVector1, ForceVector2 and ForceVector3.

But Revit always draws the AreaLoad as directed to one direction.

How do I find that one direction?

How do I find a value of that one-directed load, at least at the points returned by the GetRefPoint method?

AreaLoad

Answer: Internally, all three forces are being stored as vectors and their length is the actual force.

The direction of the load is a vector that, simplified, equals (F1+F2+F3).Normalize() – this is not exposed.

I will ask for a request to add an API property the force direction since, well, it is only logical to exist.

Many thanks to Dragos Turmac and Alexander @aignatovich Ignatovich for helping to verify this.

ExportCncFab 2018

Based on new requests, I updated the ExportCncFab add-in to export Revit wall parts to DXF or SAT for CNC fabrication:

Happily, no code modification was required at all for the update.