Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to use api to Mark model size

1 REPLY 1
Reply
Message 1 of 2
sd1036770
275 Views, 1 Reply

how to use api to Mark model size

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

1 REPLY 1
Message 2 of 2
enonrick
in reply to: sd1036770

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community