如何使用Revit API(外部命令)在Revit中创建特定门的局部视图?目前,我设法创建了DetailView,但是当我在Revit中打开该视图时,它不是我所期望的(请参见图片:expected,what I get)。
代码如下:
IEnumerable<ViewFamilyType> viewFamilyTypes = from elem in new FilteredElementCollector(doc).OfClass(typeof(ViewFamilyType))
let type = elem as ViewFamilyType
where type.ViewFamily == ViewFamily.Detail
select type;
//uiDoc.Selection.SetElementIds(new List<ElementId>() { door.Id });
var dim = door.get_BoundingBox(null);
using (Transaction transaction = new Transaction(doc))
{
transaction.Start("Creating Detail View");
BoundingBoxXYZ box = dim;
var detailView = ViewSection.CreateDetail(doc,viewFamilyTypes.First().Id, box);
detailView.Discipline = ViewDiscipline.Architectural;
detailView.DetailLevel = ViewDetailLevel.Coarse;
transaction.Commit();
}我正在使用Revit 2018,欢迎任何帮助或建议,只是为了完成我的学生研究。
发布于 2017-08-18 05:51:01
creating a section view上的构建代码文章有帮助吗?
https://stackoverflow.com/questions/45708529
复制相似问题