明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: 明经快报

[.net群] 2013-05-01 明经 AutoCAD.NetApi (2474812) 群聊记录:有没有关于xrecord xdata 命名字典 扩展字典的介绍,我想存点

 关闭 [复制链接]
 楼主| 发表于 2013-5-1 19:26 | 显示全部楼层
[C#]小伟 19:26:37
质心跟几何中心一样不?
从O开始 承接cad 19:26:49
不一样
质心不一定在多边形内部
[C#]小伟 19:33:36
[C#]小伟 19:34:19
几何中心一定在多边形内么?
从O开始 承接cad 19:34:39
肯定的了
[C#]小伟 19:35:02
 楼主| 发表于 2013-5-1 19:50 | 显示全部楼层
[c#]gis 19:50:54
好吧,谢谢你了
 楼主| 发表于 2013-5-1 22:30 | 显示全部楼层
[c#]gis 22:30:54
想问下,我想一个entity加了一个datatable,保存的时候说
此图形中的一个或多个对象无法保存为指定格式
 楼主| 发表于 2013-5-1 22:43 | 显示全部楼层
[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
怎么样,阿华
看出什么没有?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-18 20:01 , Processed in 0.179527 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表