Message 1 of 2
Wall from room and Wall from PickObject door.Host
Not applicable
05-03-2018
07:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When I use this method to get all the walls of a room and get wall from PickObject the Door.Host I can not find the corresponding wall.
what to do?
SpatialElementBoundaryOptions optionswallForPoint = new SpatialElementBoundaryOptions();
optionswallForPoint.SpatialElementBoundaryLocation = SpatialElementBoundaryLocation.Finish;
foreach (IList<Autodesk.Revit.DB.BoundarySegment> boundSegList in room.GetBoundarySegments(optionswallForPoint))
{
foreach (Autodesk.Revit.DB.BoundarySegment boundSeg in boundSegList)
{
Element elem = doc.GetElement(boundSeg.ElementId);
Wall wall = elem as Wall;
IntersectionResultArray intersectionResultArray = null;
Reference myRefdoor = uidoc.Selection.PickObject(ObjectType.Element);
Element edoor = doc.GetElement(myRefdoor);
FamilyInstance door = edoor as FamilyInstance;
var wallOfDoor = (Wall)door.Host