Blog

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!!!

Posted on November 01, 2018 by Rightserve

Request a free quote

Please take a moment to fill out the following information and a representative from Rightserve will be able to provide you with a Quote and other information you may need within 24 hrs

Services (check all that apply) *
  • Select LOD
  • Select LOD
Associated Trades (check all that apply) *

Please add any relevant attachment(s), drawings, plans, or specifications.