Esempio n. 1
0
        //Autodesk.Gis.Map.ObjectData.Table crODTable;

        /// <summary>
        /// Создаём таблицу ObjectData.
        /// </summary>
        /// <param name="wRule"> LayerRule как источник описания таблицы </param>
        /// <returns> ObjectData.Table </returns>
        public Autodesk.Gis.Map.ObjectData.Table CreateODTable(Rule.LayerRule wRule)
        {
            Autodesk.Gis.Map.MapApplication       mapApp        = Autodesk.Gis.Map.HostMapApplicationServices.Application;
            Autodesk.Gis.Map.Project.ProjectModel activeProject = mapApp.ActiveProject;
            Autodesk.Gis.Map.ObjectData.Tables    tableList     = activeProject.ODTables;
            //
            if (!tableList.GetTableNames().Contains(wRule.LName))
            {
                FieldDefinitions fieldDefs = mapApp.ActiveProject.MapUtility.NewODFieldDefinitions();
                foreach (Rule.FieldRule fr in wRule.FieldList)
                {
                    if (!fr.IsGeom)
                    {
                        fieldDefs.Add(fr.FName, "", Autodesk.Gis.Map.Constants.DataType.Character, 0); //!!1
                    }
                }
                tableList.Add(wRule.LName, fieldDefs, "", true);
            }
            //
            return(tableList[wRule.LName]);
        }
Esempio n. 2
0
        private void AnnotationDlg_Load(object sender, System.EventArgs e)
        {
            try
            {
                m_mapApp = Autodesk.Gis.Map.HostMapApplicationServices.Application;
                m_annotations = m_mapApp.ActiveProject.Annotations;
                m_idTemplate = ObjectId.Null;
                m_templateName = "";
                m_colODtblList = null;
                m_ODTableName = "";
                m_ODTables = null;
                m_ODTable = null;
                m_selectedTemplateName = "";
                m_fieldNameCheckBoxStatus = 0;
                m_annoOverrides = new AnnotationOverrides();
                m_annoOverrides.Clear();

                this.textbTemplateName.Text = "";
                this.listbColumnName.Items.Clear();
                this.listbODTable.SelectedIndex = -1;

                AnnoTemplateNameListBoxUpdate();
                InitODTableList();
                btnCreateNew.Enabled = false;
                InitButtons();
                checkbFieldName.Checked = false;
            }
            catch(System.Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
Esempio n. 3
0
 //--------------------------------------------------------------------------
 //
 // ���ܣ���ȡ��ǰ���õĶ�������
 //
 //  ���ߣ�
 //
 //  ���ڣ�200708
 //
 //   ��ʷ��
 //--------------------------------------------------------------------------
 private void InitODTableList()
 {
     listbODTable.Items.Clear();
     Autodesk.Gis.Map.MapApplication mapApi = m_mapApp;
     Autodesk.Gis.Map.Project.ProjectModel proj = mapApi.ActiveProject;
     m_ODTables = proj.ODTables;
     if ((null != m_ODTables) && (m_ODTables.TablesCount != 0))
     {
         // Add ObjectData table names into list box control
         m_colODtblList = m_ODTables.GetTableNames();
         listbODTable.BeginUpdate();
         foreach (string tableName in m_colODtblList)
         {
             if (listbODTable.FindStringExact(tableName) == -1)
             {
                 listbODTable.Items.Add(tableName);
             }
         }
         listbODTable.EndUpdate();
     }
 }