乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 105|回复: 6

请问acdbOpenObject,acdbOpenAcDbObject,acdbOpenAcDbEntity()区别?

[复制链接]

124

主题

837

帖子

9

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1333
发表于 2004-9-23 22:32:00 | 显示全部楼层 |阅读模式
AcDbEntity, AcDbObject的区别是什么?
acdbOpenAcDbEntity(), acdbOpenAcDbObject(), acdbOpenObject() Global Function的区别是什么?
使用时注意些什么?
回复

使用道具 举报

14

主题

202

帖子

4

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
258
发表于 2004-9-24 08:01:00 | 显示全部楼层
1。AcDbEntity, AcDbObject的区别是什么?
答:AcDbEntity继承自AcDbObject,即除AcDbObject所有的属性和方法之外,还增加有自绘方法(属性也不一定),可以说具有图形特性。
2。acdbOpenAcDbEntity(), acdbOpenAcDbObject(), acdbOpenObject() Global Function的区别是什么?
使用时注意些什么?
答:acdbOpenAcDbEntity专用打开AcDbEntity,acdbOpenAcDbObject专用打开AcDbObject,acdbOpenObject会自动根据你的ObjectId所对应实体类型,调用acdbOpenAcDbEntity或acdbOpenAcDbObject。
回复

使用道具 举报

124

主题

837

帖子

9

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1333
发表于 2004-9-24 11:12:00 | 显示全部楼层
谢谢easypower版主
回复

使用道具 举报

124

主题

837

帖子

9

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1333
发表于 2004-9-25 00:31:00 | 显示全部楼层
不太明白:
                                         rex12:
                                         With acdbOpenAcDbEntity() you can open ONLY Objects derived from AcDbEntity,
                                         With acdbOpenAcDbObject() you can open ONLY Objects NOT derived from AcDbEntity(that is, have no graphics).
                                         acdbOpenObject()-> there are more possibilities. All descriptions you will find in docs.
                                         That is a mention for objects openning. There is no matter if you want to open an AcDb Entity or AcDbObject derived object.
                                         Art Cooney:
                                         That's not correct. acdbOpenAcDbObject() will open objects that are derived from AcDbEntity - it will open any type of object.
                                         rex12:
                                         well it's may be, I haven't try it, all i have done was to read reference and there that is written.
                                         So the reference is not correct or ...?
                                         Generally, I use acdbOpenObject function to open an object.
                                         Best Regards
                                         Art Cooney:
                                         acdbOpenAcDbEntity() checks to see if the object being opened is of a class directly or indirectly derived from
                                         AcDbEntity and returns an error if it is not.
                                         It also takes a reference to an AcDbEntity* as an argument and sets it to point to the opened entity.
                                         acdbOpenAcDbObject will open any object. It takes a reference to an AcDbObject* as AcDbObject* as an argument and
                                         sets it to point to the opened object.
                                         acdbOpenObject() is template function that is implemented for each class and takes a reference to a pointer to that
                                         class and sets it to point to the opened object. This function uses acdbOpenAcDbObject() to do the actual open operation.
回复

使用道具 举报

124

主题

837

帖子

9

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1333
发表于 2004-9-25 09:36:00 | 显示全部楼层
很好的方法:
                                         Cyrille Fauvel:
                                         I think Art replied on the subject, but just as a matter of coding style
                                         I prefer using AcDbObjectPointer class where T is the class you want to use.
                                         When using this class I do not have to mind about closing the object.
                                         AcDbObjectPointer myLine (id, AcDb::kForRead);
                                         myLine->setStartPoint(...);
                                         ...
                                         // Never call myLine->close()
                                         Ultimately the AcDbObjectPointer is calling acdbOpenAcDbObject() and close for you.
回复

使用道具 举报

14

主题

202

帖子

4

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
258
发表于 2004-9-25 13:31:00 | 显示全部楼层

有什么不明白???
回复

使用道具 举报

14

主题

202

帖子

4

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
258
发表于 2004-9-25 13:32:00 | 显示全部楼层

Smart Pointer是很好用的
值得推荐
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-2-4 22:44 , Processed in 0.151003 second(s), 66 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表