예제 #1
0
        public static void Run(Tekla.Technology.Akit.IScript akit)
        {
            try
            {
                Model                   model             = new Model();
                DrawingHandler          drawingHandler    = new DrawingHandler();
                DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected();
                ArrayList               ModelObjectArray  = new ArrayList();

                if (drawingObjectEnum.GetSize() > 0)
                {
                    while (drawingObjectEnum.MoveNext())
                    {
                        if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Part)
                        {
                            Tekla.Structures.Drawing.Part part = drawingObjectEnum.Current as Tekla.Structures.Drawing.Part;
                            ModelObjectArray.Add(model.SelectModelObject(new Identifier(part.ModelIdentifier.ID)));
                        }
                        if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Bolt)
                        {
                            Tekla.Structures.Drawing.Bolt bolt = drawingObjectEnum.Current as Tekla.Structures.Drawing.Bolt;
                            ModelObjectArray.Add(model.SelectModelObject(new Identifier(bolt.ModelIdentifier.ID)));
                        }
                    }
                }

                Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector();
                modelObjectSelector.Select(ModelObjectArray);
                akit.Callback("acmd_display_selected_object_dialog", "", "main_frame");
            }
            catch { }
        }
예제 #2
0
        public TsPart(TSD.Part drawingPart)
        {
            _drawingPart = drawingPart;
            TSM.Part modelPart =
                Extensions.GetModelObjectFromDrawingObject(_drawingPart) as TSM.Part;

            modelPart.GetReportProperty("WIDTH", ref width);
            modelPart.GetReportProperty("HEIGHT", ref height);
            modelPart.GetReportProperty("LENGTH", ref length);

            var   partCLPoints = modelPart.GetCenterLine(false);
            Point partStartP   = partCLPoints[0] as Point;
            Point partEndP;

            if (!(modelPart is TSM.ContourPlate))
            {
                partEndP = partCLPoints[partCLPoints.Count - 1] as Point;
            }
            else
            {
                partEndP = partCLPoints[partCLPoints.Count - 2] as Point;
            }
            partStart = new double[3] {
                partStartP.X, partStartP.Y, partStartP.Z
            };
            partEnd = new double[3] {
                partEndP.X, partEndP.Y, partEndP.Z
            };

            partCS = modelPart.GetCoordinateSystem();
            origin =
                new Point((partEnd[0] + partStart[0]) / 2,
                          (partEnd[1] + partStart[1]) / 2,
                          (partEnd[2] + partStart[2]) / 2);
        }
        public static void Run(Tekla.Technology.Akit.IScript akit)
        {
            Model model = new Model();
            //Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector();
            DrawingHandler          dh  = new DrawingHandler();
            DrawingObjectEnumerator doe = dh.GetDrawingObjectSelector().GetSelected();

            while (doe.MoveNext())
            {
                string CONN_CODE_END1 = "", CONN_CODE_END2 = "";
                if (doe.Current is Tekla.Structures.Drawing.Part)
                {
                    Tekla.Structures.Drawing.Part dPart = (Tekla.Structures.Drawing.Part)doe.Current;
                    Tekla.Structures.Model.Part   mPart = (Tekla.Structures.Model.Part)model.SelectModelObject((Identifier)dPart.ModelIdentifier);
                    if (mPart is Beam)
                    {
                        Beam     beam = (Beam)mPart;
                        ViewBase view = dPart.GetView();
                        mPart.GetUserProperty("CONN_CODE_END1", ref CONN_CODE_END1);
                        mPart.GetUserProperty("CONN_CODE_END2", ref CONN_CODE_END2);

                        if (CONN_CODE_END1 != "")
                        {
                            Tekla.Structures.Drawing.Text text = new Tekla.Structures.Drawing.Text(view, beam.StartPoint + new Point(200, 200), CONN_CODE_END1, new LeaderLinePlacing(beam.StartPoint));
                            text.Insert();
                        }
                        if (CONN_CODE_END2 != "")
                        {
                            Tekla.Structures.Drawing.Text text = new Tekla.Structures.Drawing.Text(view, beam.EndPoint + new Point(200, 200), CONN_CODE_END2, new LeaderLinePlacing(beam.EndPoint));
                            text.Insert();
                        }
                    }
                }
            }
        }
예제 #4
0
        internal static string GetPartProfileType(TSD.Part drawingPart)
        {
            TSM.Part modelPart = SelectModelObject(drawingPart.ModelIdentifier.ID)
                                 as TSM.Part;
            string profileType = String.Empty;

            modelPart.GetReportProperty("PROFILE_TYPE", ref profileType);
            return(profileType);
        }
예제 #5
0
        private void GetIdNumbers_Click(object sender, EventArgs e)
        {
            Model model = new Model();

            Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector();
            Drawing drawing = drawingHandler.GetActiveDrawing();
            DrawingObjectEnumerator drawingObjectEnumerator = drawingHandler.GetDrawingObjectSelector().GetSelected();
            ArrayList SelectedObjectArray = new ArrayList();
            ArrayList MarkArray           = new ArrayList();

            while (drawingObjectEnumerator.MoveNext())
            {
                if (drawingObjectEnumerator.Current is Tekla.Structures.Drawing.Part)
                {
                    Tekla.Structures.Drawing.Part part = drawingObjectEnumerator.Current as Tekla.Structures.Drawing.Part;
                    SelectedObjectArray.Add(model.SelectModelObject(new Identifier(part.ModelIdentifier.ID)));
                    DrawingObjectArray.Add(part);
                }
                if (drawingObjectEnumerator.Current is Tekla.Structures.Drawing.Bolt)
                {
                    Tekla.Structures.Drawing.Bolt bolt = drawingObjectEnumerator.Current as Tekla.Structures.Drawing.Bolt;
                    SelectedObjectArray.Add(model.SelectModelObject(new Identifier(bolt.ModelIdentifier.ID)));
                    DrawingObjectArray.Add(bolt);
                }
            }
            modelObjectSelector.Select(SelectedObjectArray);
            Tekla.Structures.Model.ModelObjectEnumerator modelObjectEnumerator = model.GetModelObjectSelector().GetSelectedObjects();
            while (modelObjectEnumerator.MoveNext())
            {
                if (modelObjectEnumerator.Current is Tekla.Structures.Model.Part)
                {
                    Tekla.Structures.Model.Part modelPart = modelObjectEnumerator.Current as Tekla.Structures.Model.Part;
                    MarkArray.Add(modelPart.Identifier.ID.ToString());
                }
                if (modelObjectEnumerator.Current is Tekla.Structures.Model.BoltGroup)
                {
                    Tekla.Structures.Model.BoltGroup modelBolt = modelObjectEnumerator.Current as Tekla.Structures.Model.BoltGroup;
                    MarkArray.Add(modelBolt.Identifier.ID.ToString());
                }
            }
            MarkArray.Sort();
            string MarkList = "";

            foreach (string strMark in MarkArray)
            {
                MarkList = strMark + " " + MarkList;
            }
            Clipboard.SetDataObject(MarkList); richTextBox1.Text = MarkList;
            drawingHandler.GetDrawingObjectSelector().SelectObjects(DrawingObjectArray, false);
        }
예제 #6
0
        private void GetMarks(string MarkType)
        {
            Model model = new Model();

            Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector();
            Drawing drawing = drawingHandler.GetActiveDrawing();
            DrawingObjectEnumerator drawingObjectEnumerator = drawingHandler.GetDrawingObjectSelector().GetSelected();
            ArrayList SelectedObjectArray = new ArrayList();
            ArrayList MarkArray           = new ArrayList();

            while (drawingObjectEnumerator.MoveNext())
            {
                if (drawingObjectEnumerator.Current is Tekla.Structures.Drawing.Part)
                {
                    Tekla.Structures.Drawing.Part part = drawingObjectEnumerator.Current as Tekla.Structures.Drawing.Part;
                    SelectedObjectArray.Add(model.SelectModelObject(new Identifier(part.ModelIdentifier.ID)));
                    DrawingObjectArray.Add(part);
                }
            }
            modelObjectSelector.Select(SelectedObjectArray);
            Tekla.Structures.Model.ModelObjectEnumerator modelObjectEnumerator = model.GetModelObjectSelector().GetSelectedObjects();
            while (modelObjectEnumerator.MoveNext())
            {
                if (modelObjectEnumerator.Current is Tekla.Structures.Model.Part)
                {
                    Tekla.Structures.Model.Part modelPart = modelObjectEnumerator.Current as Tekla.Structures.Model.Part;
                    string mark = "";
                    try
                    {
                        modelPart.GetReportProperty(MarkType, ref mark);
                        if (!MarkArray.Contains(mark))
                        {
                            MarkArray.Add(mark);
                        }
                    }
                    catch { }
                }
            }
            MarkArray.Sort();
            string MarkList = "";

            foreach (string strMark in MarkArray)
            {
                MarkList = strMark + " " + MarkList;
            }
            Clipboard.SetDataObject(MarkList); richTextBox1.Text = MarkList;
            drawingHandler.GetDrawingObjectSelector().SelectObjects(DrawingObjectArray, false);
        }
예제 #7
0
        public static void Run(Tekla.Technology.Akit.IScript akit)
        {
            Model             model          = new Model();
            DrawingHandler    drawingHandler = new DrawingHandler();
            DrawingEnumerator drawingEnum    = drawingHandler.GetDrawingSelector().GetSelected();

            if (drawingHandler.GetActiveDrawing() == null)
            {
                while (drawingEnum.MoveNext())
                {
                    if (drawingEnum.Current is AssemblyDrawing)
                    {
                        AssemblyDrawing assemblyDrawing = drawingEnum.Current as AssemblyDrawing;
                        drawingHandler.SetActiveDrawing(assemblyDrawing, false);
                        DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetActiveDrawing().GetSheet().GetAllObjects();
                        while (drawingObjectEnum.MoveNext())
                        {
                            if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Part)
                            {
                                Tekla.Structures.Drawing.Part part = drawingObjectEnum.Current as Tekla.Structures.Drawing.Part;
                                ArrayList array = new ArrayList();
                                array.Add(model.SelectModelObject(new Tekla.Structures.Identifier(part.ModelIdentifier.ID)));
                                Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector();
                                modelObjectSelector.Select(array);
                                ModelObjectEnumerator modelObjectEnum = model.GetModelObjectSelector().GetSelectedObjects();
                                while (modelObjectEnum.MoveNext())
                                {
                                    if (modelObjectEnum.Current is Tekla.Structures.Model.Part)
                                    {
                                        Tekla.Structures.Model.Part     mpart    = modelObjectEnum.Current as Tekla.Structures.Model.Part;
                                        Tekla.Structures.Model.Assembly assembly = mpart.GetAssembly();
                                        Tekla.Structures.Model.Part     mainPart = (Tekla.Structures.Model.Part)assembly.GetMainPart();
                                        assemblyDrawing.Name = mainPart.Name;
                                        assemblyDrawing.Modify();
                                        assemblyDrawing.CommitChanges();
                                    }
                                }
                                modelObjectSelector.Select(new ArrayList());
                            }
                        }
                        drawingHandler.CloseActiveDrawing();
                    }
                }
            }
        }
예제 #8
0
        /// <summary>
        /// 构造函数;
        /// </summary>
        /// <param name="partInModel"></param>
        /// <param name="partInDrawing"></param>
        public CMrPart(TSM.Part partInModel, TSD.Part partInDrawing)
        {
            mbNeedAddMark  = false;
            mPartInModel   = partInModel;
            mPartInDrawing = partInDrawing;
            mBeamType      = MrBeamType.BEAM;

            mBeamTopViewInfo       = new CBeamTopViewInfo(this);
            mBeamFrontViewInfo     = new CBeamFrontViewInfo(this);
            mCylinderTopViewInfo   = new CCylinderTopViewInfo(this);
            mCylinderFrontViewInfo = new CCylinderFrontViewInfo(this);

            mBeamDoorFrontViewInfo     = new CBeamDoorFrontViewInfo(this);
            mCylinderDoorFrontViewInfo = new CCylinderDoorFrontViewInfo(this);
            mCylinderDoorTopViewInfo   = new CCylinderDoorTopViewInfo(this);

            mLeftBottomPoint  = new Point();
            mLeftTopPoint     = new Point();
            mRightBottomPoint = new Point();
            mRightTopPoint    = new Point();
            mMidPoint         = new Point();
        }
예제 #9
0
        private void CopyObjects_Click(object sender, EventArgs e)
        {
            try
            {
                selectedObjects = drawingHandler.GetDrawingObjectSelector().GetSelected();

                selectedObjectsArray.Clear();
                selectedPartsArray.Clear();
                selectedViewsArray.Clear();

                foreach (DrawingObject drawingObject in selectedObjects)
                {
                    if (drawingObject is Tekla.Structures.Drawing.Part)
                    {
                        Tekla.Structures.Drawing.Part drawingPart = (Tekla.Structures.Drawing.Part)drawingObject;
                        selectedPartsArray.Add(drawingPart.ModelIdentifier);
                        v = (Tekla.Structures.Drawing.View)drawingPart.GetView();
                    }
                    if (drawingObject is Tekla.Structures.Drawing.View)
                    {
                        selectedViewsArray.Add(drawingObject);
                    }
                    if (drawingObject is Tekla.Structures.Drawing.GraphicObject)
                    {
                        selectedObjectsArray.Add(drawingObject);
                    }
                    if (drawingObject is Tekla.Structures.Drawing.Text)
                    {
                        selectedObjectsArray.Add(drawingObject);
                    }
                }
                int count = selectedObjectsArray.Count + selectedPartsArray.Count + selectedViewsArray.Count;
                statusLabel.Text = count.ToString() + " objects copied";
            }
            catch { }
        }
예제 #10
0
        /// <summary>
        /// 显示拾取对象的信息;
        /// </summary>
        /// <param name="pickedObject"></param>
        private void ShowDrawingObjectInfo(DrawingObject pickedObject, TSD.ViewBase viewBase)
        {
            if (null == pickedObject)
            {
                return;
            }
            if (pickedObject is TSD.ModelObject)
            {
                TSD.ModelObject modelObjectInDrawing = pickedObject as TSD.ModelObject;
                TSM.ModelObject modelObject          = CDimTools.GetInstance().TransformDrawingToModel(modelObjectInDrawing);

                if (modelObject is TSM.Part)
                {
                    TSM.Part partInModel   = modelObject as TSM.Part;
                    TSD.Part partInDrawing = modelObjectInDrawing as TSD.Part;

                    CMrPart mrPart = new CMrPart(partInModel, partInDrawing);

                    CDimTools.GetInstance().InitMrPart(partInModel, viewBase as TSD.View, mrPart);

                    UpdateUIInfo(mrPart);
                }
            }
        }
예제 #11
0
        public void Modify(PropertyValueChangedEventArgs e)
        {
            string  label   = e.ChangedItem.Label;
            Drawing drawing = drawingHandler.GetActiveDrawing();
            DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected();

            while (drawingObjectEnum.MoveNext())
            {
                if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Part)
                {
                    Tekla.Structures.Drawing.Part drawingPart = (Tekla.Structures.Drawing.Part)drawingObjectEnum.Current;
                    if (label == "DrawCenterLine")
                    {
                        drawingPart.Attributes.DrawCenterLine = bool.Parse(drawCenterLine.ToString());
                    }
                    if (label == "DrawChamfers")
                    {
                        drawingPart.Attributes.DrawChamfers = bool.Parse(drawChamfers.ToString());
                    }
                    //if (label == "Draw Connecting Side Marks") drawingPart.Attributes.DrawConnectingSideMarks = drawConnectingSideMarks;
                    if (label == "DrawHiddenLines")
                    {
                        drawingPart.Attributes.DrawHiddenLines = bool.Parse(drawHiddenLines.ToString());
                    }
                    if (label == "DrawOrientationMark")
                    {
                        drawingPart.Attributes.DrawOrientationMark = bool.Parse(drawOrientationMark.ToString());
                    }
                    if (label == "DrawOwnHiddenLines")
                    {
                        drawingPart.Attributes.DrawOwnHiddenLines = bool.Parse(drawOwnHiddenLines.ToString());
                    }
                    if (label == "DrawPopMarks")
                    {
                        drawingPart.Attributes.DrawPopMarks = bool.Parse(drawPopMarks.ToString());
                    }
                    if (label == "DrawReferenceLine")
                    {
                        drawingPart.Attributes.DrawReferenceLine = bool.Parse(drawReferenceLine.ToString());
                    }
                    if (label == "VisibleLinesColour")
                    {
                        drawingPart.Attributes.VisibleLines.Color = visibleLinesColour;
                    }
                    if (label == "VisibleLinesType")
                    {
                        if (visibleLinesType == LineTypeEnum.DashDot)
                        {
                            drawingPart.Attributes.VisibleLines.Type = LineTypes.DashDot;
                        }
                        else if (visibleLinesType == LineTypeEnum.DashDoubleDot)
                        {
                            drawingPart.Attributes.VisibleLines.Type = LineTypes.DashDoubleDot;
                        }
                        else if (visibleLinesType == LineTypeEnum.DashedLine)
                        {
                            drawingPart.Attributes.VisibleLines.Type = LineTypes.DashedLine;
                        }
                        else if (visibleLinesType == LineTypeEnum.DottedLine)
                        {
                            drawingPart.Attributes.VisibleLines.Type = LineTypes.DottedLine;
                        }
                        else if (visibleLinesType == LineTypeEnum.SlashDash)
                        {
                            drawingPart.Attributes.VisibleLines.Type = LineTypes.SlashDash;
                        }
                        else if (visibleLinesType == LineTypeEnum.SlashedLine)
                        {
                            drawingPart.Attributes.VisibleLines.Type = LineTypes.SlashedLine;
                        }
                        else if (visibleLinesType == LineTypeEnum.SolidLine)
                        {
                            drawingPart.Attributes.VisibleLines.Type = LineTypes.SolidLine;
                        }
                        else if (visibleLinesType == LineTypeEnum.UndefinedLine)
                        {
                            drawingPart.Attributes.VisibleLines.Type = LineTypes.UndefinedLine;
                        }
                    }
                    if (label == "HiddenLinesColour")
                    {
                        drawingPart.Attributes.HiddenLines.Color = hiddenLinesColour;
                    }
                    if (label == "HiddenLinesType")
                    {
                        if (hiddenLinesType == LineTypeEnum.DashDot)
                        {
                            drawingPart.Attributes.HiddenLines.Type = LineTypes.DashDot;
                        }
                        else if (hiddenLinesType == LineTypeEnum.DashDoubleDot)
                        {
                            drawingPart.Attributes.HiddenLines.Type = LineTypes.DashDoubleDot;
                        }
                        else if (hiddenLinesType == LineTypeEnum.DashedLine)
                        {
                            drawingPart.Attributes.HiddenLines.Type = LineTypes.DashedLine;
                        }
                        else if (hiddenLinesType == LineTypeEnum.DottedLine)
                        {
                            drawingPart.Attributes.HiddenLines.Type = LineTypes.DottedLine;
                        }
                        else if (hiddenLinesType == LineTypeEnum.SlashDash)
                        {
                            drawingPart.Attributes.HiddenLines.Type = LineTypes.SlashDash;
                        }
                        else if (hiddenLinesType == LineTypeEnum.SlashedLine)
                        {
                            drawingPart.Attributes.HiddenLines.Type = LineTypes.SlashedLine;
                        }
                        else if (hiddenLinesType == LineTypeEnum.SolidLine)
                        {
                            drawingPart.Attributes.HiddenLines.Type = LineTypes.SolidLine;
                        }
                        else if (hiddenLinesType == LineTypeEnum.UndefinedLine)
                        {
                            drawingPart.Attributes.HiddenLines.Type = LineTypes.UndefinedLine;
                        }
                    }
                    if (label == "ReferenceLinesColour")
                    {
                        drawingPart.Attributes.ReferenceLine.Color = referenceLinesColour;
                    }
                    if (label == "ReferenceLinesType")
                    {
                        if (referenceLinesType == LineTypeEnum.DashDot)
                        {
                            drawingPart.Attributes.ReferenceLine.Type = LineTypes.DashDot;
                        }
                        else if (referenceLinesType == LineTypeEnum.DashDoubleDot)
                        {
                            drawingPart.Attributes.ReferenceLine.Type = LineTypes.DashDoubleDot;
                        }
                        else if (referenceLinesType == LineTypeEnum.DashedLine)
                        {
                            drawingPart.Attributes.ReferenceLine.Type = LineTypes.DashedLine;
                        }
                        else if (referenceLinesType == LineTypeEnum.DottedLine)
                        {
                            drawingPart.Attributes.ReferenceLine.Type = LineTypes.DottedLine;
                        }
                        else if (referenceLinesType == LineTypeEnum.SlashDash)
                        {
                            drawingPart.Attributes.ReferenceLine.Type = LineTypes.SlashDash;
                        }
                        else if (referenceLinesType == LineTypeEnum.SlashedLine)
                        {
                            drawingPart.Attributes.ReferenceLine.Type = LineTypes.SlashedLine;
                        }
                        else if (referenceLinesType == LineTypeEnum.SolidLine)
                        {
                            drawingPart.Attributes.ReferenceLine.Type = LineTypes.SolidLine;
                        }
                        else if (referenceLinesType == LineTypeEnum.UndefinedLine)
                        {
                            drawingPart.Attributes.ReferenceLine.Type = LineTypes.UndefinedLine;
                        }
                    }
                    drawingPart.Modify();
                    drawing.CommitChanges();
                }
            }
        }
예제 #12
0
        public void GetProperties()
        {
            DrawingObjectEnumerator drawingObjectEnum = drawingHandler.GetDrawingObjectSelector().GetSelected();

            if (drawingObjectEnum.GetSize() == 1)
            {
                while (drawingObjectEnum.MoveNext())
                {
                    if (drawingObjectEnum.Current is Tekla.Structures.Drawing.Part)
                    {
                        Tekla.Structures.Drawing.Part drawingPart = (Tekla.Structures.Drawing.Part)drawingObjectEnum.Current;

                        if (drawingPart.Attributes.DrawCenterLine)
                        {
                            drawCenterLine = Bool.True;
                        }
                        else
                        {
                            drawCenterLine = Bool.False;
                        }
                        if (drawingPart.Attributes.DrawChamfers)
                        {
                            drawChamfers = Bool.True;
                        }
                        else
                        {
                            drawChamfers = Bool.False;
                        }
                        //drawConnectingSideMarks = drawingPart.Attributes.DrawConnectingSideMarks;
                        if (drawingPart.Attributes.DrawHiddenLines)
                        {
                            drawHiddenLines = Bool.True;
                        }
                        else
                        {
                            drawHiddenLines = Bool.False;
                        }
                        if (drawingPart.Attributes.DrawOrientationMark)
                        {
                            drawOrientationMark = Bool.True;
                        }
                        else
                        {
                            drawOrientationMark = Bool.False;
                        }
                        if (drawingPart.Attributes.DrawOwnHiddenLines)
                        {
                            drawOwnHiddenLines = Bool.True;
                        }
                        else
                        {
                            drawOwnHiddenLines = Bool.False;
                        }
                        if (drawingPart.Attributes.DrawPopMarks)
                        {
                            drawPopMarks = Bool.True;
                        }
                        else
                        {
                            drawPopMarks = Bool.False;
                        }
                        if (drawingPart.Attributes.DrawReferenceLine)
                        {
                            drawReferenceLine = Bool.True;
                        }
                        else
                        {
                            drawReferenceLine = Bool.False;
                        }
                        visibleLinesColour = drawingPart.Attributes.VisibleLines.Color;
                        if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DashDot)
                        {
                            visibleLinesType = LineTypeEnum.DashDot;
                        }
                        else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DashDoubleDot)
                        {
                            visibleLinesType = LineTypeEnum.DashDoubleDot;
                        }
                        else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DashedLine)
                        {
                            visibleLinesType = LineTypeEnum.DashedLine;
                        }
                        else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DottedLine)
                        {
                            visibleLinesType = LineTypeEnum.DottedLine;
                        }
                        else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.SlashDash)
                        {
                            visibleLinesType = LineTypeEnum.SlashDash;
                        }
                        else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.SlashedLine)
                        {
                            visibleLinesType = LineTypeEnum.SlashedLine;
                        }
                        else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.SolidLine)
                        {
                            visibleLinesType = LineTypeEnum.SolidLine;
                        }
                        else if (drawingPart.Attributes.VisibleLines.Type == LineTypes.UndefinedLine)
                        {
                            visibleLinesType = LineTypeEnum.UndefinedLine;
                        }
                        hiddenLinesColour = drawingPart.Attributes.HiddenLines.Color;
                        if (drawingPart.Attributes.HiddenLines.Type == LineTypes.DashDot)
                        {
                            hiddenLinesType = LineTypeEnum.DashDot;
                        }
                        else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.DashDoubleDot)
                        {
                            hiddenLinesType = LineTypeEnum.DashDoubleDot;
                        }
                        else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.DashedLine)
                        {
                            hiddenLinesType = LineTypeEnum.DashedLine;
                        }
                        else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.DottedLine)
                        {
                            hiddenLinesType = LineTypeEnum.DottedLine;
                        }
                        else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.SlashDash)
                        {
                            hiddenLinesType = LineTypeEnum.SlashDash;
                        }
                        else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.SlashedLine)
                        {
                            hiddenLinesType = LineTypeEnum.SlashedLine;
                        }
                        else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.SolidLine)
                        {
                            hiddenLinesType = LineTypeEnum.SolidLine;
                        }
                        else if (drawingPart.Attributes.HiddenLines.Type == LineTypes.UndefinedLine)
                        {
                            hiddenLinesType = LineTypeEnum.UndefinedLine;
                        }
                        referenceLinesColour = drawingPart.Attributes.ReferenceLine.Color;
                        if (drawingPart.Attributes.VisibleLines.Type == LineTypes.DashDot)
                        {
                            visibleLinesType = LineTypeEnum.DashDot;
                        }
                        else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.DashDoubleDot)
                        {
                            referenceLinesType = LineTypeEnum.DashDoubleDot;
                        }
                        else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.DashedLine)
                        {
                            referenceLinesType = LineTypeEnum.DashedLine;
                        }
                        else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.DottedLine)
                        {
                            referenceLinesType = LineTypeEnum.DottedLine;
                        }
                        else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.SlashDash)
                        {
                            referenceLinesType = LineTypeEnum.SlashDash;
                        }
                        else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.SlashedLine)
                        {
                            referenceLinesType = LineTypeEnum.SlashedLine;
                        }
                        else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.SolidLine)
                        {
                            referenceLinesType = LineTypeEnum.SolidLine;
                        }
                        else if (drawingPart.Attributes.ReferenceLine.Type == LineTypes.UndefinedLine)
                        {
                            referenceLinesType = LineTypeEnum.UndefinedLine;
                        }
                    }
                }
            }
            else if (drawingObjectEnum.GetSize() > 1)
            {
                drawCenterLine       = new Bool();
                drawChamfers         = new Bool();
                drawHiddenLines      = new Bool();
                drawOrientationMark  = new Bool();
                drawOwnHiddenLines   = new Bool();
                DrawPopMarks         = new Bool();
                drawReferenceLine    = new Bool();
                visibleLinesColour   = new DrawingColors();
                visibleLinesType     = new LineTypeEnum();
                hiddenLinesColour    = new DrawingColors();
                hiddenLinesType      = new LineTypeEnum();
                referenceLinesColour = new DrawingColors();
                referenceLinesType   = new LineTypeEnum();
            }
        }
예제 #13
0
 public CenterLinesDrawer(TSD.Part drawingPart, ViewBase viewBase)
 {
     _tsPart = new TsPart(drawingPart);
     _tsView = new TsView(viewBase);
 }
 /// <summary>
 /// 主梁的构造函数;
 /// </summary>
 /// <param name="partInModel"></param>
 /// <param name="partInDrawing"></param>
 public CMrMainBeam(TSM.Part partInModel, TSD.Part partInDrawing) : base(partInModel, partInDrawing)
 {
     this.mPartInModel   = partInModel;
     this.mPartInDrawing = partInDrawing;
 }