




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、資料位置主要資料包括3個(gè)1. ObjectARX SDK中的doc文檔2. ObjectARX SDK中的sample中的readme.html3. ObjectARX SDK中的arxlabs幫助文檔1.安裝AutoCAD2007.exe從共享盤上復(fù)制:whk應(yīng)用 (F)應(yīng)用軟件圖像多媒體處理到本地安裝目錄D:下載AutoCAD 2007中文版。按照說明安裝:2.安裝vs2005l 考慮到是在win8上安裝vs2005,必然存在兼容性的問題l 直接忽略兼容性問題,使用管理員身份安裝vs2005l 安裝完成以后,下載VS80sp1-KB926604-X86-CHS.exe,和VS80
2、sp1-KB932230-X86-CHS.exe,使用管理員身份安裝l 安裝成功以后,可以使用后,創(chuàng)建項(xiàng)目進(jìn)行測試3.objectARX wizard安裝4.在vs2005上進(jìn)行環(huán)境配置1)創(chuàng)建項(xiàng)目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.選擇“工具選項(xiàng)卡
12、”選擇“選項(xiàng)” 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)創(chuàng)建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)確定無錯(cuò)以后,在project中找到.arx文件。3)將其
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 罐頭食品標(biāo)準(zhǔn)與法規(guī)知識(shí)考核試卷
- 陳壽的‘職場生存手冊’:《三國志》中的職場智慧解析
- 2025年簽訂租賃合同注意事項(xiàng)
- 2025建筑裝修工程合同模板
- 2025移動(dòng)房屋建設(shè)安裝合同
- 隧道施工方法及其基本作業(yè)
- 蘇教版六年級(jí)上冊數(shù)學(xué)期末總復(fù)習(xí)教案2篇
- 二零二五版護(hù)士聘用合同
- 小水電站轉(zhuǎn)讓協(xié)議書
- 建筑物清潔合同書
- 醫(yī)療機(jī)構(gòu)執(zhí)業(yè)登記匯報(bào)
- 群文閱讀《杜甫詩三首》(公開課課件)
- 《浙江省建筑垃圾資源化利用技術(shù)導(dǎo)則》
- 小學(xué)生運(yùn)動(dòng)會(huì)安全教育課件
- 變更控制程序(包含永久變更、臨時(shí)變更)
- 《如何閱讀文獻(xiàn)》課件
- 員工考勤培訓(xùn)課件
- 豐田C-HR汽車說明書
- 黑臭水體監(jiān)測投標(biāo)方案(技術(shù)方案)
- 余華讀書分享名著導(dǎo)讀《文城》
- 變更被告申請書模板
評(píng)論
0/150
提交評(píng)論