点击对象 recordset.AddNew 添加的属性值要如何获取

0 投票
添加代码如下:  

 Recordset  recordset = datasetVector.GetRecordset(false, CursorType.Dynamic);
                Dictionary<string, object> dic = new Dictionary<string, object>();
                dic.Add("id", name);
                recordset.AddNew(geometry3D, dic);
                recordset.Update();

获取代码如下:

  public void sceneControl_ObjectSelected(object sender, ObjectSelectedEventArgs e)
        {

SceneControl sceneControlSelect = (SceneControl)sender;
            Selection3D[] selection3dList = sceneControlSelect.Scene.FindSelection(true);//获取选中集合
            Selection3D seletion3D = selection3dList[0];
            if (seletion3D != null)
            {

 Layer3DDataset layer3DDataset = seletion3D.Layer as Layer3DDataset;
                    Recordset re = seletion3D.ToRecordset();

}

}
1月 14 分类:  31次浏览 | 用户: 回首那一抹云烟 初出茅庐 (41 分)

2 个回答

0 投票
re .GetFieldValue()
1月 14 用户: 程逸诗 名扬四海 (3,810 分)
报错呢 System.ArgumentException:“Exception_WasThrown
Arg_ParamName_Name”
是获取添加的  Dictionary<string, object> 里面的id
re .GetFieldValue("id")你需要那个字段就获取那个字段呀
0 投票
是获取添加的  Dictionary<string, object> 里面的id
1月 14 用户: 回首那一抹云烟 初出茅庐 (41 分)
报错呀  System.ArgumentException:“Exception_WasThrown
Arg_ParamName_Name”
...