CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ObjectARX 开发指南

示例应用程序

2023-1-1 07:03| 发布者: admin| 查看: 523| 评论: 0|来自: AutoCAD

下面的示例应用程序实现在加载和卸载应用程序时调用的函数。它的初始化功能向AutoCAD添加了两个新命令:CREATE和ITERATE。

它还初始化新类,并使用函数将其添加到 ObjectARX 层次结构中。(在自定义对象类示例中进行了介绍。AsdkMyClassacrxBuildClassHierarchy()AsdkMyClass

// The initialization function called from the acrxEntryPoint()
// function during the kInitAppMsg case is used to add commands
// to the command stack and to add classes to the ACRX class
// hierarchy.
//
void
initApp()
{
    acedRegCmds->addCommand("ASDK_DICTIONARY_COMMANDS",
        "ASDK_CREATE", "CREATE", ACRX_CMD_MODAL,
        createDictionary);
    acedRegCmds->addCommand("ASDK_DICTIONARY_COMMANDS",
        "ASDK_ITERATE", "ITERATE", ACRX_CMD_MODAL,
        iterateDictionary);
    AsdkMyClass::rxInit();
    acrxBuildClassHierarchy();
}
// The cleanup function called from the acrxEntryPoint() 
// function during the kUnloadAppMsg case removes this application's
// command set from the command stack and removes this application's
// custom classes from the ACRX runtime class hierarchy.
//
void
unloadApp()
{
    acedRegCmds->removeGroup("ASDK_DICTIONARY_COMMANDS");
    // Remove the AsdkMyClass class from the ACRX runtime
    // class hierarchy. If this is done while the database is
    // still active, it should cause all objects of class
    // AsdkMyClass to be turned into proxies.
    //
    deleteAcRxClass(AsdkMyClass::desc());
}

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-19 15:58

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部