public SiteType(IIfcSite ifcSite, CoBieLiteHelper helper) : this() { // _ifcSite = ifcSite; externalEntityName = helper.ExternalEntityName(ifcSite); externalID = helper.ExternalEntityIdentity(ifcSite); externalSystemName = helper.ExternalSystemName(ifcSite); SiteName = ifcSite.LongName; SiteDescription = ifcSite.Description; }
protected override Site Mapping(IIfcSite ifcSite, Site site) { var helper = ((IfcToCOBieLiteUkExchanger)Exchanger).Helper; site.ExternalEntity = helper.ExternalEntityName(ifcSite); site.ExternalId = helper.ExternalEntityIdentity(ifcSite); site.AltExternalId = ifcSite.GlobalId; site.Name = ifcSite.LongName; site.Description = ifcSite.Description; return(site); }
internal Project(IIfcProject project, bool init) : base(project) { CostSchedules = new CostSchedulesCollection(this, init); ClassificationItems = new ClassificationCollection(Entity, init); if (!init) { return; } var rel = project.IsDecomposedBy.FirstOrDefault(r => r.RelatedObjects.Any(o => o is IIfcSite)); _site = rel?.RelatedObjects.OfType <IIfcSite>().FirstOrDefault(); }
public IIfcSite NewSite(string siteName = null) { IIfcSite site = null; Wrap(s => { site = IfcProductScope.NewOf <IIfcSite>(); site.OwnerHistory = CurrentVersion; site.Name = siteName; NewContainer(site); }); return(site); }
public IfcLocationData(string path) { using (IfcStore model = IfcStore.Open(path)) { if (model.SchemaVersion == XbimSchemaVersion.Ifc2X3) { Schema = "Ifc 2x3"; SchemaIsSupported = true; } else if (model.SchemaVersion == XbimSchemaVersion.Ifc4) { Schema = "Ifc4"; SchemaIsSupported = false; return; } else { Schema = model.SchemaVersion.ToString(); SchemaIsSupported = false; return; } IIfcProject project = model.Instances.FirstOrDefault <IIfcProject>(); string applicationFullname = project.OwnerHistory.OwningApplication.ApplicationFullName; if (applicationFullname == null) { AuthoringTool = "N/A"; } else { AuthoringTool = project.OwnerHistory.OwningApplication.ApplicationFullName; } IIfcSIUnit lengtUnit = project.UnitsInContext.Units.FirstOrDefault <IIfcSIUnit>(q => q.UnitType == IfcUnitEnum.LENGTHUNIT); LengthUnit = lengtUnit.FullName; IIfcSite site = model.Instances.FirstOrDefault <IIfcSite>(); if (site.RefElevation.HasValue) { refElevation = site.RefElevation.Value; } else { refElevation = double.NaN; } IIfcLocalPlacement placement = site.ObjectPlacement as IIfcLocalPlacement; IIfcAxis2Placement3D axis2Placement = placement.RelativePlacement as IIfcAxis2Placement3D; double x = axis2Placement.RefDirection.DirectionRatios.GetAt(0); double y = axis2Placement.RefDirection.DirectionRatios.GetAt(1); double angle = 360 - Math.Atan2(y, x) * 180 / Math.PI; if (angle.Equals(360)) { angle = 0; } Orientation = angle; EW = axis2Placement.Location.Coordinates.GetAt(0); NS = axis2Placement.Location.Coordinates.GetAt(1); elevation = axis2Placement.Location.Coordinates.GetAt(2); } }