[VB&c++]阿华 22:43:21
代码写的不对呗
[VB&c++]阿华 22:47:47
最好是代码帖出来
[c#]gis 22:52:01
稍等
[c#]gis 22:52:32
public void AttachAttributes(Entity ent,Attributes attr)
{
DataTable dt = new DataTable();
dt.TableName = "MapCheckAttributes";
dt.AppendColumn(CellType.CharPtr, "ChangeState");
dt.AppendColumn(CellType.Integer, "Intensity");
dt.AppendColumn(CellType.CharPtr, "Correction");
DataCellCollection Row = new DataCellCollection();
DataCell ChangeState = new DataCell();
DataCell Intensity = new DataCell();
DataCell Correction = new DataCell();
ChangeState.SetString(attr.ChangeState);
Intensity.SetInteger(attr.Intensity);
Correction.SetString(attr.Coentity.ExtensionDictionary,
OpenMode.ForWrite, false);
extensionDic.SetAt("MapCheckAttributesTable", dt);
tr.Commit();
}
}
}rrection);
Row.Add(ChangeState);
Row.Add(Intensity);
Row.Add(Correction);
dt.AppendRow(Row, true);
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
Entity entity = (Entity)tr.GetObject(ent.ObjectId, OpenMode.ForWrite, true);
if (entity.ExtensionDictionary == new ObjectId())
{
entity.CreateExtensionDictionary();
DBDictionary extensionDic = (DBDictionary)tr.GetObject(
传入的entity之前已经加入到数据库了
[c#]gis 22:55:12
有什么问题么
[c#]gis 23:03:06
怎么样,阿华
看出什么没有? |