Exemplo n.º 1
0
        private static void getPoint(__DrawingData drawing)
        {
            TSD.DrawingHandler drawingHandler = new TSD.DrawingHandler();

            if (drawingHandler.GetConnectionStatus())
            {
                TSD.ContainerView sheet = drawingHandler.GetActiveDrawing().GetSheet();

                TSD.UI.Picker picker       = drawingHandler.GetPicker();
                T3D.Point     viewPoint    = null;
                TSD.ViewBase  selectedView = null;

                MainForm._form.add_text("Select origin point in drawing view");
                picker.PickPoint("Pick one point", out viewPoint, out selectedView);
                T3D.Point sheetPoint = TSD.Tools.DrawingCoordinateConverter.Convert(selectedView, sheet, viewPoint);

                if (selectedView != null)
                {
                    if (selectedView is TSD.View)
                    {
                        drawing.setView(selectedView as TSD.View);
                    }
                }

                drawing.setSheet(sheet);
                drawing.setPoints(viewPoint, sheetPoint);
            }
        }
Exemplo n.º 2
0
        public static __DrawingData getSelectedData()
        {
            __DrawingData drawing = new __DrawingData();

            TSD.DrawingHandler drawingHandler = new TSD.DrawingHandler();

            if (drawingHandler.GetConnectionStatus())
            {
                TSD.ContainerView sheet = drawingHandler.GetActiveDrawing().GetSheet();

                try
                {
                    getPoint(drawing);
                }
                catch
                {
                    drawing.setSheet(sheet);
                }

                TSD.DrawingObjectEnumerator selectedObjects = drawingHandler.GetDrawingObjectSelector().GetSelected();
                drawing.populate(selectedObjects);
            }

            return(drawing);
        }
        public static void main(__DrawingData input, __DrawingData output)
        {
            __GeometryOperations.setInputPoints(input.viewPoint, input.sheetPoint);
            __GeometryOperations.setOutputPoints(output.viewPoint, output.sheetPoint);

            if (input.sheet != null && output.sheet != null)
            {
                redraw(input.data[input.sheet], output.data[output.sheet]);
            }

            if (input.view != null && output.view != null)
            {
                redraw(input.data[input.view], output.data[output.view]);
            }
        }
Exemplo n.º 4
0
        private void tekla_interface(Func <__DrawingData> getter, ref __DrawingData container)
        {
            UserProperties.set(cb_view.Checked, cb_mark.Checked,
                               cb_section.Checked, cb_detail.Checked, cb_line.Checked, cb_dim.Checked, cb_txt.Checked,
                               cb_txtfile.Checked, cb_dwg.Checked,
                               cb_red.Checked,
                               offsetRotation);

            add_text("Getting data... ");

            container = getter();

            add_text("[DONE]");
            add_text(container.countObjects());
        }
Exemplo n.º 5
0
        private void copy_paste_handler(Func <__DrawingData> getter, ref __DrawingData container, string error)
        {
            toggle_all_controls(false);

            try
            {
                DateTime start = DateTime.Now;
                tekla_interface(getter, ref container);
                DateTime end = DateTime.Now;
                timeReport(start, end);
            }
            catch
            {
                add_text(error);
            }

            toggle_all_controls(true);
        }
Exemplo n.º 6
0
        public static __DrawingData getAllData()
        {
            __DrawingData drawing = new __DrawingData();

            TSD.DrawingHandler drawingHandler = new TSD.DrawingHandler();

            if (drawingHandler.GetConnectionStatus())
            {
                TSD.ContainerView sheet = drawingHandler.GetActiveDrawing().GetSheet();

                try
                {
                    getPoint(drawing);
                }
                catch
                {
                    drawing.setSheet(sheet);
                }


                List <Type> types = new List <Type>();

                if (UserProperties._mark)
                {
                    types.Add(typeof(TSD.Mark));
                }
                if (UserProperties._section)
                {
                    types.Add(typeof(TSD.SectionMark));
                }
                if (UserProperties._detail)
                {
                    types.Add(typeof(TSD.DetailMark));
                }
                //if (UserProperties._line) types.Add(typeof(TSD.Arc)); PUUDUB PIISAV INFO
                if (UserProperties._line)
                {
                    types.Add(typeof(TSD.Line));
                }
                if (UserProperties._line)
                {
                    types.Add(typeof(TSD.Polyline));
                }
                if (UserProperties._line)
                {
                    types.Add(typeof(TSD.Circle));
                }
                if (UserProperties._line)
                {
                    types.Add(typeof(TSD.Cloud));
                }
                if (UserProperties._line)
                {
                    types.Add(typeof(TSD.Rectangle));
                }
                if (UserProperties._line)
                {
                    types.Add(typeof(TSD.Polygon));
                }
                if (UserProperties._dim)
                {
                    types.Add(typeof(TSD.StraightDimensionSet));
                }
                if (UserProperties._txt)
                {
                    types.Add(typeof(TSD.Text));
                }
                if (UserProperties._txtfile)
                {
                    types.Add(typeof(TSD.TextFile));
                }
                if (UserProperties._dwg)
                {
                    types.Add(typeof(TSD.DwgObject));
                }

                if (types.Count != 0)
                {
                    System.Type[] Types = new System.Type[types.Count];

                    for (int i = 0; i < types.Count; i++)
                    {
                        Types.SetValue(types[i], i);
                    }

                    TSD.DrawingObjectEnumerator allObjects = sheet.GetAllObjects(Types);
                    drawing.populate(allObjects);
                }
            }

            return(drawing);
        }