版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、资料位置主要资料包括3个1. ObjectARX SDK中的doc文档2. ObjectARX SDK中的sample中的readme.html3. ObjectARX SDK中的arxlabs帮助文档1.安装AutoCAD2007.exe从共享盘上复制:whk应用 (F)应用软件图像多媒体处理到本地安装目录D:下载AutoCAD 2007中文版。按照说明安装:2.安装vs2005l 考虑到是在win8上安装vs2005,必然存在兼容性的问题l 直接忽略兼容性问题,使用管理员身份安装vs2005l 安装完成以后,下载VS80sp1-KB926604-X86-CHS.exe,和VS80
2、sp1-KB932230-X86-CHS.exe,使用管理员身份安装l 安装成功以后,可以使用后,创建项目进行测试3.objectARX wizard安装4.在vs2005上进行环境配置1)创建项目In this step, you will learn how to set up a new ObjectARX project in Visual C+ .NET 2005 and you will build your first ObjectARX application.1. From the "File" pull down menu of Visual C+ .N
3、ET, select "New"->"Project.".Step 1 Figure 1 - Creating a new VC+ project 2. Click on the "Visual C+" node in the "Project Types:" tree on the "New Project" dialog that appears. 3. Select "Win32 Project" in the list of templates. 4. Ente
4、r the desired project name, for example "Step01" in the Project name edit box. 5. Set the location to the folder where you want your project to be stored, then click "OK". This will invoke "Win 32 Application Wizard" dialog.Step 1 Figure 2 - Selecting Win32 project temp
5、late 6. Select "Application Settings" tab on the wizard. Select "DLL" for the "Application type:" option.Step 1 Figure 3 - Application Wizard, specifying the application type as DLL 7. Click on "Finish" to create the project. 2)配置包含目录1. Invoke the Solution Exp
6、lorer in the VC+ .NET using the menu "View"->"Solution Explorer". Alternatively you can use the key board short cut Ctrl+Alt+L. 2. Select the project "Step01" in the Solution Explorer. Right click on the project node in the Solution explorer and select the "Prop
7、erties" in the right-click menu. This brings up the property pages dialog for the project.3. In the "Configuration:" drop-down list, select "All Configurations". This will ensure that the changes we make are applied to all the configurations. 4. Select the node "C/C+&qu
8、ot;->"General". In the "Additional Include Directories" item, add path to the include folders of the ObjectARX SDK. Also set the warning level to Level 1 and "Detect 64-Bit Portability Issues" to No. We do this to suppress the warnings which we are not going to affec
9、t us anyway in this project. Click "OK" button to apply and close the dialog. Similarly, after you had changed any property in the Property Pages dialog, you can use "OK" button to apply and close.You can specify the location for the ObjectARX header files and the library f
10、iles using the VC+ .NET Options dialog (available in the Tools->Options menu). This will ensure that VC+ .NET will search for the ObjectARX header files and library files in these paths first and hence you don't have to set the paths for every ObjectARX project. To set the paths select "
11、VC+ Directories" item in the "Projects" node in the Options dialog. From the drop-down list "Select Directories for:" select the item "Include files". Add new item and set the path to the ObjectARX header files. Similarly set the path for the library files.选择“工具选项卡
12、”选择“选项” 5. Click on the node "C/C+" in the "Configuration Properties" node. Select the item "Code Generation". Select the item "Runtime Library" in the list. Assign the property "Multi-threaded DLL (/MD), by selecting the property from the drop-down list.
13、 (黑色改)3)连接器配置1. Select the node "Linker"->"Input". In the "Additional Dependencies" item, add the following libraries: "rxapi.lib acdb17.lib acge17.lib acad.lib acedapi.lib"2. Next, select the node "Linker"-> "General". In the &q
14、uot;Additional Library Directories" item, add path to the library folders of the ObjectARX SDK. 3. In the "Output File" item, change the extension of the output file from ".dll" to ".arx".4)添加代码1. From the "Project" pull down menu, select "Add New It
15、em" (shortcut Ctrl+Shift+A). 2. In the "Add New Item" dialog, select item "C+ File (.cpp)". 3. Enter "HelloWorld" in the "Name:" edit bo and click "Add" to add the cpp file.#include "stdafx.h"#include <aced.h>#include <rxregsv
16、c.h>#include <tchar.h>/initApp() - which will be called by AutoCAD when our application is loaded and /unloadApp() - which is called when our application is unloaded.void initApp();void unloadApp(); /print "Hello world!" on the AutoCAD command linevoid helloWorld();void initApp()
17、/ register a command with the AutoCAD command mechanismacedRegCmds->addCommand(_T("HELLOWORLD_COMMANDS"), _T("Hello"), _T("Bonjour"),/ we define a transparent command below, / which means that the command can be invoked / while another command is active ACRX_CMD_TRAN
18、SPARENT, helloWorld);/ This function will remove our command group, which will also remove our command.void unloadApp() / Since commands registered with AutoCAD become additional entry points into our application, / it is absolutely necessary to remove them when the application is unloaded.acedRegCm
19、ds->removeGroup(_T("HELLOWORLD_COMMANDS");void helloWorld() acutPrintf(_T("nHello World!");/ All ObjectARX applications have one main entry point / that is used for messaging: the acrxEntryPoint() function./ No main entry point because of it is a dll project/ The first paramet
20、er of acrxEntryPoint() is a data member / of the AcRx class called msg which represents the message / sent from the ObjectARX kernel to the application./ By default, applications are locked, / which means that once loaded they cannot be unloaded.extern "C" AcRx:AppRetCodeacrxEntryPoint(AcR
21、x:AppMsgCode msg, void* pkt)switch (msg)case AcRx:kInitAppMsg:acrxDynamicLinker->unlockApplication(pkt);/ Applications need to register themselves explicitly / as being MDI aware using the acrxRegisterAppMDIAware() global function.acrxRegisterAppMDIAware(pkt);initApp();break;case AcRx:kUnloadAppM
22、sg:unloadApp();break;default:break;return AcRx:kRetOK;5)创建DEF文件1. From the "Project" pull down menu, select "Add New Item" (shortcut Ctrl+Shift+A). 2. In the "Add New Item" dialog, select item "Def File (.def)". 3. Enter "ArxProject" in the "Nam
23、e:" edit box. Click "Open" Add the following information to the new file. All ObjectARX applications have to export at least two functions: · acrxEntryPoint · acrxGetApiVersion. EXPORTSacrxEntryPoint PRIVATEacrxGetApiVersion PRIVATE6)测试1)右键“Step01”生成解决方案。2)确定无错以后,在project中找到.arx文件。3)将其
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 钟表维修工创新意识水平考核试卷含答案
- 眼科护理操作流程手册
- 螺旋分选工QC管理评优考核试卷含答案
- 电离辐射计量员复试能力考核试卷含答案
- 坚果果蔬籽加工工交接强化考核试卷含答案
- 染色小样工绩效目标评优考核试卷含答案
- 复合超硬材料制造工班组协作强化考核试卷含答案
- 制粉工基础能力考核试卷含答案
- 裁边拉毛工岗位责任制知识考核试卷含答案
- 井下采煤工安全素养能力考核试卷含答案
- 2026-2027学年人教版四年级上册数学月考试卷(第一、二单元)(含答案)
- 2026年秋季四年级数学上册第一单元测试卷(人教版大数的认识含完整答案)
- 2026年北京市中考英语试卷真题及答案详解(精校打印版)
- 2026年秋人美版(新教材)小学美术四年级上册(全册)教学设计(附目录p153)
- 重庆数字资源集团招聘笔试题库2026
- 2026年平安岗前培训测试题及答案
- 2026年广东省公需课《人工智能赋能高质量发展》试题及答案
- DB44-T 2749-2025 黄金奈李生产技术规程
- JTT 1540-2025 低温改性沥青
- 人教版七年级单词全
- 2025年合肥水投线上笔试题目及答案
评论
0/150
提交评论