RevitAPI: 如何获取图纸中视口的位置

Revit图纸中插入的视图表现为Viewport,即视口,我们选中这个视口,调用RevitLookup即可看到它是Viewport:

RevitAPI: 如何获取图纸中视口的位置_第1张图片

那么如何获取它在图纸中的位置呢?查看帮助文档,我们发现它有下面三个方法:

//Returns the center of the outline of the viewport on the sheet, excluding the viewport label.
    XYZ GetBoxCenter();

//Returns the outline of the viewport on the sheet, excluding the viewport label.
     Outline GetBoxOutline();

//Gets the outline viewport's label on the sheet.
    Outline GetLabelOutline();

分别对应的是获取视口框中心点,获取视口的边框和获取标题的边框。它们应该正是我们需要的。下面的图可以用来表示它们的具体含义:

RevitAPI: 如何获取图纸中视口的位置_第2张图片

你可能感兴趣的:(RevitAPI,View)