BIM World
A Professional BIM Learning Platform


Advanced Revit Customization: Automating Grid Dimension Annotations

When working with Revit for drawing, annotating the grid is an essential task. Below are some insights and development tips for grid dimension annotation:

Grid Dimension Annotation:

First, obtain the reference for the dimension annotation and add it to a reference collection. The key code snippet is shown below:

ReferenceArray array = new ReferenceArray();
array.Append(new Reference(grid));

Next, here is a method to determine the position for dimension annotation by calculating a point on the grid’s curve at a specified distance from the start point:

public static XYZ getStartPoint(Line line, double length)
{
    XYZ start = line.GetEndPoint(0);
    XYZ dir = line.Direction;
    XYZ tempone = start + length * dir;
    return tempone;
}

The method for calculating a point at a certain distance from the end point is similar:

public static XYZ getEndPoint(Line line, double length)
{
    XYZ end = line.GetEndPoint(1);
    XYZ dir = line.Direction;
    XYZ temptwo = end - length * dir;
    return temptwo;
}

After obtaining these points on the grids, connect the points of adjacent grids to create a new line. Then, use the new dimension annotation method to apply the grid dimension annotation, as demonstrated below:

Transaction tran = new Transaction(doc);
tran.Start("Grid Dimension Annotation");
Dimension nowDim = doc.Create.NewDimension(doc.ActiveView, nowLine, arrayTwo);
tran.Commit();

Here, nowLine is the new Line constructed from the points taken from adjacent grids, and arrayTwo represents the collection of grid references.

That concludes the sharing. If you have any questions or better development ideas, please feel free to leave a message below.

xuebim
Follow the latest BIM developments in the architecture industry, explore innovative building technologies, and discover cutting-edge industry insights.
← Scan with WeChat
Like(0) 打赏
BIM WORLD » Advanced Revit Customization: Automating Grid Dimension Annotations

Comment Get first!

Must log in before commenting!

 

BIM World, A Professional BIM Learning Platform

Stay updated on the latest architecture trends and share new building technologies.

Contact UsAbout Us

觉得文章有用就打赏一下小编吧

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

Account Login

By signing in, you agree toUser Agreement

Sign Up