revit二次开发之七 Revit隔离与隐藏

Revit中经常出现隔离和隐藏对象,通过API如何实现这些功能呢?主要用到View中的几个关键函数

一、隔离元素

1、一个隔离多个类别

public void IsolateCategoriesTemporary(ICollection<ElementId> elementIds)

2、一次隔离一个类别

public void IsolateCategoryTemporary(ElementId elementId)

3、一次隔离多个元素

public void IsolateElementsTemporary(ICollection<ElementId> elementIds)

4、一次隔离一个元素

public void IsolateElementTemporary(ElementId elementId)

 

二、隐藏元素

1、隐藏多个类别

public void HideCategoriesTemporary(ICollection<ElementId> elementIds)

2、隐藏一个类别

public void HideCategoryTemporary(ElementId elementId)

3、隐藏多个元素

public void HideElementsTemporary(ICollection<ElementId> elementIdSet)

4、隐藏一个元素

public void HideElementTemporary(ElementId elementId)

三、判断是否存在隐藏和隔离

   通过调用以下函数,判断当前视图中,是否有隐藏和隔离对象,假如为true,则说明存在隔离和隐藏对象,假如为false则不存在

public bool IsTemporaryHideIsolateActive()

四、取消隐藏和隔离

   调用以下函数,实现对隔离和隐藏对象的处理

public void DisableTemporaryViewMode(TemporaryViewMode mode)

TemporaryViewMode是一个枚举,其枚举的参数如下:

成员表述
RevealHiddenElementsThe view is in reveal hidden elements mode
TemporaryHideIsolate视图是临时隐藏和隔离模式
WorksharingDisplayThe view is in one of the worksharing display modes
TemporaryViewPropertiesThe view is in the selected View Properties applied temporarily.
RaytraceThe view is in the mode that shows the model in interactive raytracing
ExplodedViewThe view is in the mode that shows the model in exploded view and allows user changes/configurations
RevealConstraintsThe view is in the mode that reveals constraints between elements in the model.
PreviewFamilyVisibilityThe view is in the mode that shows visibility settings applied in the environment of a family document.

转载于:https://www.cnblogs.com/minhost/p/6868021.html

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值