Esempio n. 1
0
        protected override void OnClick()
        {
            if (m_dockableWindow == null)
            {
                return;
            }

            m_dockableWindow.Show(!m_dockableWindow.IsVisible());
            Checked = m_dockableWindow.IsVisible();
        }
 protected override void OnClick()
 {
     if (s_dockWindow == null)
     {
         UID dockWinID = new UIDClass();
         dockWinID.Value = ThisAddIn.IDs.RS_Tools_Tools_Inspector_Inspector;
         s_dockWindow    = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
     }
     if (s_dockWindow == null)
     {
         return;
     }
     s_dockWindow.Show(!s_dockWindow.IsVisible());
 }
Esempio n. 3
0
        /// <summary>
        /// 根据ID显示指定的DockWindow
        /// </summary>
        /// <param name="uid_value">UID.Value,一般为“ThisAddIn.IDs.xxxx”格式,其中“xxxx”为DockableWindow的ID</param>
        internal static void ShowDockAbleWindow(string uid_value)
        {
            if (DateTime.Now > new DateTime(2019, 8, 31))
            {
                ShowDialogInfo("插件已过期");
                return;
            }

            IDockableWindowManager pDocWinMgr = ArcMap.DockableWindowManager;
            UID uid = new UIDClass()
            {
                Value = uid_value
            };
            IDockableWindow pWindow = pDocWinMgr.GetDockableWindow(uid);


            if (!pWindow.IsVisible())
            {
                pWindow.Dock(esriDockFlags.esriDockShow);
            }
            else
            {
                pWindow.Dock(esriDockFlags.esriDockUnPinned);
            }
        }
        void OnStopEditing(bool save)
        {
            // Don't do anything if the extension is disabled
            if (IsExtensionEnabled != true)
            {
                return;
            }

            // Reset the database-validity flag just in case
            m_DatabaseIsValid            = false;
            m_DatabaseUsesRepresentation = false;

            // Destroy the SysInfo reference
            m_SysInfo = null;

            // Kill the NCGMP-validity flag
            g_EditWorkspaceIsValid = false;

            // Close the Map Unit Legend Form
            // Mixing UI into the Extension! Balderdash! I should try and make the UserControl listen to edit events...
            UID theUid = new UIDClass();

            theUid.Value = ThisAddIn.IDs.dwnMapUnitLegendEditor;


            IDockableWindow mapUnitForm = ArcMap.DockableWindowManager.GetDockableWindow(theUid);

            if (mapUnitForm.IsVisible() == true)
            {
                mapUnitForm.Show(false);
            }
        }
Esempio n. 5
0
        protected override void OnActivate()
        {
            try
            {
                UID dockWinID = new UIDClass();
                dockWinID.Value = ThisAddIn.IDs.EditForm;
                IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
                if (!dockWindow.IsVisible())
                {
                    dockWindow.Show(true);
                }

                activeLayer = Editor.ActiveLayer;
                IRasterLayer rasterLayer = (IRasterLayer)activeLayer;
                IRasterProps rasterProp  = (IRasterProps)rasterLayer.Raster;
                maxIndex = new Position(rasterProp.Width - 1, rasterProp.Height - 1);

                EditForm editForm = AddIn.FromID <EditForm.AddinImpl>(ThisAddIn.IDs.EditForm).UI;
                editForm.SetLayer(activeLayer.Name);
                System.Array noDataValue = (System.Array)rasterProp.NoDataValue;
                editForm.RasterGridView.NoDataValue = Convert.ToDouble(noDataValue.GetValue(0));
                editForm.SetNoDataValue(editForm.RasterGridView.NoDataValue);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
            }

            base.OnActivate();
        }
Esempio n. 6
0
        /// <summary>
        /// Remove all selection if there is no layer loaded
        /// </summary>
        protected override void OnUpdate()
        {
            Enabled = ArcMap.Application != null;

            try
            {
                if (ArcMap.Document.FocusMap.LayerCount == 0)
                {
                    Display.ClearElement(Editor.Selections.GetAllGraphicElements());
                    Editor.Selections.Clear();

                    UID dockWinID = new UIDClass();
                    dockWinID.Value = ThisAddIn.IDs.IdentifyForm;
                    IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
                    if (dockWindow.IsVisible())
                    {
                        IdentifyForm identifyForm = AddIn.FromID <IdentifyForm.AddinImpl>(ThisAddIn.IDs.IdentifyForm).UI;
                        identifyForm.ClearValues();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
            }
        }
Esempio n. 7
0
        protected override void OnActivate()
        {
            base.OnActivate();

            try
            {
                if (Painter.ActiveLayer == null)
                {
                    return;
                }

                UID dockWinID = new UIDClass();
                dockWinID.Value = ThisAddIn.IDs.ValueSymbolForm;
                IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
                if (!dockWindow.IsVisible())
                {
                    dockWindow.Show(true);
                }

                IRasterLayer rasterLayer = (IRasterLayer)Painter.ActiveLayer;
                IRasterProps rasterProp  = (IRasterProps)rasterLayer.Raster;
                layerExetent = new Envelope(0, rasterProp.Height - 1, 0, rasterProp.Width - 1);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            if (m_dockWindow == null)
            {
                return;
            }

            m_dockWindow.Show(!m_dockWindow.IsVisible());
        }
Esempio n. 9
0
        /// <summary>
        /// Toggle visibility of dockable window and show the visible state by its checked property
        /// </summary>
        public override void OnClick()
        {
            if (m_dockableWindow == null)
            {
                return;
            }

            if (m_dockableWindow.IsVisible())
            {
                m_dockableWindow.Show(false);
            }
            else
            {
                m_dockableWindow.Show(true);
            }

            base.m_checked = m_dockableWindow.IsVisible();
        }
        /// <summary>
        /// The on click method for the button are the arcmap toolbar.
        /// </summary>
        protected override void OnClick()
        {
            UID theUid = new UIDClass();

            theUid.Value = ThisAddIn.IDs.Gbdx_Vector_Index_Forms_VectorIndexDockable;

            IDockableWindow vectorIndexDockableWindow = ArcMap.DockableWindowManager.GetDockableWindow(theUid);

            vectorIndexDockableWindow.Show(!vectorIndexDockableWindow.IsVisible());
        }
        protected override void OnClick()
        {
            IDockableWindow dockWindow = SF10_extMain.GetDockWindow();

            if (dockWindow == null)
            {
                return;
            }

            dockWindow.Show(!dockWindow.IsVisible());
        }
Esempio n. 12
0
        protected override void OnClick()
        {
            IDockableWindow dockWindow = SelectionExtension.GetSelectionCountWindow();

            if (dockWindow == null)
            {
                return;
            }

            dockWindow.Show(!dockWindow.IsVisible());
        }
 protected override void OnUpdate()
 {
     if (s_dockWindow == null)
     {
         Enabled = ArcMap.Application != null;
     }
     else
     {
         Checked = s_dockWindow.IsVisible();
     }
 }
        protected override void OnClick()
        {
            IDockableWindow dockWindow = ParcelEditHelperExtension.GetFabricAdjustmentWindow();

            if (dockWindow == null)
            {
                return;
            }

            dockWindow.Show(!dockWindow.IsVisible());
        }
Esempio n. 15
0
File: Show.cs Progetto: tomorrod/AO1
        protected override void OnClick()
        {
            UID dockWinID = new UIDClass();

            dockWinID.Value = ThisAddIn.IDs.DockableWindow1;
            IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);

            if (dockWindow != null && !dockWindow.IsVisible())
            {
                dockWindow.Show(true);
            }
        }
Esempio n. 16
0
        protected override void OnClick()
        {
            UID theUid = new UIDClass();

            theUid.Value = ThisAddIn.IDs.dwnMapUnitLegendEditor;

            IDockableWindow mapUnitForm = ArcMap.DockableWindowManager.GetDockableWindow(theUid);

            if (mapUnitForm.IsVisible() == false)
            {
                mapUnitForm.Show(true);
            }
        }
        protected override void OnClick()
        {
            //
            //  TODO: Sample code showing how to access button host
            //
            ArcMap.Application.CurrentTool = null;
            if (_DockWindow == null)
            {
                return;
            }

            _DockWindow.Show(!_DockWindow.IsVisible());
        }
Esempio n. 18
0
        protected override void OnClick()
        {
            UID dockWinID = new UIDClass();

            dockWinID.Value = ThisAddIn.IDs.CS_win;

            IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);

            if (dockWindow == null)
            {
                return;
            }

            dockWindow.Show(!dockWindow.IsVisible());
        }
Esempio n. 19
0
        protected override void OnClick()
        {
            //
            //  TODO: Sample code showing how to access button host
            //
            //ArcMap.Application.CurrentTool = null;
            UID winID = new UIDClass();

            winID.Value = ThisAddIn.IDs.ShowMapDockableWindow;
            IDockableWindow psalceWin = ArcMap.DockableWindowManager.GetDockableWindow(winID);

            if (!psalceWin.IsVisible())
            {
                psalceWin.Show(true);
            }
        }
Esempio n. 20
0
        protected override void OnClick()
        {
            // Get Dockable window
            UID dockWinID = new UIDClass();

            dockWinID.Value = @"esri_ArcMapAddin_DockWindowTest_DockableWindow1_Class";
            IDockableWindow s_dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);

            if (s_dockWindow.IsVisible()) // This true by default if you use the Dockable Window Add-In template to create the dockable window
            {
                s_dockWindow.Show(false);
            }
            else
            {
                s_dockWindow.Show(true);
            }
        }
 protected override void OnClick()
 {
     if (Globals.IsLicensed)
     {
         if (addWin.IsVisible())
         {
             addWin.Show(false);
         }
         else
         {
             addWin.Show(true);
         }
     }
     else
     {
         MessageBox.Show("This product is not licensed", "License Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
     }
 }
Esempio n. 22
0
        /// <summary>
        /// Show the select form when the tool is abled.
        /// </summary>
        protected override void OnActivate()
        {
            try
            {
                UID dockWinID = new UIDClass();
                dockWinID.Value = ThisAddIn.IDs.IdentifyForm;
                IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
                if (!dockWindow.IsVisible())
                {
                    dockWindow.Show(true);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
            }

            base.OnActivate();
        }
Esempio n. 23
0
        protected override void OnClick()
        {
            //
            //  TODO: Sample code showing how to access button host
            //
            ArcMap.Application.CurrentTool = null;
            UID dockWinID = new UIDClass();

            dockWinID.Value = ThisAddIn.IDs.OSCM_win;

            IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);

            if (dockWindow == null)
            {
                return;
            }

            dockWindow.Show(!dockWindow.IsVisible());
        }
        private void OnWindowLoaded(object sender, RoutedEventArgs e)
        {
            // TODO: loading animation
            foreach (var item in Helper)
            {
                Tables.Add(item);
            }
            NotifyPropertyChanged("Tables");
            Refresh();
            TableSearchButton butt = AddIn.FromID <TableSearchButton>(ThisAddIn.IDs.TableSearchButton);

            // we can't seem to get a handle on the open event
            butt.VisibilityChangedEvent += (o, evt) => {
                IDockableWindow searchWindow = ArcMap.DockableWindowManager.GetDockableWindow(ThisAddIn.IDs.TableSearchWindow.ToUID());
                if (searchWindow.IsVisible())
                {
                    Refresh();
                }
            };
        }
Esempio n. 25
0
        protected override void OnClick()
        {
            //
            //  TODO: Sample code showing how to access button host
            //
            //FormCSW fCSW = new FormCSW();
            //fCSW.Show();

            try
            {
                IDockableWindow dWin = this.GetDockableWindow(ArcMap.Application, "Microsoft_ArcMapAddin1_ArcGISAddinDWin");
                dWin.Show(!dWin.IsVisible());
            }
            catch (Exception ex)
            { throw ex; }



            ArcMap.Application.CurrentTool = null;
        }
Esempio n. 26
0
        protected override bool OnDeactivate()
        {
            try
            {
                Display.ClearElement(Editor.Selections.GetAllGraphicElements());
                Editor.Selections.Clear();

                UID dockWinID = new UIDClass();
                dockWinID.Value = ThisAddIn.IDs.EditForm;
                IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
                if (dockWindow.IsVisible())
                {
                    dockWindow.Show(false);
                    EditForm editForm = AddIn.FromID <EditForm.AddinImpl>(ThisAddIn.IDs.EditForm).UI;
                    editForm.ClearValues();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
            }

            return(base.OnDeactivate());
        }
Esempio n. 27
0
        protected override void OnActivate()
        {
            base.OnActivate();

            if (Painter.ActiveLayer == null)
            {
                return;
            }

            UID dockWinID = new UIDClass();

            dockWinID.Value = ThisAddIn.IDs.ValueSymbolForm;
            IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);

            if (!dockWindow.IsVisible())
            {
                dockWindow.Show(true);
            }

            IRasterLayer rasterLayer = (IRasterLayer)Painter.ActiveLayer;
            IRasterProps rasterProp  = (IRasterProps)rasterLayer.Raster;

            layerExetent = new Envelope(0, rasterProp.Height - 1, 0, rasterProp.Width - 1);
        }
Esempio n. 28
0
        protected override void OnMouseUp(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg)
        {
            base.OnMouseDown(arg);

            if (Editor.ActiveLayer != null)
            {
                try
                {
                    UID uid = new UIDClass();
                    uid.Value = ThisAddIn.IDs.EditForm;
                    IDockableWindow dockWin  = ArcMap.DockableWindowManager.GetDockableWindow(uid);
                    EditForm        editForm = AddIn.FromID <EditForm.AddinImpl>(ThisAddIn.IDs.EditForm).UI;

                    IEnvelope envelop = newEnvelopeFeedback.Stop();

                    Position tlCorner, brCorner;
                    if (envelop.UpperLeft.IsEmpty)
                    {
                        tlCorner = Editor.ScreenCoor2RasterCoor(arg.X, arg.Y);
                        brCorner = tlCorner;
                    }
                    else
                    {
                        tlCorner = Editor.MapCoor2RasterCoor(envelop.UpperLeft);
                        brCorner = Editor.MapCoor2RasterCoor(envelop.LowerRight);
                    }

                    if (!IsIntersect(tlCorner, brCorner, maxIndex))
                    {
                        editForm.ClearValues();
                        return;
                    }

                    tlCorner.Adjust(0, 0, maxIndex.Column, maxIndex.Row);
                    brCorner.Adjust(0, 0, maxIndex.Column, maxIndex.Row);

                    // Show symbols of selected pixels
                    for (int row = tlCorner.Row; row <= brCorner.Row; row++)
                    {
                        for (int col = tlCorner.Column; col <= brCorner.Column; col++)
                        {
                            Pixel pixel = new Pixel(new Position(col, row));
                            pixel.GraphicElement = Display.DrawBox(pixel.Position, Editor.GetSelectionSymbol(), Editor.ActiveLayer);
                            Editor.Selections.Add(pixel);
                        }
                    }

                    IRasterLayer rasterLayer = (IRasterLayer)activeLayer;
                    double[,] values = Editor.GetValues(tlCorner, brCorner, rasterLayer.Raster);
                    editForm.SetValues(tlCorner, brCorner, values);

                    // If there is only one value, select that.
                    if (values.Length == 1)
                    {
                        editForm.RasterGridView[0, 0].Selected = false;
                        editForm.RasterGridView[1, 0].Selected = true;
                    }

                    if (!dockWin.IsVisible())
                    {
                        dockWin.Show(true);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
                }
            }
        }
Esempio n. 29
0
        /// <summary>
        /// Select the pixels when mouse up.
        /// </summary>
        /// <param name="arg"></param>
        protected override void OnMouseUp(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg)
        {
            base.OnMouseUp(arg);

            if (activeLayer != null)
            {
                try
                {
                    IEnvelope envelop = newEnvelopeFeedback.Stop();

                    UID dockWinID = new UIDClass();
                    dockWinID.Value = ThisAddIn.IDs.IdentifyForm;

                    // Use GetDockableWindow directly as we want the client IDockableWindow not the internal class
                    IDockableWindow dockWindow   = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
                    IdentifyForm    identifyForm = AddIn.FromID <IdentifyForm.AddinImpl>(ThisAddIn.IDs.IdentifyForm).UI;

                    Position tlCorner, brCorner;
                    if (envelop.UpperLeft.IsEmpty)
                    {
                        tlCorner = Editor.ScreenCoor2RasterCoor(arg.X, arg.Y, activeLayer);
                        brCorner = tlCorner;
                    }
                    else
                    {
                        tlCorner = Editor.MapCoor2RasterCoor(envelop.UpperLeft, activeLayer);
                        brCorner = Editor.MapCoor2RasterCoor(envelop.LowerRight, activeLayer);
                    }

                    if (!IsIntersect(tlCorner, brCorner, maxExtent))
                    {
                        identifyForm.ClearValues();
                        return;
                    }

                    tlCorner.Adjust(0, 0, maxExtent.Column, maxExtent.Row);
                    brCorner.Adjust(0, 0, maxExtent.Column, maxExtent.Row);

                    // Show symbols of selected pixels
                    for (int row = tlCorner.Row; row <= brCorner.Row; row++)
                    {
                        for (int col = tlCorner.Column; col <= brCorner.Column; col++)
                        {
                            Pixel pixel = new Pixel(new Position(col, row));
                            pixel.GraphicElement = Display.DrawBox(pixel.Position, Editor.GetSelectionSymbol(), ArcMapApp.GetRasterLayer());
                            Editor.Selections.Add(pixel);
                        }
                    }

                    double[,] values = Editor.GetValues(tlCorner, brCorner, activeLayer.Raster);

                    identifyForm.SetValues(tlCorner, brCorner, values);
                    identifyForm.SetLayerName(activeLayer.Name);
                    if (!dockWindow.IsVisible())
                    {
                        dockWindow.Show(true);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
                }
            }
        }
        protected override void OnClick()
        {
            ICadastralEditor            pCadEd         = (ICadastralEditor)ArcMap.Application.FindExtensionByName("esriCadastralUI.CadastralEditorExtension");
            ICadastralFabric            pCadFabric     = pCadEd.CadastralFabric;
            ICadastralExtensionManager2 pCadExtMan     = (ICadastralExtensionManager2)pCadEd;
            IParcelEditManager          pParcEditorMan = (IParcelEditManager)pCadEd;
            IParcelConstruction         pTrav          = pParcEditorMan.ParcelConstruction;

            //Test for the visibility of the parcel details window
            IDockableWindowManager pDocWinMgr = (IDockableWindowManager)ArcMap.Application;
            UID pUID = new UIDClass();

            pUID.Value = "{28531B78-7C42-4785-805D-2A7EC8879EA1}";//ArcID.ParcelDetails
            IDockableWindow pParcelDet = pDocWinMgr.GetDockableWindow(pUID);

            if (!pParcelDet.IsVisible())
            {
                MessageBox.Show("The Parcel Details window is not visible. \r\nThere is no data to save.");
                return;
            }

            //Make sure the lines grid is selected
            Utilities UTILS = new Utilities();

            UTILS.SelectCadastralPropertyPage((ICadastralExtensionManager)pCadExtMan, "lines");

            //test to make sure there is data there to be saved
            IParcelConstruction3 pConstr = (IParcelConstruction3)pTrav;
            IGSParcel            pParcel = null;

            //
            try
            {
                pParcel = pTrav.Parcel;
            }
            catch (COMException err)
            {
                MessageBox.Show(err.Message + Environment.NewLine + "ERROR: Select a parcel or add lines to the grid. \r\nThere is no data to save. ");
                return;
            }
            //define the file that needs to be saved
            // Display .Net dialog for File saving.
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            // Set File Filter
            saveFileDialog.Filter           = "Comma-delimited(*.csv)|*.csv|All Files|*.*";
            saveFileDialog.FilterIndex      = 1;
            saveFileDialog.RestoreDirectory = true;
            // Warn on overwrite
            saveFileDialog.OverwritePrompt = true;
            // Don't need to Show Help
            saveFileDialog.ShowHelp = false;
            // Set Dialog Title
            saveFileDialog.Title = "Save file";

            // Display Open File Dialog
            if (saveFileDialog.ShowDialog() != DialogResult.OK)
            {
                saveFileDialog = null;
                return;
            }
            TextWriter tw = null;

            try
            {
                tw = new StreamWriter(saveFileDialog.FileName);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }

            try
            {
                IGSPlan pPlan = pTrav.Parcel.Plan;
                int     iDF   = (int)pPlan.DirectionFormat;
                switch (iDF)
                {
                case (int)esriDirectionType.esriDTNorthAzimuth:
                    tw.WriteLine("DT,NA");
                    break;

                case (int)esriDirectionType.esriDTPolar:
                    tw.WriteLine("DT,P");
                    break;

                case (int)esriDirectionType.esriDTQuadrantBearing:
                    tw.WriteLine("DT,QB");
                    break;

                case (int)esriDirectionType.esriDTSouthAzimuth:
                    tw.WriteLine("DT,SA");
                    break;

                default:
                    tw.WriteLine("DT,NA");
                    break;
                }

                int iAU = (int)pPlan.AngleUnits;
                switch (iAU)
                {
                case (int)esriDirectionUnits.esriDUDecimalDegrees:
                    tw.WriteLine("DU,DD");
                    break;

                case (int)esriDirectionUnits.esriDUDegreesMinutesSeconds:
                    tw.WriteLine("DU,DMS");
                    break;

                case (int)esriDirectionUnits.esriDUGons:
                case (int)esriDirectionUnits.esriDUGradians:
                    tw.WriteLine("DU,G");
                    break;

                case (int)esriDirectionUnits.esriDURadians:
                    tw.WriteLine("DU,R");
                    break;

                default:
                    tw.WriteLine("DU,R");
                    break;
                }

                ICadastralUnitConversion pUnitConv = new CadastralUnitConversionClass();
                double dMetricConversion           = pUnitConv.ConvertDouble(1, pPlan.DistanceUnits, esriCadastralDistanceUnits.esriCDUMeter);
                string sLU = Convert.ToString(dMetricConversion);

                tw.WriteLine("ToMetricFactor," + sLU);

                IEnumGSLines pGSLines = pTrav.GetLines();
                pGSLines.Reset();
                IGSLine   pGSLine   = null;
                IGSParcel pGSParcel = null;
                pGSLines.Next(ref pGSParcel, ref pGSLine);
                while (pGSLine != null)
                {
                    int iFromPt  = pGSLine.FromPoint;     //from point
                    int iToPt    = pGSLine.ToPoint;       //to point
                    int iLineCat = (int)pGSLine.Category; //line category
                    if (iLineCat == 4)
                    {
                        pGSLines.Next(ref pGSParcel, ref pGSLine);
                        continue;                            //ignore radial lines
                    }
                    int    iLineUserType = pGSLine.LineType; //line user type
                    int    iAccCat       = pGSLine.Accuracy; //accuracy
                    double dDistance     = pGSLine.Distance; //distance
                    double dChord        = pGSLine.Distance; //chord
                    double dRadius       = pGSLine.Radius;   //radius

                    string sLineCat      = Convert.ToString(iLineCat);
                    string sLineUserType = Convert.ToString(iLineUserType);

                    if (iLineUserType > 2140000000)
                    {
                        sLineUserType = "";
                    }

                    string sAccCat = Convert.ToString(iAccCat);
                    string sFromPt = Convert.ToString(iFromPt);//from point

                    //following need conversion
                    string sDirection = NorthAzRadians_2_DirectionString(pGSLine.Bearing, pPlan.DirectionFormat, pPlan.AngleUnits); //direction
                    string sDistance  = Convert.ToString(dDistance / dMetricConversion);                                            //distance
                    string sRadius    = "";
                    string sChord     = "";

                    if (dRadius != 123456789)
                    {                                                                //circular curve
                        sRadius   = Convert.ToString(dRadius / dMetricConversion);   //radius
                        sChord    = Convert.ToString(dDistance / dMetricConversion); //chord
                        sDistance = "";                                              //distance is replaced with the chord distance
                    }

                    string sToPt = Convert.ToString(iToPt);//to point
                    //write the line
                    tw.WriteLine(sFromPt + "," + sDirection + "," + sDistance + "," + sRadius + "," + sChord + "," + sToPt + ","
                                 + sLineCat + "," + sLineUserType + "," + sAccCat);

                    pGSLines.Next(ref pGSParcel, ref pGSLine);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                tw.Close();
                saveFileDialog = null;
            }
        }