Ejemplo n.º 1
0
        public void UpdateShaftAngle(ElementId id, bool isEdit)
        {
            XYZ    basicZ     = XYZ.BasisZ;
            Line   axis       = Line.CreateBound((_origin), (_origin + basicZ));
            double localAngle = 0;

            if (_comparionCoupleElement.LocalGeometry != null)
            {
                localAngle = ConvertOpenningStringToObjectReVit.getAngle(_comparionCoupleElement.LocalGeometry.Direction);
            }
            if (localAngle >= Math.PI)
            {
                localAngle = localAngle - Math.PI;
            }
            double lastestAngle = _angle;

            if (lastestAngle >= Math.PI)
            {
                lastestAngle = lastestAngle - Math.PI;
            }
            double angle = lastestAngle - localAngle;

            if (isEdit == true)
            {
                ElementTransformUtils.RotateElement(_document, id, axis, angle);
            }
            else
            {
                ElementTransformUtils.RotateElement(_document, id, axis, lastestAngle);
            }
        }
Ejemplo n.º 2
0
        private void UpdateAngle(ElementId id)
        {
            XYZ    basicZ     = XYZ.BasisZ;
            Line   axis       = Line.CreateBound((_origin), (_origin + basicZ));
            double localAngle = 0;

            if (_comparionCoupleElement.LocalGeometry != null)
            {
                localAngle = ConvertOpenningStringToObjectReVit.getAngle(_comparionCoupleElement.LocalGeometry.Direction);
            }
            double angle = _angle - localAngle;

            ElementTransformUtils.RotateElement(_doc, id, axis, angle);
        }
Ejemplo n.º 3
0
 private void GetValueGeometry(GeometryDetail openingData)
 {
     _shapeProfile = ConvertOpenningStringToObjectReVit.GetShapeFromGeometry(openingData.Geometry);
     _origin       = ConvertOpenningStringToObjectReVit.GetOriginal(openingData.Original);
     _height       = ConvertOpenningStringToObjectReVit.GetHeightFromGeometry(openingData.Geometry) / Define.mmToFeet;
     _direction    = ConvertOpenningStringToObjectReVit.getDirection(openingData.Direction);
     _angle        = ConvertOpenningStringToObjectReVit.getAngle(openingData.Direction);
     if (_shapeProfile == Define.RECTANGLE_FAMILY)
     {
         _lenght = ConvertOpenningStringToObjectReVit.GetLengthFromGeometry(openingData.Geometry) / Define.mmToFeet;
         _width  = ConvertOpenningStringToObjectReVit.GetWidthFromGeometry(openingData.Geometry) / Define.mmToFeet;
     }
     else if (_shapeProfile == Define.CYLYNDER_FAMILY)
     {
         _radius = ConvertOpenningStringToObjectReVit.GetRadiusFromGeometry(openingData.Geometry) / Define.mmToFeet;
     }
 }
Ejemplo n.º 4
0
        public bool IsSameDirection()
        {
            if (ImplementCheckNullValue() != 0)
            {
                return(false);
            }
            double localAngle      = ConvertOpenningStringToObjectReVit.getAngle(LocalGeometry.Direction);
            double serverAngle     = ConvertOpenningStringToObjectReVit.getAngle(ServerGeometry.Direction);
            XYZ    localDirection  = ConvertOpenningStringToObjectReVit.getDirection(LocalGeometry.Direction);
            XYZ    serverDirection = ConvertOpenningStringToObjectReVit.getDirection(ServerGeometry.Direction);

            if (Common.IsEqual(localAngle, serverAngle) == true && (Common.IsEqual(localDirection, serverDirection) == true) || Common.IsEqual(localDirection.Negate(), serverDirection))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }