Files
06-Note/Revit-API/View.md
sherlockforrest bf2ed2e31f 更新
2023-06-20 09:22:53 +08:00

163 lines
3.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## View
### AddFilter(ElementId id)
- 添加一个过滤器
### ApplyViewTemplateParametersView view
- 应用传入View的视图模板
### ChangeTypeIdElementId id
- 改变视图Type
### ConvertTemporaryHideIsolateToPermanent()
- 所有临时隐藏的构件改为永久隐藏
也就是眼镜按钮的将临时隐藏/隔离应用到视图
### CreatedPhaseId
- 获得视图创建时的ID
### CropBox
- 裁剪框
- BoundBox
### CropBoxActive
- 激活裁剪框
- UIDocument uidoc = commandData.Application.ActiveUIDocument;
Document doc = uidoc.Document;
View view = doc.ActiveView;
view.CropBoxActive = true;
### CropBoxVisible
- 裁剪框可见性
- UIDocument uidoc = commandData.Application.ActiveUIDocument;
Document doc = uidoc.Document;
View view = doc.ActiveView;
view.CropBoxActive = true;
view.CropBoxVisible = true;
### DemolishedPhaseId
- 被拆除时Phase的ID
### DesignOption
### DetailLevel
- 模型的显示精度
- UIDocument uidoc = commandData.Application.ActiveUIDocument;
Document doc = uidoc.Document;
View view = doc.ActiveView;
using(Transaction tr = new Transaction(doc))
{
tr.Start("AS");
//ViewDetailLevel.Fine 精细
//ViewDetailLevel.Medium 中等
//ViewDetailLevel.Coarse 粗略
view.DetailLevel = ViewDetailLevel.Fine;
tr.Commit();
}
### DisableTemporaryViewModeTemporaryViewModel model
- 取消模型的临时隐藏
### Discipline
- 视图的专业,枚举类
### DisplayStyle
- 枚举类,显示样式
### Duplicate
- 视图,右键,的复制视图功能
### EnableRevealHiddenMode
- 显示隐藏图元 灯泡按钮
### EnableTemporaryViewPropertiesMode
### GenLevel
- 获得视图的相关标高
### Get/SETBackground()
- 获得/设置背景
### Get/SetCategoryOverridesElementId categoryId
- 获得/设置一个族类别的覆盖样式
### GetCropRegionShapeManager()
- 获得用于管理View剪切框的对象
- ViewCropRegionShapeManager
### Get/SetElementOverridesElementId id
- 获得/设置一个图元的覆盖样式 填色按钮
- OverrideGraphicSetting
### Get/SetFilterOverrides(ElementId id)
- 获得过滤器的覆盖图元
- UIDocument uidoc = commandData.Application.ActiveUIDocument;
Document doc = uidoc.Document;
Selection selection = uidoc.Selection;
Reference r = selection.PickObject(ObjectType.Element);
Element element = doc.GetElement(r);
View view = doc.ActiveView;
OverrideGraphicSettings ogs = new OverrideGraphicSettings();
Color color = new Color(255, 0, 0);
ogs.SetProjectionFillColor(color);
ogs.SetProjectionFillPatternId(new ElementId(4));
//将选择的对象的图元样式改为红色实体,着色模式观看
Transaction transaction = new Transaction(doc, "sss");
transaction.Start();
view.SetElementOverrides(element.Id, ogs);
transaction.Commit();
### GetFilters
- 获得视图所有的过滤器
### GetPointCloudOverrides
### GetReferenceCallouts
### GetReferenceElevations
- 获得海拔参照
### GetReferenceSections
- 获得所有剖面框的参照
### GetVisibilityCategory category
- 是否有改族类型图元可见