Esempio n. 1
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.Mark)
                {
                    Tekla.Structures.Drawing.Mark drawingMark = (Tekla.Structures.Drawing.Mark)drawingObjectEnum.Current;
                    if (label == "FrameColour")
                    {
                        drawingMark.Attributes.Frame.Color = frameColour;
                    }
                    if (label == "FrameType")
                    {
                        drawingMark.Attributes.Frame.Type = (FrameTypes)Enum.Parse(typeof(FrameTypes), frameType.ToString());
                    }

                    drawingMark.Modify();
                    drawing.CommitChanges();
                }
            }
        }
Esempio n. 2
0
        public void reCreateMark(_Mark input)
        {
            _mark.Attributes = input._mark.Attributes;
            _mark.Modify();

            if (input._mark.Placing is TSD.LeaderLinePlacing)
            {
                TSD.LeaderLinePlacing attr       = input._mark.Placing as TSD.LeaderLinePlacing;
                T3D.Point             start      = __GeometryOperations.applyGlobalOffset(attr.StartPoint);
                TSD.LeaderLinePlacing newPlacing = new TSD.LeaderLinePlacing(start);
                _mark.Placing = newPlacing;
            }

            else if (input._mark.Placing is TSD.AlongLinePlacing)
            {
                TSD.AlongLinePlacing attr       = input._mark.Placing as TSD.AlongLinePlacing;
                T3D.Point            start      = __GeometryOperations.applyGlobalOffset(attr.StartPoint);
                T3D.Point            end        = __GeometryOperations.applyGlobalOffset(attr.EndPoint);
                TSD.AlongLinePlacing newPlacing = new TSD.AlongLinePlacing(start, end);
                _mark.Placing = newPlacing;
            }

            else if (input._mark.Placing is TSD.BaseLinePlacing)
            {
                //TSD.BaseLinePlacing attr = input._mark.Placing as TSD.BaseLinePlacing;

                //T3D.Point start = __GeometryOperations.applyGlobalOffset(attr.StartPoint);
                //T3D.Point end = __GeometryOperations.applyGlobalOffset(attr.EndPoint);

                //TSD.BaseLinePlacing newPlacing = new TSD.BaseLinePlacing(start, end);
                //_mark.Placing = newPlacing;
            }

            else if (input._mark.Placing is TSD.PointPlacing)
            {
                TSD.PointPlacing newPlacing = new TSD.PointPlacing();
                _mark.Placing = newPlacing;
            }

            _mark.InsertionPoint = __GeometryOperations.applyGlobalOffset(input._mark.InsertionPoint);
            _mark.Modify();
            _mark.Modify();
        }