当前位置:网站首页>Revit secondary development - Hide occlusion elements
Revit secondary development - Hide occlusion elements
2022-07-07 22:22:00 【Hey, hey, hey, hey, hey】
background : After the conflict detection is completed, you need to display the elements that collide with each other and take screenshots , Because there will be a house 、 Ground and other large models , Therefore, we often encounter elements that are blocked .
Solutions :
1、 Will project's “ Visual style ” Change it to “ Hidden line ” Pattern ( When the screenshot is selected, it will be more clearly displayed )、 Set the view direction to top ( From the top down ).
2、 Create a model line to detect which occlusion elements , And hide the element .
3、 After the screenshot, show the hidden elements .
// Set the visual style of the project
uiDoc.ActiveView.get_Parameter(BuiltInParameter.MODEL_GRAPHICS).Set(2);
// Set the view to top
View3D view = uiDoc.ActiveView as View3D;
view.OrientTo(-XYZ.BasisZ);
// Create a model line according to the midpoint of the element , Filter out occluding elements
XYZ ptStart = null;
if(element.Location is LocationPoint)
{
LocationPoint lp = element.Location as LocationPoint;
ptStart = lp.Point;
}
else if(element.Location is LocationCurve)
{
LocationCurve lc = element.Location as LocationCurve;
ptStart = (lc.Curve.GetEndPoint(0) + lc.Curve.GetEndPoint(1)) / 2;
}
else
{
BoundingBoxXYZ box = element.get_BoundingBox(doc.ActiveView);
ptStart = (box.Min + box.Max) / 2;
}
XYZ ptEnd = new XYZ(ptStart.X,ptStart.Y,ptStart.Z + 100);
ModelCurve mc = DrawModelCurve(doc,Line.CreateBound(ptStart,ptEnd));
BoundingBoxXYZ mcBox = mc.get_BoundingBoxXYZ(doc.ActiveView);
Outline ol = new Outline(mcBox.Min,mcBox.Max);
BoundingBoxIntersectsFilter boxFilter = new BoundingBoxIntersectsFilter(ol);
FilteredElementCollector fec = new FilteredElementCollector(doc);
List<ElementId> ids = fec.WherePasses(boxFilter).ToElementIds().ToList();
// Set the occlusion element to hide
uiDoc.ActiveView.HideElements(ids);
// Screenshot
ImageExportOptions ieo = new ImageExportOptions();
ieo.ZoomType = ZoomType.FitToPage;
iep.ExportRange = ExportRange.VisibleRegionOfCurrentView;
ieo.FilePath = @"d:\";
ieo.GLRandWFViewsFileType = ImageFileType.JPEGMedium;
ieo.ShadowViewsFileType = ImageFileType.JPEGMedium;
doc.ExportImage(ieo);
// Show occluded elements
uiDoc.ActiveView.UnhideElements(ids);边栏推荐
- Preparing for the interview and sharing experience
- Firefox browser installation impression notes clipping
- 如何选择合适的自动化测试工具?
- Lingyun going to sea | saihe & Huawei cloud: jointly help the sustainable development of cross-border e-commerce industry
- [JDBC Part 1] overview, get connection, CRUD
- SAR image quality evaluation
- An in-depth understanding of fp/fn/precision/recall
- How to realize the movement control of characters in horizontal game
- Get the exact offset of the element
- NVR hard disk video recorder is connected to easycvr through the national standard gb28181 protocol. What is the reason why the device channel information is not displayed?
猜你喜欢

Px4 autonomous flight

What if the win11u disk does not display? Solution to failure of win11 plug-in USB flash disk
![Jerry's manual matching method [chapter]](/img/92/74281c29565581ecb761230fbfd0f3.png)
Jerry's manual matching method [chapter]

Pdf document signature Guide

如何选择合适的自动化测试工具?

Cv2.resize function reports an error: error: (-215:assertion failed) func= 0 in function ‘cv::hal::resize‘

Customer case | China law network, through observing the cloud, greatly shortens the time of fault location

Antd date component appears in English

How does win11 unblock the keyboard? Method of unlocking keyboard in win11

vite Unrestricted file system access to
随机推荐
L'enregistreur de disque dur NVR est connecté à easycvr par le Protocole GB 28181. Quelle est la raison pour laquelle l'information sur le canal de l'appareil n'est pas affichée?
This experimental syntax requires enabling the parser plugin: ‘optionalChaining‘
【colmap】稀疏重建转为MVSNet格式输入
The strongest installation of the twin tower model, Google is playing "antique" again?
Record problems fgui tween animation will be inexplicably killed
OpenGL job coordinate system
The whole network "chases" Zhong Xuegao
Reptile combat (VII): pictures of the king of reptiles' heroes
Cannot find module 'xxx' or its corresponding type declaration
Display optimization when the resolution of easycvr configuration center video recording plan page is adjusted
Cv2.resize function reports an error: error: (-215:assertion failed) func= 0 in function ‘cv::hal::resize‘
Google SEO external chain backlinks research tool recommendation
Win11如何解禁键盘?Win11解禁键盘的方法
Reinforcement learning - learning notes 9 | multi step TD target
Why can't win11 display seconds? How to solve the problem that win11 time does not display seconds?
EasyCVR配置中心录像计划页面调整分辨率时的显示优化
. Net automapper use
Embedded development: how to choose the right RTOS for the project?
How to close eslint related rules
Relationship between URL and URI