コード例 #1
0
 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;
 }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: Project.cs プロジェクト: JanoSlivka/ORF
        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();
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
            }
        }