找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 656|回复: 0

[推荐]:Double Click API

[复制链接]
发表于 2003-8-17 10:51:57 | 显示全部楼层 |阅读模式

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

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

×
Double Click API.
====================

There is a new ObjectARX API exposed in AutoCAD 2000i for handling
double-click events on entities.  The API is based on the new ARX
class AcDbDoubleClickEdit and will allow reactor handlers to receive
notification messages of double-click events on AutoCAD entities.

The default behavior in AutoCAD 2000i when an entity is
double-clicked is to invoke the appropriate entity-specific editor,
or (if there is no specific editor) the Object property Manager.
If multiple entities are selected, double-clicking an entity in
the selection will bring up the Object Property Manager.

It is possible to override the default behavior by trapping the
double-click notification for AcDbEntity-derived entities in
ObjectARX.  The notification order will ascend the inheritance
tree from the selected entity type up through AcDbEntity, so the
double-click notification can be handled anywhere in between.

The API is implemented through Protocol Extensions.  The client
would need to derive a class from AcDbDoubleClickEdit for each
entity type to be notified of a double-click event.

Example for a PLINE:

#include "AcDblClkEdit.h"
class AcDbDoubleClickEditPline : public AcDbDoubleClickEdit
{
public:

   ...
   void startEdit(AcDbEntity *pEnt,AcGePoint3d pt);
   void finishEdit(void);
};

The client would need to implement both startEdit() and finishEdit()
methods in order to receive notification messages.  Note that these
are the only two messages available.

When the client is loaded, the AcDbDoubleClickEdit class needs to add
the protocol extension to the appropriate database object.
For example within InitApplication():

pPlineEdit = new AcDbDoubleClickEditPline;
AcDbPline::desc()->addX(AcDbDoubleClickEdit::desc(),pPlineEdit);

Similarly, when the client is unloaded, it should delete the protocol
extension from the appropriate database object:

AcDbPline::desc()->delX(AcDbDoubleClickEdit::desc());

The client also needs to link with AcDblClkEditPE.lib, and should verify
that the AcDblClkEditPE.arx file is loaded: (Also within InitApplication):

acrxDynamicLinker->loadModule(/*MSG0*/"ACDBLCLKEDITPE.ARX",Adesk::kFalse);
  

The sample 'DblClickSamp' is a MSVC project that demonstrates the use of the
double-click API feature.  The sample works with 'PLINE', 'SPLINE' and
'CIRCLE' entities.  When a user double-clicks a PLINE or SPLINE, a vertex
or fit-point will be added to the object at the cursor location, which can
then be edited using grips.  When a CIRCLE is double-clicked, the color
index is changed. When any other entity is double-clicked, the appropriate
entity-specific editor is invoked, or (if none exists) Object Property Manager.

感兴趣的朋友可在 \Samples\DblClick 中找到例子
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-9-21 02:47 , Processed in 0.186916 second(s), 32 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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