The ObjectARX® programming environment allows developers to customize and extend AutoCAD® 2013 for Mac® via direct access to AutoCAD's database structures and its native command definition APIs. The ObjectARX for AutoCAD 2013 SDK provides object-oriented C++ programming interfaces for developers to use, customize, and extend AutoCAD.
The ObjectARX SDK can be downloaded from http://www.objectarx.com or the AutoCAD Developer Center. You will need to make sure you download the version of the SDK specific to the release of AutoCAD that you plan on targeting.
Xcode is available for download from the Mac Dev Center - http://developer.apple.com/devcenter/mac/index.action
AutoCAD hosts the Qt cross-platform application and UI framework, allowing developers to make use of the Qt SDK in their applications. AutoCAD deploys the Carbon Qt 4.7.2 Patched frameworks in its application bundle and initializes it at launch time. Developers wishing to use Qt in their applications should download and install the Carbon build of the Qt 4.7.2 Patched SDK available here: ftp://ftp.qt.nokia.com/qt/source/qt-mac-carbon-opensource-4.7.2.dmg
Please visit the AutoCAD Developer Center for the available documentation and developer training materials.
The following steps explain how to install the ObjectARX SDK.
The following steps explain how to uninstall the ObjectARX SDK.
The ObjectARX SDK provides a number of sample projects that you can build and load into AutoCAD. The sample projects are located at:
/Developer/Autodesk/ObjectARX 2013/Samples
Under the Sample folder, you will see a series of folders that organize all of the projects into logical categories. Each category folder, has several additional sub-folders that contain the actual XCode projects. Each project folder contains a Readme.txt file that describes what functionality is presented in the sample project, and how to use the project once it is built and loaded into AutoCAD.
Before get started, there are some points we should know:
#include sdk/inc/prj_arx.xcconfig and prj_debug.xcconfig;
Set correct GCC_PREPROCESSOR_DEFINITIONS and OTHER_LDFLAGS.
Add it to the project and set it as the debug configuration.
#include sdk/inc/prj_arx.xcconfig and prj_release.xcconfig;
Set correct GCC_PREPROCESSOR_DEFINITIONS and OTHER_LDFLAGS.
Add it to the project and set it as the release configuration.
void mycmd()
{
acutPrintf(L"Hello world.");
} #define COMMAND_GROUPNAME L"MYARX_COMMANDS"
#define COMMAND_NAME L"mycmd"
// All ARX apps must define this entry point
extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
switch (msg)
{
case AcRx::kInitAppMsg:
acrxDynamicLinker->unlockApplication(pkt);
acrxRegisterAppMDIAware(pkt);
acedRegCmds->addCommand(COMMAND_GROUPNAME,
COMMAND_NAME, COMMAND_NAME,
ACRX_CMD_TRANSPARENT,
&mycmd);
break;
case AcRx::kUnloadAppMsg:
acedRegCmds->removeGroup(COMMAND_GROUPNAME);
break;
default:
break;
}
return AcRx::kRetOK;
}