References Protogeometry.dll in Revit Macro

Hi everyone,
I want to use the protogeometry library in a Revit macro, is it possible?

thank you so much!


Have you made any progress on the subject?



Finally, I managed to create the macro. The main issue is that the ProtoInterface is requiered, and the only way I know to do that is by opening Dynamo, hahaha. I hope someone can tell us if there is another way.

You need to add these references:

1.- ProtoGeometry.dll ( C:\Program Files\Dynamo\Dynamo Core\1.3\ProtoGeometry.dll )
2.- DynamoServices.dll ( C:\Program Files\Dynamo\Dynamo Core\1.3\DynamoServices.dll )
3.- RevitNodes.dll ( C:\Program Files\Dynamo\Dynamo Revit\1.3\Revit_201X\RevitNodes.dll )

using System;
using System.Collections.Generic;
using System.Linq;

using Autodesk.DesignScript.Geometry;
using Autodesk.Revit.UI;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;

using Revit.GeometryConversion;

public void CreateCircles()
			UIDocument uidoc = this.ActiveUIDocument;
			Document doc = uidoc.Document;
			// Get the active view
			View view = doc.ActiveView;
			// Create Detail Curves
			Transaction t = new Transaction(doc, "Create detail curves.");
			// Create a list of Points
			for (int i=1; i<=10; i++)
				// Create the center point
				Autodesk.DesignScript.Geometry.Point centerPoint = Autodesk.DesignScript.Geometry.Point.Origin();
				// Create a circle
				Autodesk.DesignScript.Geometry.Circle circle = Autodesk.DesignScript.Geometry.Circle.ByCenterPointRadius(centerPoint, i);
				// Create a Revit curve
				Autodesk.Revit.DB.Curve dbCurve = circle.ToRevitType();
				// Create a detail curve
				Autodesk.Revit.DB.DetailCurve detCurve = doc.Create.NewDetailCurve(view, dbCurve);

The result:


Hi, I really appreciate your interest in this subject!
I encountered the same error as you using Dynamo libraries in a macro. I didn’t have much time to solve it, because of deadlines at work, so in the end I “moved” to the Revit API and I built my personal methods for my purposes.
However, I agree with what you suppose about the Dynamo interface: your trick seems definetely the easiest way to use Dynamo libraries in a macro! What about launching Dynamo in background, just for running your macro? You may have a try.
Keep us informed if you find a different solution!

1 Like


I tried to do that, but only DynamoSandbox can be launched, not Dynamo for Revit. Any hint is appreciated.

I can not use dynamo library in c# revit api.


1 Like

Have you solved this problem?

Just open dynamo in background. you will not see this error.