how to use api to Mark model size

how to use api to Mark model size

Anonymous
Not applicable
519 Views
1 Reply
Message 1 of 2

how to use api to Mark model size

Anonymous
Not applicable

Hello,i am new here,i want to ask a question

for example i have a hole in the wall , i want to use api to calculate the size of the hole and mark on the screen like diameter,can revit api do this?if it can,how to do that?

 

or not calculate,just read the attribute of the size and mark it on the screen

 

Thanks~~~~

0 Likes
520 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

You can try to create dimension

 

ReferenceArray curveRefs;
DetailCurve newCurve;
double len;
Line boundLine;

len = Common.LinesLength(boundPt1.X, boundPt1.Y, boundPt2.X, boundPt2.Y);

boundLine = _document.Application.Create.NewLineBound(boundPt1, boundPt2);
newCurve = _document.Create.NewDetailCurve(curSelView, boundLine);
curveRefs = new ReferenceArray();

curveRefs.Append(newCurve.GeometryCurve.get_EndPointReference(0));
curveRefs.Append(newCurve.GeometryCurve.get_EndPointReference(1));
_document.Create.NewDimension(curSelView, boundLine, curveRefs);

You can apply the curve with your hole's diameter

0 Likes