GET A
QUOTE
Blog Post
Nov
01
2018
Revit Origin - Revit API
As we know, Revit has three points which are used when we link external drawings to Revit. Revit origin, Project Base point and Survey Point.
We had a requirement to get the Revit origin for some purpose associated with drafting views. For that we used a macro using C#. We are using this macro now for that purpose. We have created a circle using a macro at origin to get the origin point.
UIDocumentuidoc = this.ActiveUIDocument;
Document doc = uidoc.Document;
View v = doc.ActiveView;
XYZ c = new XYZ(0,0,0);
XYZ x = new XYZ(1.0,0.0,0.0);
XYZ y = new XYZ(0.0,1.0,0.0);
Transaction trans = new Transaction(doc, "Create a Circle");
Double r, a1,a2;
r = 1.0;
a1 = 0.0;
a2 = 2*Math.PI;
trans.Start();
DetailCurve t;
t = doc.Create.NewDetailCurve(v,Arc.Create(c,r,a1,a2,x,y));
trans.Commit();
trans.Dispose();
TaskDialog.Show("Circle","Created a circle at Origin in "+v.Name.ToString());
We could easily use Dynamo for this, but our user preferred a macro!!!


