Exemple #1
0
        public static BbAssembly Create(
            string assemblyId,
            string assemblyName,
            string assemblyMark,
            string clientMark,
            string prelimMark,
            string shippingMark,
            string barCode,
            BbSpatialElement floor,
            BbCoordinate3D position,
            BbDirection3D zAxis,
            BbDirection3D xAxis)
        {
            var steelAssembly = new BbAssembly(
                assemblyId,
                assemblyName, assemblyMark, clientMark,
                prelimMark,
                shippingMark,
                barCode, floor,
                position, zAxis, xAxis);

            //floor.AddContained(steelAssembly);
            BbInstanceDB.AddToExport(steelAssembly);
            return(steelAssembly);
        }
Exemple #2
0
        public static BbCoordinate2D Create(double x, double y)
        {
            var coord2D = new BbCoordinate2D(x, y);

            BbInstanceDB.AddToExport(coord2D);
            return(coord2D);
        }
Exemple #3
0
        public static BbListProperty Create(string name, int value, Type type)
        {
            BbListProperty sp = new BbListProperty(name, value, type);

            BbInstanceDB.AddToExport(sp);
            return(sp);
        }
Exemple #4
0
        public static BbListProperty Create(string name, DateTime value)
        {
            BbListProperty sp = new BbListProperty(name, value);

            BbInstanceDB.AddToExport(sp);
            return(sp);
        }
Exemple #5
0
        public static ICollection <BbSite> Retrieve(BbProject project)
        {
            var refed = EarlyBindingInstanceModel.GetReferencedEntities(project.IfcObject.EIN);

            if (refed.Count <= 0)
            {
                throw new InvalidDataException();
            }

            var list =
                (from agg in
                 (
                     from p21Instance in refed
                     where p21Instance.Value.GetType() == typeof(IfcRelAggregates)
                     select p21Instance.Value).OfType <IfcRelAggregates>()
                 from instance in agg.RelatedObjects
                 where instance.GetType() == typeof(IfcSite)
                 let site = instance as IfcSite
                            where site != null
                            select new BbSite(project, site, agg))
                .ToList();

            BbInstanceDB.AddToImport(list);

            return(list);
        }
Exemple #6
0
        public static BbBbNamedCircleProfile Create(double radius)
        {
            var circleProfile = new BbBbNamedCircleProfile(radius);

            BbInstanceDB.AddToExport(circleProfile);
            return(circleProfile);
        }
Exemple #7
0
        public static BbDirection3D Create(double x, double y, double z)
        {
            var direction3D = new BbDirection3D(x, y, z);

            BbInstanceDB.AddToExport(direction3D);
            return(direction3D);
        }
Exemple #8
0
        public static BbCurveSegment Create(BbCurve bbCurve)
        {
            var cs = new BbCurveSegment(bbCurve);

            BbInstanceDB.AddToExport(cs);
            return(cs);
        }
Exemple #9
0
        public static BbDerivedProfile Create(BbProfile parentProfile, double rotationAngle)
        {
            var derivedProfile = new BbDerivedProfile(parentProfile, rotationAngle);

            BbInstanceDB.AddToExport(derivedProfile);
            return(derivedProfile);
        }
Exemple #10
0
        public static BbDirection3D Create(double[] x)
        {
            var direction3D = new BbDirection3D(x);

            BbInstanceDB.AddToExport(direction3D);
            return(direction3D);
        }
Exemple #11
0
        public static BbDerivedProfile Create(BbProfile parentProfile, bool mirrorXAxis, bool mirrorYAxis)
        {
            var derivedProfile = new BbDerivedProfile(parentProfile, mirrorXAxis, mirrorYAxis);

            BbInstanceDB.AddToExport(derivedProfile);
            return(derivedProfile);
        }
Exemple #12
0
        public static BbDirection2D Create(double x, double y)
        {
            BbDirection2D direction2D = new BbDirection2D(x, y);

            BbInstanceDB.AddToExport(direction2D);
            return(direction2D);
        }
        public static BbLocalPlacement3D Create(BbLocalPlacement3D placementRelTo, BbPosition3D relativePlacement)
        {
            var placement3D = new BbLocalPlacement3D(placementRelTo, relativePlacement);

            BbInstanceDB.AddToExport(placement3D);
            return(placement3D);
        }
        public static BbLocalPlacement3D Create(BbLocalPlacement3D placementRelTo)
        {
            var placement3D = new BbLocalPlacement3D(placementRelTo);

            BbInstanceDB.AddToExport(placement3D);
            return(placement3D);
        }
Exemple #15
0
        public static BbPropertySet Create(string name)
        {
            var pset = new BbPropertySet(name);

            BbInstanceDB.AddToExport(pset);
            return(pset);
        }
        public static BbLocalPlacement3D Create(IfcLocalPlacement ifcLocalPlacement)
        {
            var placement3D = new BbLocalPlacement3D(ifcLocalPlacement);

            BbInstanceDB.AddToExport(placement3D);
            return(placement3D);
        }
        public static BbCoordinate3D Create(double x, double y, double z)
        {
            BbCoordinate3D coord3D = new BbCoordinate3D(x, y, z);

            BbInstanceDB.AddToExport(coord3D);
            return(coord3D);
        }
Exemple #18
0
        public static BbPolyline2D Create(BbCoordinate2D[] points)
        {
            var pLine = new BbPolyline2D(points);

            BbInstanceDB.AddToExport(pLine);
            return(pLine);
        }
//		public static IfcProductDefinitionShape Create(IfcRepresentationContext representationContext,
//		                                               IfcProfileDef ifcProfileDef,
//		                                               IfcAxis2Placement3D placement3D,
//		                                               IfcDirection direction,
//		                                               double depth)
//		{
//			var extruded = new IfcExtrudedAreaSolid
//			{
//				SweptArea = ifcProfileDef,
//				Position =  placement3D,
//				ExtrudedDirection = direction ,
//				Depth = depth,
//			};
//
//			var shaperep = new IfcShapeRepresentation
//			{
//				ContextOfItems = representationContext,
//				RepresentationIdentifier = "Body",
//				RepresentationType = "SweptSolid",
//				Items = new List<IfcRepresentationItem>(),
//			};
//			shaperep.Items.Add(extruded);
//
//			var ifcShape = new IfcProductDefinitionShape
//			{
//				// Name=
//				// Description =
//				Representations = new List<IfcRepresentation>(),
//			};
//			ifcShape.Representations.Add(shaperep);
//
//			return ifcShape;
//		}
//
//


        public static BbExtrudedGeometry RetrieveFromMainPiece(BbElement mainPiece)
        {
            var ret  = new BbExtrudedGeometry();
            var ipds = mainPiece.IfcObject as IfcElement;
            var iPDS = ipds.Representation as IfcProductDefinitionShape;
            var reps = iPDS.Representations;

            foreach (var rep in reps)
            {
                var iSR      = rep as IfcShapeRepresentation;
                var repItems = rep.Items;
                foreach (var repItem in repItems)
                {
                    var ExtGeo = repItem as IfcExtrudedAreaSolid;
                    if (ExtGeo == null)
                    {
                        continue;
                    }
                    var semExGeo = new BbExtrudedGeometry {
                        IfcGeometricRepresentationItem = ExtGeo, _ifcProductDefinitionShape = iPDS, _ifcShapeRepresentation = iSR
                    };
                    BbInstanceDB.AddToExport(semExGeo);
                    //var profile = BbProfile.Retrieve(semExGeo);
                    //mainPiece.Profile = profile;
                    ret = semExGeo;
                }
            }
            return(ret);
        }
Exemple #20
0
        public static BbProject Create(Guid guid, string name, string description, string objectType, string longname, string phase)
        {
            var p = new BbProject(guid, name, description, objectType, longname, phase);

            BbInstanceDB.AddToExport(p);
            return(p);
        }
        public static BbSingleProperty Create(string name, bool value)
        {
            BbSingleProperty sp = new BbSingleProperty(name, value);

            BbInstanceDB.AddToExport(sp);
            return(sp);
        }
        public static BbQuantityRequired Create()
        {
            var c = new BbQuantityRequired();

            BbInstanceDB.AddToExport(c);
            return(c);
        }
Exemple #23
0
        public static BbWeld Create(BbElement mainElement, BbElement attchedElement)
        {
            var weld = new BbWeld(mainElement, attchedElement);

            BbInstanceDB.AddToExport(weld);
            return(weld);
        }
        public static BbArbitraryProfile Create(BbPolyline2D bbPolyline2D)
        {
            var arb = new BbArbitraryProfile(bbPolyline2D);

            BbInstanceDB.AddToExport(arb);
            return(arb);
        }
Exemple #25
0
        public static BbNamedRectangleProfile Create(double lengthX, double lengthY)
        {
            var rectProfile = new BbNamedRectangleProfile(lengthX, lengthY);

            BbInstanceDB.AddToExport(rectProfile);
            return(rectProfile);
        }
Exemple #26
0
        public static BbPropertyEnumerated Create(string name, bool value)
        {
            var sp = new BbPropertyEnumerated(name, value);

            BbInstanceDB.AddToExport(sp);
            return(sp);
        }
Exemple #27
0
        public static BbNamedIProfile Create(string standard, string name, double width, double depth, double webThickness,
                                             double flangeThickness)
        {
            var namedIProfile = new BbNamedIProfile(name, standard, width, depth, webThickness, flangeThickness);

            BbInstanceDB.AddToExport(namedIProfile);
            return(namedIProfile);
        }
Exemple #28
0
        //		public Position3D (double[] position)
        //			:this(Coordinate3D.Create(position))
        //		{
        //		}

        //		public static Position3D Create ()
        //		{
        //			Position3D position = new Position3D ();
        //
        //			BbInstanceDB.Add (position);
        //			return position;
        //		}


        //		public static Position3D Create (double[] position)
        //		{
        //			Position3D position3D = new Position3D (position);
        //			BbInstanceDB.Add (position3D);
        //			return position3D;
        //		}


        //public static BbPosition3D Create()
        //{
        //    return Create(BbCoordinate3D.Create());
        //}

        //public static BbPosition3D Create(BbCoordinate3D coordinate3D)
        //{
        //    BbPosition3D position3D = new BbPosition3D(coordinate3D);
        //    BbInstanceDB.AddToExport(position3D);
        //    return position3D;
        //}

        public static BbPosition3D Create(BbCoordinate3D coordinate3D,
                                          BbDirection3D axis, BbDirection3D refDirection)
        {
            BbPosition3D position = new BbPosition3D(coordinate3D, axis, refDirection);

            BbInstanceDB.AddToExport(position);
            return(position);
        }
        public static BbSingleProperty Create(string name, string value, bool IsLabel)
        {
            BbSingleProperty sp;

            sp = IsLabel ? new BbSingleProperty(name, value, typeof(IfcLabel)) : new BbSingleProperty(name, value, typeof(IfcText));
            BbInstanceDB.AddToExport(sp);
            return(sp);
        }
Exemple #30
0
        ///// <summary>
        /////
        ///// </summary>
        ///// <param name="type">one of SemSurfaceTreatmentProperties</param>
        //public BbPaintFinish()
        //{

        //    IfcCovering = new IfcCovering
        //    {
        //        GlobalId = IfcGloballyUniqueId.NewGuid(),
        //        OwnerHistory = BbHeaderSetting.Setting3D.IfcOwnerHistory,
        //        //Name = name,
        //        ObjectType = "FINISH",
        //        //Tag = id,
        //        PredefinedType = IfcCoveringTypeEnum.USERDEFINED,
        //        /// set propertySet value with type parameter value
        //    };
        //}



        //public BbPaintFinish(IfcCovering paint, IfcRelCoversBldgElements agg)
        //{
        //    IfcCovering = paint;
        //    IfcRelCoversBldgElements = agg;

        //}

        /// <summary>
        ///
        /// </summary>
        /// <param name="type">BLASTED, GALVANIZED, PAINTED, PRIMED or ETC</param>
        /// <returns></returns>
        public static BbPaintFinish Create(string type)
        {
            var paintFinish = new BbPaintFinish(type);

            BbInstanceDB.AddToExport(paintFinish);

            return(paintFinish);
        }