找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 2849|回复: 9

[讨论]:我对于扩展数据、扩展字典、自定义实体的看法

[复制链接]
发表于 2002-11-13 17:22:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
http://www.xdcad.net/forum/showthread.php?s=&threadid=16471
看了上面那个帖子后我的一点看法:

1. 扩展数据的优点有哪些?对于保存实体数据来说,扩展字典已经完全可以胜任,而且无论在空间上还是在保存类型上,都比扩展数据要好的多。我现在知道的扩展数据的好处是,可以用来方便的查询实体,构造选择集。

2. 我个人对扩展记录中的dxf码不是很懂,我知道在扩展记录用kDxfSoftPointId可以保存其他实体的ID,从而建立关联,这是个很不错的功能。不知道有否大虾能够在这里解释一下扩展记录中这么多dxf码到底是怎么用的。

3.上面那个帖子中有朋友提到大规模数据保存的问题,我不知这样行不行: 自定义一个从AcDbObject继承的类,对于需要保存的数据,可以打包保存在这个类中,然后加入到实体的扩展字典中去。
不知道这样是否可行,望大虾赐教。

4.对于自定义实体,当然有它很大的好处,这一点相信大家都是公认的。但是对于自定义实体,图纸的交流是个大问题。

5. 对于多实体JIG的问题,不知道除了在JIG中生成一个虚拟的自定义实体外,还有没有别的方法。

以上几点,权当抛砖引玉,希望各大虾指正
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2002-11-13 19:36:34 | 显示全部楼层
当你合并两个图形的时候扩展字典会被带到另一个图形中,两个图形的数据就冲突了
而扩展数据就不会。
扩展数据与实体关联,实体删除了扩展数据也就不用了,用词典不就麻烦了
我是这么想想的
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 145个

财富等级: 日进斗金

发表于 2002-11-13 23:42:21 | 显示全部楼层
一般情况下,扩展数据足够用了,也很方便。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 181个

财富等级: 日进斗金

发表于 2002-11-14 08:41:42 | 显示全部楼层
最初由 fylinwater 发布
[B]当你合并两个图形的时候扩展字典会被带到另一个图形中,两个图形的数据就冲突了
而扩展数据就不会。
扩展数据与实体关联,实体删除了扩展数据也就不用了,用词典不就麻烦了
我是这么想想的 [/B]


扩展记录有两种,一种是保存在符号表中的,正如你说的那种,另一种是保存在实体上的,跟扩展数据一样,实体删除后也自动删除。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2002-11-14 09:14:29 | 显示全部楼层
下面是目录objectrx---------samples-------------dataxtsn下的一段话,来不及翻译了,估计大家都看得懂:

(C) Copyright 2001 by Autodesk, Inc.

    To store data on an existing object,  there are two common mechanisms in
    use:

     1 - Use Protocol Extension to attach/manipulate Xdata on the object for
         which the data is needed.

     2 - Define an AcDbObject class to be stored in the extension dictionary
         of the object for which the data is needed.

    These methods are logically equivalent operations, but they have different
    qualities and capacities, which need to be compared to the requirements of
    the problem.

    The basic difference is that Protocol Extension Xdata has less storage
    overhead, but a limited capacity (i.e. Xdata has a 16k per object limit),
    while Extension Dictionaries have essentially unlimited storage capacity
    but more storage overhead.

    In the two sample programs provided in this directory, we are using the
    mechanisms to effectively add a string variable to any instance of
    AcDbObject.  In this trivial endeavor,  the Protocol Extension Xdata
    version, the specific code is roughly 260 lines versus about 200 lines for
    the Extension Dictionary version,  including comments. So, both mechanisms
    require the same amount of code.  The Protocol Extension Xdata form is
    considerably more compact in storage overhead.  But imagine
    a version where either 200K per object was required, or over a hundred
    distinct heterogenous fields were needed.  That custom object,  with
    compiled-in random access to all those fields wouldn't look nearly as bad
    as the corresponding resbuf chain parser for Xdata.
下面还有一段key points,可是这里已经超长了,而且又不能连续发贴,真是郁闷!
等有人回复了之后我再贴吧
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2002-11-14 09:31:07 | 显示全部楼层
继续发吧
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2002-11-14 10:29:39 | 显示全部楼层
谢谢fyje

Key points:

    1 - The amount of XData per AcDbObject instance is restricted to a total of
        16K bytes for all REGAPP groups.

    2 - The amount of overhead for Xdata is roughly 12 bytes per object plus
        another 12 bytes per REGAPP group.  The amount of overhead for an
        object in the dictionary is roughly 60 bytes for the extension
        dictionary itself, plus another 60 bytes for the object in the
        dictionary, plus the length of the lookup string.

    3 - The Extension Dictionary and the entry object in question must be
        opened and closed when they are used whereas Xdata is part of the
        main object.

    4 - The Extension Dictionary objects can be persistent reactors, and
        recieve notification whenever anything happens to their master object
        (most easily read as their owner's owner).  Protocol Extension, with
        or without Xdata, can't do this.

    5 - Xdata is preserved in both DXF and DWG formats, and Release 12 DWG formats
        regardless of whether the application is present. Custom data objects (other
        than Xrecords) will become proxies when the application is not present to
        support them. Proxy (zombie in R13) objects are not written to either Realse
        12 DWG files, nor pre-Realease 13c4 DXF files.

    6 - Conversely, there is no way for Xdata-based extensions to find out that
        the database went through edits when the drawing was loaded without the
        ARX app being present.
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 145个

财富等级: 日进斗金

发表于 2002-11-14 12:31:12 | 显示全部楼层
最初由 urgod 发布
[B]谢谢fyje

Key points:

    1 - The amount of XData per AcDbObject instance is restricted to a total of
        16K bytes for all REGAPP groups.

    2 - The amount of overhead for Xdata is rou... [/B]


哪位朋友能给翻译一下?谢谢
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 28个

财富等级: 恭喜发财

发表于 2018-9-29 19:08:39 来自手机 | 显示全部楼层
扩展字典上的xrecord好像关闭图形后再打开就没了
来自: 微社区
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 87个

财富等级: 招财进宝

发表于 2020-10-26 07:49:04 | 显示全部楼层
新手,还不懂怎么使用扩展字典
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-4-25 09:43 , Processed in 0.351622 second(s), 49 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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