Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of Revit contact Filtration

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the relevant knowledge of "Revit contact filtering method". The editor shows you the operation process through the actual case. The operation method is simple, fast and practical. I hope this "Revit contact filtering method" article can help you solve the problem.

Select the columns that are in contact with the extruded body:

List beam = new List ()

/ / create a solid to obtain a column with intersections according to the cross section of the column

Foreach (Element bttt in fil)

{

FamilyInstance bb = bttt as FamilyInstance

Double lenght = bb.Symbol.GetParameters ("section width") [0] .AsDouble (); / / get the section width of the column

Beam.Add (bttt.Id)

LocationPoint ppp = bttt.Location as LocationPoint

XYZ pt = ppp.Point

Level le = doc.GetElement (bb.LevelId) the level of the floor on which the as Level;// column is located

/ / subtract the section width from the center of the column to form four points

XYZ pt1 = new XYZ (pt.X-lenght, pt.Y-lenght, le.Elevation)

XYZ pt2 = new XYZ (pt.X + lenght, pt.Y-lenght, le.Elevation)

XYZ pt3 = new XYZ (pt.X + lenght, pt.Y + lenght, le.Elevation)

XYZ pt4 = new XYZ (pt.X-lenght, pt.Y + lenght, le.Elevation)

/ / join four points into a curve

CurveLoop profile = new CurveLoop ()

Profile.Append (Line.CreateBound (pt1, pt2))

Profile.Append (Line.CreateBound (pt2, pt3))

Profile.Append (Line.CreateBound (pt3, pt4))

Profile.Append (Line.CreateBound (pt4, pt1))

/ / put the curve into the collection

List loops = new List ()

Loops.Add (profile)

/ / stretch Direction

XYZ vector = new XYZ (0,0,1)

/ / create an entity

Solid solid = GeometryCreationUtilities.CreateExtrusionGeometry (loops, vector, 10)

/ / get the entities in this view that collide with the created entity

FilteredElementCollector collector = new FilteredElementCollector (doc, doc.ActiveView.Id)

ElementIntersectsSolidFilter solidFilter = new ElementIntersectsSolidFilter (solid, false)

Collector.WherePasses (solidFilter)

}

This is the end of the content about "Revit contact filtering method". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report