ObjectARX学习笔记(十六)--如何设置CAD选项对话框的配置AcApProfileManagerReactor反应器
来源:互联网 发布:maclc如何安装windows 编辑:程序博客网 时间:2024/04/26 20:47
<pre name="code" class="cpp">如何设置CAD选项对话框的配置利用>反应器就可以设置
// (C) Copyright 1999-2006 by Autodesk, Inc. //// Permission to use, copy, modify, and distribute this software in// object code form for any purpose and without fee is hereby granted, // provided that the above copyright notice appears in all copies and // that both that copyright notice and the limited warranty and// restricted rights notice below appear in all supporting // documentation.//// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE// UNINTERRUPTED OR ERROR FREE.//// Use, duplication, or disclosure by the U.S. Government is subject to // restrictions set forth in FAR 52.227-19 (Commercial Computer// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)// (Rights in Technical Data and Computer Software), as applicable.//#if defined(_DEBUG) && !defined(AC_FULL_DEBUG)#error _DEBUG should not be defined except in internal Adesk debug builds#endif#include <rxregsvc.h>#include <aced.h>#include <dbxutil.h>#include <acprofile.h>#include <adslib.h>#include "tchar.h"// Define a class derived from AcApProfileManagerReactor to manage // the notifications.//class AsdkProfileManagerReactor : public AcApProfileManagerReactor{public: void currentProfileWillChange(const TCHAR *newProfile); void currentProfileChanged(const TCHAR *newProfile); void currentProfileWillBeReset(const TCHAR *curProfile); void currentProfileReset(const TCHAR *curProfile); void profileWillReset(const TCHAR *profName); void profileReset(const TCHAR *proName);};// Define the notification functions//void AsdkProfileManagerReactor::currentProfileWillChange(const TCHAR *newProfile){ acutPrintf(_T("\nCurrent profile will change: %s"), newProfile);}void AsdkProfileManagerReactor::currentProfileChanged(const TCHAR *newProfile){ acutPrintf(_T("\nCurrent profile changed: %s"), newProfile);}void AsdkProfileManagerReactor::currentProfileWillBeReset(const TCHAR *curProfile){ acutPrintf(_T("\nCurrent profile will be reset: %s"), curProfile);}void AsdkProfileManagerReactor::currentProfileReset(const TCHAR *curProfile){ acutPrintf(_T("\nCurrent profile has been reset: %s"), curProfile);}void AsdkProfileManagerReactor::profileWillReset(const TCHAR *profName){ acutPrintf(_T("\nA non-current profile will be reset: %s"), profName);}void AsdkProfileManagerReactor::profileReset(const TCHAR *profName){ acutPrintf(_T("\nA non-current profile has been reset: %s"), profName);}voidaFunction(){ acutPrintf(_T("This is AsdkProfileSample Test Application...\n")); // Attach the reactor for the duration of this command. Normally // this would likely be added upon application initialization. // AsdkProfileManagerReactor *pProfileRector = new AsdkProfileManagerReactor(); acProfileManagerPtr()->addReactor(pProfileRector); // Obtain the path for the registry keys and print it out. // TCHAR *pstrKey; acProfileManagerPtr()->ProfileRegistryKey(pstrKey, NULL); if (pstrKey != NULL) { acutPrintf(_T("\nThe profiles registry key is: %s"), pstrKey); acutDelString(pstrKey); } // Get the list of all profiles in the users configuration // and print them out. // AcApProfileNameArray arrNameList; int nProfiles = acProfileManagerPtr()->ProfileListNames(arrNameList); acutPrintf(_T("\nNumber of profiles currently ") _T("in the user profile list is: %d"), nProfiles); for (int i = 0; i < nProfiles; i++) acutPrintf(_T("\nProfile name is: %s"), arrNameList[i]); // Copy the unnamed profile to the AsdkTestProfile // acProfileManagerPtr()->ProfileCopy(_T("AsdkTestProfile"), _T("<<Unnamed Profile>>"), _T("This is a test")); // Reset the newly copied profile to AutoCAD defualts. // acProfileManagerPtr()->ProfileReset(_T("AsdkTestProfile")); // Make this new profile current. // acProfileManagerPtr()->ProfileSetCurrent(_T("AsdkTestProfile")); // Change a value in the profile. We'll just make the // cursor big. // struct resbuf rbCursorSize; rbCursorSize.restype = RTSHORT; rbCursorSize.resval.rint = 100; acedSetVar(_T("CURSORSIZE"), &rbCursorSize); // Rename the profile to a new name. // acProfileManagerPtr()->ProfileRename(_T("AsdkTestProfile2"), _T("AsdkTestProfile"), _T("This is another test")); // Export the profile. // acProfileManagerPtr()->ProfileExport(_T("AsdkTestProfile2"), _T("./AsdkTestProfile2.arg")); // Import the profile. // acProfileManagerPtr()->ProfileImport(_T("AsdkTestProfile3"), _T("./AsdkTestProfile2.arg"), _T("This is a copy of AsdkTestProfile2") _T("by Exporting/Importing"), Adesk::kTrue); // Remove the reactor. // acProfileManagerPtr()->removeReactor(pProfileRector);}voidinitApp(){ acutPrintf(_T("AsdkProfileSample ARX Test; Type ProfileSample to execute")); // register a command with the AutoCAD command mechanism // acedRegCmds->addCommand(_T("AsdkProfileSample_COMMANDS"), _T("AsdkProfileSample"), _T("ProfileSample"), ACRX_CMD_MODAL, aFunction);}void unloadApp(){ // Remove the command group added via acedRegCmds->addCommand // acedRegCmds->removeGroup(_T("AsdkProfileSample_COMMANDS"));}extern "C" AcRx::AppRetCode acrxEntryPoint(AcRx::AppMsgCode msg, void* appId){ switch (msg) { case AcRx::kInitAppMsg: acrxDynamicLinker->unlockApplication(appId); acrxDynamicLinker->registerAppMDIAware(appId); initApp(); break; case AcRx::kUnloadAppMsg: unloadApp(); break; case AcRx::kLoadDwgMsg: break; case AcRx::kUnloadDwgMsg: break; case AcRx::kInvkSubrMsg: break; default: ; } return AcRx::kRetOK;}
0 0
- ObjectARX学习笔记(十六)--如何设置CAD选项对话框的配置AcApProfileManagerReactor反应器
- ObjectARX学习笔记(六)----如何设置点的样式和大小 CAD二次开发
- ObjectARX学习笔记(二十三)---AcEdInputPointMonitor 反应器,用来重载CAD鼠标点处实体的提示信息
- ObjectARX学习笔记(五)---- 如何弹出标准CAD文件打开和保存对话框acedGetFileD
- ObjectARX学习笔记(二十六)--如何炸开块AcDbBlockReference
- ObjectARX学习笔记(二十)--如何自定义启动CAD(附加命令行形式)(一)
- ObjectARX学习笔记(三十二)----如何设置AcDbMText对齐方式
- ObjectARX学习笔记(三十三)----如何设置打断实体AcDbCurve
- ObjectARX学习笔记(七)----RGB和CAD颜色索引之间的转换
- ObjectARX学习笔记(二)----中如何设置实体的颜色setColorIndex
- ObjectARX学习笔记(三)----中如何设置实体所在的图层setLayer
- ObjectARX学习笔记(十九)--如何设置扩展字典的数据AcDbDictionary
- Objectarx 设置CAD标注样式
- ObjectARX学习笔记(十四)--枚举CAD命令行子窗口acedGetAcadTextCmdLine();
- ObjectArx 中反应器Reactor的使用
- ObjectArx学习笔记-设置字体样式
- ObjectARX反应器概述
- CAD ObjectARX扩展工具的源码(三)
- Longest Increasing Subsequence
- 意尔康:连锁专卖店如何实现集中式管理
- linux常用命令
- 好用的画图工具 octave
- js页面跳转整理
- ObjectARX学习笔记(十六)--如何设置CAD选项对话框的配置AcApProfileManagerReactor反应器
- P2000、MSA1040、MSA2040存储容量比较
- Linux挂载移动硬盘、U盘
- MFC对话框增加最大化和最小化按钮
- 携一缕清风静处
- PHP中 xml转数组
- 本土主帅纷纷下课
- Android中模拟post表单提交,带参数及文件参数
- 理解inode