Example #1
0
 protected BbDrillHoles(
     BbElement hostElement,
     BbCoordinate2D position,
     double radius,
     SemHoleLocation location,
     bool through
     )
     : base(hostElement, position, BbBbNamedCircleProfile.Create(radius), location, through, "Drill Hole")
 {
 }
Example #2
0
        protected BbDrillHoles(
			BbElement hostElement,
			BbCoordinate2D position,
			double radius,
			SemHoleLocation location,
			bool through
		)
            : base(hostElement, position, BbBbNamedCircleProfile.Create(radius), location, through, "Drill Hole")
        {
        }
Example #3
0
 public static BbDrillHoles Create(BbElement hostElement,
                         BbCoordinate2D position,
                         double radius,
                         SemHoleLocation location,
                         bool through)
 {
     var hole = new BbDrillHoles(hostElement, position, radius, location, through);
     BbInstanceDB.AddToExport(hole);
     return hole;
 }
 protected BbRectangleOpening(
     BbElement hostElement,
     BbCoordinate2D position,
     double width,
     double height,
     SemHoleLocation location,
     bool through
     )
     : base(hostElement, position, BbNamedRectangleProfile.Create(width, height), location, through, "Rectangle Opening")
 {
 }
 protected BbRectangleOpening(
     BbElement hostElement,
     BbCoordinate2D position,
     double width,
     double height,
     SemHoleLocation location,
     bool through
     )
     : base(hostElement, position, BbNamedRectangleProfile.Create(width, height), location, through, "Rectangle Opening")
 {
 }
Example #6
0
        public static BbDrillHoles Create(BbElement hostElement,
                                          BbCoordinate2D position,
                                          double radius,
                                          SemHoleLocation location,
                                          bool through)
        {
            var hole = new BbDrillHoles(hostElement, position, radius, location, through);

            BbInstanceDB.AddToExport(hole);
            return(hole);
        }
 public static BbRectangleOpening Create(BbElement hostElement,
                              BbCoordinate2D position,
                              double width,
                              double height,
                              SemHoleLocation location,
                              bool through)
 {
     var hole = new BbRectangleOpening(hostElement, position, width, height, location, through);
     BbInstanceDB.AddToExport(hole);
     return hole;
 }
Example #8
0
        public static BbOpening Create(BbElement hostElement,
                                       BbCoordinate2D position,
                                       BbProfile profile,
                                       SemHoleLocation location,
                                       bool through,
                                       string type)
        {
            var hole = new BbOpening(hostElement, position, profile, location, through, type);

            BbInstanceDB.AddToExport(hole);
            return(hole);
        }
        public static BbRectangleOpening Create(BbElement hostElement,
                                                BbCoordinate2D position,
                                                double width,
                                                double height,
                                                SemHoleLocation location,
                                                bool through)
        {
            var hole = new BbRectangleOpening(hostElement, position, width, height, location, through);

            BbInstanceDB.AddToExport(hole);
            return(hole);
        }
Example #10
0
 protected BbSlottedHole(
     BbElement hostElement,
     BbCoordinate2D position,
     double centerToCenter,
     double radius,
     BbDirection2D refDirection,
     SemHoleLocation location,
     bool through
     )
     : base(hostElement, position, BbSlottedHoleProfile.Create(centerToCenter, radius, refDirection),
     location, through, "Slot Hole")
 {
 }
Example #11
0
 public static BbSlottedHole Create(
     BbElement hostElement,
     BbCoordinate2D position,
     double centerToCenter,
     double radius,
     BbDirection2D refDirection,
     SemHoleLocation location,
     bool through
     )
 {
     var sl = new BbSlottedHole(hostElement, position, centerToCenter, radius, refDirection, location, through);
     BbInstanceDB.AddToExport(sl);
     return sl;
 }
Example #12
0
 protected BbSlottedHole(
     BbElement hostElement,
     BbCoordinate2D position,
     double centerToCenter,
     double radius,
     BbDirection2D refDirection,
     SemHoleLocation location,
     bool through
     )
     : base(
         hostElement, position, BbSlottedHoleProfile.Create(centerToCenter, radius, refDirection),
         location, through, "Slot Hole")
 {
 }
Example #13
0
 public static BbRectangleOpening Create(BbElement hostElement,
                      BbCoordinate2D position,
                      double width,
                      double height,
                      SemHoleLocation location,
                      bool through,
                      BbPropertySet bbPropertySet,
                      string featureSubType,
                      double rectangleOpeningRoundRadius)
 {
     var hole = new BbRectangleOpening(hostElement, position, width, height, location, through);
     hole.AddRectangleOpeningProperty(bbPropertySet, featureSubType, width, height, rectangleOpeningRoundRadius);
     BbInstanceDB.AddToExport(hole);
     return hole;
 }
Example #14
0
        public static BbSlottedHole Create(
            BbElement hostElement,
            BbCoordinate2D position,
            double centerToCenter,
            double radius,
            BbDirection2D refDirection,
            SemHoleLocation location,
            bool through
            )
        {
            var sl = new BbSlottedHole(hostElement, position, centerToCenter, radius, refDirection, location, through);

            BbInstanceDB.AddToExport(sl);
            return(sl);
        }
        public static BbRectangleOpening Create(BbElement hostElement,
                                                BbCoordinate2D position,
                                                double width,
                                                double height,
                                                SemHoleLocation location,
                                                bool through,
                                                BbPropertySet bbPropertySet,
                                                string featureSubType,
                                                double rectangleOpeningRoundRadius)
        {
            var hole = new BbRectangleOpening(hostElement, position, width, height, location, through);

            hole.AddRectangleOpeningProperty(bbPropertySet, featureSubType, width, height, rectangleOpeningRoundRadius);
            BbInstanceDB.AddToExport(hole);
            return(hole);
        }
Example #16
0
 public static BbSlottedHole Create(
     BbElement hostElement,
     BbCoordinate2D position,
     double centerToCenter,
     double radius,
     BbDirection2D refDirection,
     SemHoleLocation location,
     bool through,
     BbPropertySet bbPropertySet,
     string featureSubType
     )
 {
     var sl = new BbSlottedHole(hostElement, position, centerToCenter, radius, refDirection, location, through);
     sl.AddSlottedHoleProperty(bbPropertySet, featureSubType, centerToCenter, centerToCenter + (radius * 2), radius);
     BbInstanceDB.AddToExport(sl);
     return sl;
 }
Example #17
0
        public static BbSlottedHole Create(
            BbElement hostElement,
            BbCoordinate2D position,
            double centerToCenter,
            double radius,
            BbDirection2D refDirection,
            SemHoleLocation location,
            bool through,
            BbPropertySet bbPropertySet,
            string featureSubType
            )
        {
            var sl = new BbSlottedHole(hostElement, position, centerToCenter, radius, refDirection, location, through);

            sl.AddSlottedHoleProperty(bbPropertySet, featureSubType, centerToCenter, centerToCenter + (radius * 2), radius);
            BbInstanceDB.AddToExport(sl);
            return(sl);
        }
Example #18
0
 public static BbOpening Create(BbElement hostElement,
                              BbCoordinate2D position,
                              BbProfile profile,
                              SemHoleLocation location,
                              bool through,
     string type)
 {
     var hole = new BbOpening(hostElement, position, profile, location, through, type);
     BbInstanceDB.AddToExport(hole);
     return hole;
 }
Example #19
0
        protected BbOpening(
            BbElement hostElement,
            BbCoordinate2D position,
            BbProfile profile,
            SemHoleLocation location,
            bool through,
            string type
            )
        {
            var mainPart = hostElement as BbPiece;
            if (mainPart == null)
                return;

            double thickness;
            BbPosition3D pos;

            // x direction follows extrusion direction
            // extrude origin  projected to bottom or left becomes the origin

            switch (location)
            {

                case SemHoleLocation.Left:
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            -(mainPart.Profile.Width / 2),
                            position.Y,
                            position.X),
                        BbHeaderSetting.Setting3D.XAxis,
                        BbHeaderSetting.Setting3D.ZAxis);
                    if (through)
                        thickness = mainPart.Profile.Width;
                    else
                        thickness = mainPart.Profile.Width / 2;
                    break;
                case SemHoleLocation.Right:
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            (mainPart.Profile.Width / 2),
                            position.Y,
                            position.X),
                        BbHeaderSetting.Setting3D.XAxisMinus,
                        BbHeaderSetting.Setting3D.ZAxis);
                    if (through)
                        thickness = mainPart.Profile.Width;
                    else
                        thickness = mainPart.Profile.Width / 2;
                    break;
                case SemHoleLocation.Web:
                    if (through)
                    {
                        pos = BbPosition3D.Create(
                            BbCoordinate3D.Create(
                                (mainPart.Profile.Width / 2),
                                position.Y,
                                position.X
                                ),
                            BbHeaderSetting.Setting3D.XAxisMinus,
                            BbHeaderSetting.Setting3D.ZAxis);
                        thickness = mainPart.Profile.Width;
                    }
                    else
                    {
                        pos = BbPosition3D.Create(
                            BbCoordinate3D.Create(
                                (mainPart.Profile.Width / 4),
                                position.Y,
                                position.X
                                ),
                            BbHeaderSetting.Setting3D.XAxisMinus,
                            BbHeaderSetting.Setting3D.ZAxis);
                        thickness = mainPart.Profile.Width / 2;
                    }
                    break;

                case SemHoleLocation.Bottom:
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            position.Y,
                            -(mainPart.Profile.Depth / 2),
                            position.X
                            ),
                        BbHeaderSetting.Setting3D.YAxis,
                        BbHeaderSetting.Setting3D.ZAxis);
                    if (through)
                        thickness = mainPart.Profile.Depth;
                    else
                        thickness = mainPart.Profile.Depth / 2;
                    break;
                case SemHoleLocation.Top:
                default:
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            position.Y,
                            (mainPart.Profile.Depth / 2),
                            position.X
                            ),
                        BbHeaderSetting.Setting3D.YAxisMinus,
                        BbHeaderSetting.Setting3D.ZAxis);
                    if (through)
                        thickness = mainPart.Profile.Depth;
                    else
                        thickness = mainPart.Profile.Depth / 2;
                    break;
            }

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                hostElement.ObjectBbLocalPlacement, pos);

            BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create(
                profile,
                BbHeaderSetting.Setting3D.DefaultBbPosition3D,
                BbHeaderSetting.Setting3D.ZAxis,
                thickness);

            _ifcOpeningElement = new IfcOpeningElement
                {
                    GlobalId = IfcGloballyUniqueId.NewGuid(),
                    OwnerHistory = hostElement.IfcObject.OwnerHistory,
                    // Name =
                    // Description =
                    ObjectType = "Opening",
                    ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement,
                    Representation = bbExtrudedGeometry.IfcProductDefinitionShape,
                };

            _ifcRelVoidsElement = new IfcRelVoidsElement
                {
                    GlobalId = IfcGloballyUniqueId.NewGuid(),
                    OwnerHistory = hostElement.IfcObject.OwnerHistory,
                    Name = type,
                    RelatingBuildingElement = hostElement.IfcObject as IfcElement,
                    RelatedOpeningElement = _ifcOpeningElement,
                };
        }
Example #20
0
        protected BbOpening(
            BbElement hostElement,
            BbCoordinate2D position,
            BbProfile profile,
            SemHoleLocation location,
            bool through,
            string type
            )
        {
            var mainPart = hostElement as BbPiece;

            if (mainPart == null)
            {
                return;
            }


            double       thickness;
            BbPosition3D pos;

            // x direction follows extrusion direction
            // extrude origin  projected to bottom or left becomes the origin

            switch (location)
            {
            case SemHoleLocation.Left:
                pos = BbPosition3D.Create(
                    BbCoordinate3D.Create(
                        -(mainPart.Profile.Width / 2),
                        position.Y,
                        position.X),
                    BbHeaderSetting.Setting3D.XAxis,
                    BbHeaderSetting.Setting3D.ZAxis);
                if (through)
                {
                    thickness = mainPart.Profile.Width;
                }
                else
                {
                    thickness = mainPart.Profile.Width / 2;
                }
                break;

            case SemHoleLocation.Right:
                pos = BbPosition3D.Create(
                    BbCoordinate3D.Create(
                        (mainPart.Profile.Width / 2),
                        position.Y,
                        position.X),
                    BbHeaderSetting.Setting3D.XAxisMinus,
                    BbHeaderSetting.Setting3D.ZAxis);
                if (through)
                {
                    thickness = mainPart.Profile.Width;
                }
                else
                {
                    thickness = mainPart.Profile.Width / 2;
                }
                break;

            case SemHoleLocation.Web:
                if (through)
                {
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            (mainPart.Profile.Width / 2),
                            position.Y,
                            position.X
                            ),
                        BbHeaderSetting.Setting3D.XAxisMinus,
                        BbHeaderSetting.Setting3D.ZAxis);
                    thickness = mainPart.Profile.Width;
                }
                else
                {
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            (mainPart.Profile.Width / 4),
                            position.Y,
                            position.X
                            ),
                        BbHeaderSetting.Setting3D.XAxisMinus,
                        BbHeaderSetting.Setting3D.ZAxis);
                    thickness = mainPart.Profile.Width / 2;
                }
                break;

            case SemHoleLocation.Bottom:
                pos = BbPosition3D.Create(
                    BbCoordinate3D.Create(
                        position.Y,
                        -(mainPart.Profile.Depth / 2),
                        position.X
                        ),
                    BbHeaderSetting.Setting3D.YAxis,
                    BbHeaderSetting.Setting3D.ZAxis);
                if (through)
                {
                    thickness = mainPart.Profile.Depth;
                }
                else
                {
                    thickness = mainPart.Profile.Depth / 2;
                }
                break;

            case SemHoleLocation.Top:
            default:
                pos = BbPosition3D.Create(
                    BbCoordinate3D.Create(
                        position.Y,
                        (mainPart.Profile.Depth / 2),
                        position.X
                        ),
                    BbHeaderSetting.Setting3D.YAxisMinus,
                    BbHeaderSetting.Setting3D.ZAxis);
                if (through)
                {
                    thickness = mainPart.Profile.Depth;
                }
                else
                {
                    thickness = mainPart.Profile.Depth / 2;
                }
                break;
            }

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                hostElement.ObjectBbLocalPlacement, pos);

            BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create(
                profile,
                BbHeaderSetting.Setting3D.DefaultBbPosition3D,
                BbHeaderSetting.Setting3D.ZAxis,
                thickness);

            _ifcOpeningElement = new IfcOpeningElement
            {
                GlobalId     = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory = hostElement.IfcObject.OwnerHistory,
                // Name =
                // Description =
                ObjectType      = "Opening",
                ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement,
                Representation  = bbExtrudedGeometry.IfcProductDefinitionShape,
            };

            _ifcRelVoidsElement = new IfcRelVoidsElement
            {
                GlobalId                = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory            = hostElement.IfcObject.OwnerHistory,
                Name                    = type,
                RelatingBuildingElement = hostElement.IfcObject as IfcElement,
                RelatedOpeningElement   = _ifcOpeningElement,
            };
        }