示例#1
0
        /// <summary>
        /// 标注工作点到主零件的距离之间尺寸;
        /// </summary>
        public void DrawWorkPointToMainPartDimX()
        {
            CBeamTopViewSetting beamTopViewSetting = CBeamDimSetting.GetInstance().mTopViewSetting;

            bool bMarkValue = beamTopViewSetting.FindMarkValueByName(CBeamTopViewSetting.mstrWorkPointToMainPart);

            mMainBeam.SetNeedAddMarkFlag(bMarkValue);

            //1.判断是否需要标注主梁与工作点之间的距离,采用一道尺寸来进行标注;
            bool bNeedDimWpToMainPart = beamTopViewSetting.FindDimValueByName(CBeamTopViewSetting.mstrWorkPointToMainPart);

            if (!bNeedDimWpToMainPart)
            {
                return;
            }

            Point mainBeamMinX   = CMrMainBeam.GetInstance().GetMinXPoint();
            Point mainBeamMaxX   = CMrMainBeam.GetInstance().GetMaxXPoint();
            Point leftWorkPoint  = CMrMainBeam.GetInstance().mLeftWorkPoint;
            Point rightWorkPoint = CMrMainBeam.GetInstance().mRightWorkPoint;

            bMarkValue = beamTopViewSetting.FindMarkValueByName(CBeamTopViewSetting.mstrWorkPointToWorkPoint);
            mMainBeam.SetNeedAddMarkFlag(bMarkValue);

            //2.如果工作点到工作点需要进行标注,而主部件左右侧与工作点的左右侧的距离都为0则不需要标注;
            bool bNeedWorkPtToWorkPt = beamTopViewSetting.FindDimValueByName(CBeamTopViewSetting.mstrWorkPointToWorkPoint);

            if (bNeedWorkPtToWorkPt)
            {
                double xDistanceLeft  = Math.Abs(mainBeamMinX.X - leftWorkPoint.X);
                double xDistanceRight = Math.Abs(mainBeamMaxX.X - rightWorkPoint.X);

                if (xDistanceLeft < CCommonPara.mDblError && xDistanceRight < CCommonPara.mDblError)
                {
                    return;
                }
            }

            PointList pointList = new PointList();

            pointList.Add(leftWorkPoint);
            pointList.Add(rightWorkPoint);
            pointList.Add(mainBeamMinX);
            pointList.Add(mainBeamMaxX);

            Vector upDimVector = new Vector(0, 1, 0);

            mUpDimDistance = GetUpDimDistance(leftWorkPoint);
            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, mUpDimDistance, CCommonPara.mMainSizeDimPath);
        }
示例#2
0
        /// <summary>
        /// 标注工作点到工作点之间的尺寸;
        /// </summary>
        public void DrawWorkPointToWorkPointDimX()
        {
            CBeamTopViewSetting beamTopViewSetting = CBeamDimSetting.GetInstance().mTopViewSetting;

            PointList pointList = new PointList();

            bool bMarkValue = beamTopViewSetting.FindMarkValueByName(CBeamTopViewSetting.mstrWorkPointToWorkPoint);

            mMainBeam.SetNeedAddMarkFlag(bMarkValue);

            //1.判断工作点与工作点之间是否需要标注,需要标注的话是一道单尺寸;
            bool bNeedDimWpToWp = beamTopViewSetting.FindDimValueByName(CBeamTopViewSetting.mstrWorkPointToWorkPoint);

            if (bNeedDimWpToWp)
            {
                Point leftWorkPoint  = CMrMainBeam.GetInstance().mLeftWorkPoint;
                Point rightWorkPoint = CMrMainBeam.GetInstance().mRightWorkPoint;

                pointList.Add(leftWorkPoint);
                pointList.Add(rightWorkPoint);

                Vector upDimVector = new Vector(0, 1, 0);
                mUpDimDistance = GetUpDimDistance(leftWorkPoint);
                CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, mUpDimDistance, CCommonPara.mMainSizeDimPath);
            }
        }
示例#3
0
        /// <summary>
        /// 绘制主梁上螺钉的标记;
        /// </summary>
        public void DrawMainPartBoltMark()
        {
            CBeamTopViewSetting beamTopViewSetting = CBeamDimSetting.GetInstance().mTopViewSetting;

            bool bNeedMark = beamTopViewSetting.FindMarkValueByName(CBeamTopViewSetting.mstrBolt);

            if (!bNeedMark)
            {
                return;
            }

            List <CMrBoltArray> mrBoltArrayList = mMainBeam.GetBoltArrayList();

            Vector zVector = new Vector(0, 0, 1);

            DrawingHandler drawingHandler = new DrawingHandler();

            TSD.UI.DrawingObjectSelector DS = drawingHandler.GetDrawingObjectSelector();

            foreach (CMrBoltArray mrBoltArray in mrBoltArrayList)
            {
                //只有与Z轴平行的螺钉组才进行编号;
                if (!CDimTools.GetInstance().IsTwoVectorParallel(zVector, mrBoltArray.mNormal))
                {
                    continue;
                }
                DS.SelectObject(mrBoltArray.mBoltInDrawing);
            }
            CDimTools.GetInstance().DrawMarkByMacro();
        }
示例#4
0
        /// <summary>
        /// 标注主零件的长度尺寸;
        /// </summary>
        public void DrawMainPartLengthDimX()
        {
            CBeamTopViewSetting beamTopViewSetting = CBeamDimSetting.GetInstance().mTopViewSetting;

            //1.判断是否需要标注主梁的长度,如果需要采用单一的一道总尺寸;
            bool bNeedDimMainPartLength = beamTopViewSetting.FindDimValueByName(CBeamTopViewSetting.mstrMainPartLength);

            bool bMarkValue = beamTopViewSetting.FindMarkValueByName(CBeamTopViewSetting.mstrMainPartLength);

            mMainBeam.SetNeedAddMarkFlag(bMarkValue);

            if (!bNeedDimMainPartLength)
            {
                return;
            }

            Point minXPoint = mMainBeam.GetMinXPoint();
            Point maxXPoint = mMainBeam.GetMaxXPoint();

            bMarkValue = beamTopViewSetting.FindMarkValueByName(CBeamTopViewSetting.mstrWorkPointToWorkPoint);
            mMainBeam.SetNeedAddMarkFlag(bMarkValue);

            //2.如果需要标注工作点到工作点,并且主部件与工作点的距离左边或者右边为0,或者都为0时则不标注主部件长度;
            bool bNeedWorkPtToWorkPt = beamTopViewSetting.FindDimValueByName(CBeamTopViewSetting.mstrWorkPointToWorkPoint);

            if (bNeedWorkPtToWorkPt)
            {
                double xDistanceLeft  = Math.Abs(minXPoint.X - CMrMainBeam.GetInstance().mLeftWorkPoint.X);
                double xDistanceRight = Math.Abs(maxXPoint.X - CMrMainBeam.GetInstance().mRightWorkPoint.X);

                if (xDistanceLeft < CCommonPara.mDblError || xDistanceRight < CCommonPara.mDblError)
                {
                    return;
                }
            }

            PointList pointList = new PointList();

            pointList.Add(minXPoint);
            pointList.Add(maxXPoint);
            Vector upDimVector = new Vector(0, 1, 0);

            mUpDimDistance = GetUpDimDistance(minXPoint);
            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, mUpDimDistance, CCommonPara.mMainSizeDimPath);
        }