private void UpdateDirection(ElementId id, OpeningModel openningModel)
        {
            XYZ    basicZ    = XYZ.BasisZ;
            XYZ    direction = ConvertOpenningStringToObjectReVit.getDirection(openningModel.Geometry.Direction);
            XYZ    axisVec   = basicZ.CrossProduct(direction);
            Line   axis      = Line.CreateBound(axisVec, axisVec * 2);
            double angle     = basicZ.AngleOnPlaneTo(direction, axisVec);

            ElementTransformUtils.RotateElement(_doc, id, axis, angle);
        }
示例#2
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;
     }
 }
示例#3
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);
            }
        }