Warm tip: This article is reproduced from serverfault.com, please click

其他-如何访问Revit的“查看模板属性”并进行实时比较?

(其他 - How to access View Template Properties for Revit and compare them in Real Time?)

发布于 2018-06-08 18:42:55

我想列出视图模板的属性,以便我们可以将它们与另一个旧模板进行比较。例如,哪些模型元素在给定模板中被隐藏或具有覆盖,或者哪些Revit链接在给定模板中被隐藏或被覆盖。

视图模板https://www.google.com/search?q=view+template+revit&rlz=1C1GGRV_enUS770US770&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjLndrd2cTbAhVESq0KHX1cAPwQ_AUICygC&biw=1536&bih=824#imgrc=Q0v-pV7Nxl4kfM :)

我希望设计一个“查看模板比较”工具,并访问它们的所有者和创建者。

public void ApplyViewTemplateToActiveView()
{
    Document doc = this.ActiveUIDocument.Document;
    View viewTemplate = (from v in new FilteredElementCollector(doc)
        .OfClass(typeof(View))
        .Cast<View>()
        where v.IsTemplate == true && v.Name == "MyViewTemplate"
        select v)
        .First();
    using (Transaction t = new Transaction(doc,"Set View Template"))
    {
        t.Start();           
        doc.ActiveView.ViewTemplateId = viewTemplate.Id;
        t.Commit();
    }
}

使用Revit API,你可以使用:GetTemplateParameterIds方法/ ViewTemplateId属性进行访问

Questioner
Alberto Tono
Viewed
0
konrad 2018-06-13 03:27:15

是的,没有。

是的,我想你可以使用Forge Model Derivative API导出RVT文件,然后围绕“视图模板”数据构建 dashboard 。假设在翻译模型时实际上已导出“视图模板”数据。该数据未附加到任何几何图形,因此如果跳过该数据,我不会感到惊讶。这里的问题是为什么?这就像租用16轮卡车将行李袋在街上移动一样。

否,如果你打算直接与RVT模型进行交互。Forge可以查看它,但是不能将任何内容推回去或请求更改模型。再说一次,我什至不确定通过模型导出导出视图模板数据是否可用。

这给我带来了另一种选择。为什么不只是使用Revit API(标准方法)收集数据,然后将其推送到数据库并在此基础上构建呢?没有任何理由雇用Forge。