/// <summary>
        /// 创建自动剖面;
        /// </summary>
        public void CreateSection()
        {
            GetDrawingViewInfo();

            if (mFrontView == null)
            {
                return;
            }

            DeleteAllSection();
            DeleteAllSectionMark();
            InitFrontView();

            if (CMrBeamDoorManager.GetInstance().mType == MrBeamDoorType.TypeNormal)
            {
                BuildNormalNeedSectionPartList();
                CreateNormalSection();
            }
            else if (CMrBeamDoorManager.GetInstance().mType == MrBeamDoorType.TypeMiddle1 ||
                     CMrBeamDoorManager.GetInstance().mType == MrBeamDoorType.TypeMiddle2 ||
                     CMrBeamDoorManager.GetInstance().mType == MrBeamDoorType.TypeMiddle3)
            {
                BuildMiddleNeedSectionPartList();
                CreateMiddleSection();
            }
            mAssemblyDrawing.PlaceViews();
            mAssemblyDrawing.Modify();
        }
Exemple #2
0
        /// <summary>
        /// 框架结构的一键标注;
        /// </summary>
        /// <param name="nType"></param>
        public void DrawDrawingOneKey(string strDimType)
        {
            DrawingHandler drawingHandler = new DrawingHandler();
            Drawing        drawing        = drawingHandler.GetActiveDrawing();

            if (null == drawing)
            {
                return;
            }
            AssemblyDrawing assemblyDrawing = drawing as AssemblyDrawing;

            if (assemblyDrawing == null)
            {
                return;
            }
//             try
//             {
            Assembly assembly = new Assembly
            {
                Identifier = assemblyDrawing.AssemblyIdentifier
            };

            assembly.Select();
            Identifier identifier = assembly.GetMainPart().Identifier;

            TSM.Part modelObject = mModel.SelectModelObject(identifier) as TSM.Part;

            //1.首先创建自动剖面;
            if (CCommonPara.mAutoSectionType == MrAutoSectionType.MrOneKeyDim || CCommonPara.mAutoSectionType == MrAutoSectionType.MrTwoTypeDim)
            {
                CreateAutoSection(strDimType, modelObject, assemblyDrawing);
            }

            //2.对图纸进行标注;
            DrawingObjectEnumerator allViews = assemblyDrawing.GetSheet().GetAllViews();

            while (allViews.MoveNext())
            {
                if (allViews.Current != null)
                {
                    TSD.View view = allViews.Current as TSD.View;

                    if (view != null)
                    {
                        DrawDrawingByView(view, modelObject, strDimType);
                    }
                }
            }
            assemblyDrawing.IsFrozen = true;
            assemblyDrawing.PlaceViews();
            assemblyDrawing.Modify();
//             }
//             catch (System.Exception ex)
//             {
//                 string strName = assemblyDrawing.Name;
//                 MessageBox.Show("图纸" + strName + "标注失败,请确认模型或图纸内是否有问题。异常信息:" + ex.Message);
//             }

            MessageBox.Show("扬州Tekla培训石头哥提示您标注结束,感谢您对智能标注系统的支持。");
        }
Exemple #3
0
        /// <summary>
        /// 绘制门式框架结构中选择的多张图纸;
        /// </summary>
        public void DrawSelectListDrawingDoor()
        {
            DrawingHandler drawingHandler = new DrawingHandler();

            foreach (CMrAssemblyDrawing mrDrawing in mrAssemblyDrawingList)
            {
                AssemblyDrawing assemblyDrawing = mrDrawing.mAssemblyDring;

                Identifier assemblyDrawingIdentifier = assemblyDrawing.AssemblyIdentifier;

                if (assemblyDrawing == null)
                {
                    continue;
                }
                try
                {
                    Assembly assembly = new Assembly
                    {
                        Identifier = assemblyDrawing.AssemblyIdentifier
                    };

                    assembly.Select();
                    Identifier identifier  = assembly.GetMainPart().Identifier;
                    Beam       modelObject = mModel.SelectModelObject(identifier) as Beam;
                    drawingHandler.SetActiveDrawing(assemblyDrawing, true);
                    DrawingObjectEnumerator allViews = assemblyDrawing.GetSheet().GetAllViews();

                    while (allViews.MoveNext())
                    {
                        if (allViews.Current != null)
                        {
                            TSD.View view = allViews.Current as TSD.View;

                            if (view != null)
                            {
                                DrawDrawingDoorByView(view, modelObject, mrDrawing.mDimType);
                            }
                        }
                    }
                    assemblyDrawing.IsFrozen = true;
                    assemblyDrawing.PlaceViews();
                    assemblyDrawing.Modify();
                    drawingHandler.SaveActiveDrawing();
                    drawingHandler.CloseActiveDrawing();
                }
                catch (System.Exception ex)
                {
                    string strName = assemblyDrawing.Name;

                    MessageBox.Show("图纸" + strName + "标注失败,请确认模型或图纸内是否有问题。异常信息:" + ex.Message);
                    drawingHandler.SaveActiveDrawing();
                    drawingHandler.CloseActiveDrawing();
                    continue;
                }
            }
            MessageBox.Show("扬州Tekla培训石头哥提示您标注结束,感谢您对智能标注系统的支持。");
        }
        /// <summary>
        /// 创建自动剖面;
        /// </summary>
        public void CreateSection()
        {
            GetDrawingViewInfo();

            if (mFrontView == null)
            {
                return;
            }

            DeleteAllSection();
            DeleteAllSectionMark();

            InitFrontView();
            BuildNeedSectionPartList();
            CreateAllPartSection();

            mAssemblyDrawing.PlaceViews();
            mAssemblyDrawing.Modify();
        }
Exemple #5
0
        /// <summary>
        /// 门式框架结构的一键标注;
        /// </summary>
        /// <param name="nType"></param>
        public void DrawDrawingDoorOneKey(string strDimType)
        {
            DrawingHandler drawingHandler = new DrawingHandler();
            Drawing        drawing        = drawingHandler.GetActiveDrawing();

            if (null == drawing)
            {
                return;
            }
            AssemblyDrawing assemblyDrawing = drawing as AssemblyDrawing;

            if (assemblyDrawing == null)
            {
                return;
            }
            try
            {
                Assembly assembly = new Assembly
                {
                    Identifier = assemblyDrawing.AssemblyIdentifier
                };

                assembly.Select();
                Identifier identifier  = assembly.GetMainPart().Identifier;
                TSM.Part   modelObject = mModel.SelectModelObject(identifier) as TSM.Part;

                if (modelObject == null)
                {
                    MessageBox.Show("标注失败,无法获取主梁对象!");
                    return;
                }

                //1.首先创建门刚的自动剖面;
                //CreateAutoSectionDoor(strDimType, modelObject, assemblyDrawing);

                DrawingObjectEnumerator allViews = assemblyDrawing.GetSheet().GetAllViews();

                while (allViews.MoveNext())
                {
                    if (allViews.Current != null)
                    {
                        TSD.View view = allViews.Current as TSD.View;

                        if (view != null)
                        {
                            DrawDrawingDoorByView(view, modelObject, strDimType);
                        }
                    }
                }
                assemblyDrawing.IsFrozen = true;
                assemblyDrawing.PlaceViews();
                assemblyDrawing.Modify();
            }
            catch (System.Exception ex)
            {
                string strName = assemblyDrawing.Name;

                MessageBox.Show("图纸" + strName + "标注失败,请确认模型或图纸内是否有问题。异常信息:" + ex.Message);
            }

            MessageBox.Show("扬州Tekla培训石头哥提示您标注结束,感谢您对智能标注系统的支持。");
        }
Exemple #6
0
        /// <summary>
        /// 线程图纸标注函数;
        /// </summary>
        /// <param name="message"></param>
        private void DimDrawingThreadFunc(object message)
        {
            DrawingHandler drawingHandler = new DrawingHandler();

            int nIndex = 0;
            int nCount = mrAssemblyDrawingList.Count;

            mMainForm.SetWholeProgressMax(nCount);

            string strCurrentTips = "";
            string strWholeTips   = "";

            foreach (CMrAssemblyDrawing mrDrawing in mrAssemblyDrawingList)
            {
                nIndex++;
                mMainForm.SetWholeProgressPos(nIndex);
                strWholeTips = "总进度:" + nIndex + "/" + nCount.ToString();
                mMainForm.SetWholeLabelText(strWholeTips);

                int             nViewIndex                = 0;
                AssemblyDrawing assemblyDrawing           = mrDrawing.mAssemblyDring;
                Identifier      assemblyDrawingIdentifier = assemblyDrawing.AssemblyIdentifier;

                if (assemblyDrawing == null)
                {
                    continue;
                }
                try
                {
                    Assembly assembly = new Assembly
                    {
                        Identifier = assemblyDrawing.AssemblyIdentifier
                    };

                    assembly.Select();
                    Identifier identifier  = assembly.GetMainPart().Identifier;
                    Beam       modelObject = mModel.SelectModelObject(identifier) as Beam;
                    drawingHandler.SetActiveDrawing(assemblyDrawing, true);
                    DrawingObjectEnumerator allViews = assemblyDrawing.GetSheet().GetAllViews();

                    //1.判断是否需要创建自动剖面;
                    if (CCommonPara.mAutoSectionType == MrAutoSectionType.MrListDim || CCommonPara.mAutoSectionType == MrAutoSectionType.MrTwoTypeDim)
                    {
                        CreateAutoSection(mrDrawing.mDimType, modelObject, assemblyDrawing);
                    }

                    int nViewCount = allViews.GetSize();
                    mMainForm.SetCurrentProgressMax(nViewCount);

                    while (allViews.MoveNext())
                    {
                        if (allViews.Current != null)
                        {
                            nViewIndex++;
                            mMainForm.SetCurrentProgressPos(nViewIndex);
                            strCurrentTips = "当前进度:" + nViewIndex + "/" + nViewCount.ToString();
                            mMainForm.SetCurrentLabelText(strCurrentTips);

                            TSD.View view = allViews.Current as TSD.View;
                            if (view != null)
                            {
                                DrawDrawingByView(view, modelObject, mrDrawing.mDimType);
                            }
                        }
                    }
                    assemblyDrawing.IsFrozen = true;
                    assemblyDrawing.PlaceViews();
                    assemblyDrawing.Modify();
                    drawingHandler.SaveActiveDrawing();
                    drawingHandler.CloseActiveDrawing();
                }
                catch (System.Exception ex)
                {
                    string strName = assemblyDrawing.Name;
                    MessageBox.Show("图纸" + strName + "标注失败,请确认模型或图纸内是否有问题。异常信息:" + ex.Message);
                    drawingHandler.SaveActiveDrawing();
                    drawingHandler.CloseActiveDrawing();

                    nIndex++;
                    mMainForm.SetWholeProgressPos(nIndex);
                    strWholeTips = "总进度:" + nIndex + "/" + nCount.ToString();
                    mMainForm.SetWholeLabelText(strWholeTips);
                    continue;
                }
            }

            MessageBox.Show("扬州Tekla培训石头哥提示您标注结束,感谢您对智能标注系统的支持。");
        }