public void RemoveDevice(BasicTriListWithSmartObject device) { InternalContactList.RemoveDevice(device); InternalSourceList.RemoveDevice(device); InternalRoom.RemoveDevice(device); InternalCameraList.RemoveDevice(device); }
/// <summary> /// Determine if an element lies /// within the volume of the Room /// </summary> public bool IsInRoom(Element element) { DB.FamilyInstance familyInstance = element.InternalElement as DB.FamilyInstance; if (familyInstance != null) { if (familyInstance.HasSpatialElementCalculationPoint) { DB.XYZ insertionPoint = familyInstance.GetSpatialElementCalculationPoint(); if (InternalRoom.IsPointInRoom(insertionPoint)) { return(true); } else { return(false); } } } DB.LocationPoint insertionLocationPoint = element.InternalElement.Location as DB.LocationPoint; if (insertionLocationPoint != null) { DB.XYZ insertionPoint = insertionLocationPoint.Point; if (InternalRoom.IsPointInRoom(insertionPoint)) { return(true); } } return(false); }
public void Dispose() { if (IsDisposed) { return; } IsDisposed = true; InternalContactList.Dispose(); InternalSourceList.Dispose(); InternalRoom.Dispose(); InternalCameraList.Dispose(); ComponentMediator.Dispose(); }
private List <DB.BoundarySegment> GetBoundarySegment() { List <DB.BoundarySegment> output = new List <DB.BoundarySegment>(); DB.SpatialElementBoundaryOptions opt = new DB.SpatialElementBoundaryOptions(); foreach (List <DB.BoundarySegment> segments in InternalRoom.GetBoundarySegments(opt)) { foreach (DB.BoundarySegment segment in segments) { output.Add(segment); } } return(output.Distinct().ToList()); }
/// <summary> /// Return a grid of points in the room /// </summary> /// <param name="step">Lenght between two points</param> public List <Point> Grid(double step) { step = UnitConverter.DynamoToHostFactor(DB.UnitType.UT_Length) * step; List <Point> grid = new List <Point>(); DB.BoundingBoxXYZ bb = InternalElement.get_BoundingBox(null); for (double x = bb.Min.X; x < bb.Max.X;) { for (double y = bb.Min.Y; y < bb.Max.Y;) { DB.XYZ point = new DB.XYZ(x, y, bb.Min.Z); if (InternalRoom.IsPointInRoom(point)) { grid.Add(GeometryPrimitiveConverter.ToPoint(InternalTransform.OfPoint(point))); } y = y + step; } x = x + step; } return(grid); }