Community Scoring

Was this page helpful?

Tag Tags0

This page has no tags

Page statistics

4251 views1 edit(s)8592 characters(s) Page last modified 08:32, 27 Mar 2012 by contentconnector
How to add your knowledge

ObjectARX for AutoCAD 2013 Readme

    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.

    Software Development Tool Requirements

    • ObjectARX for AutoCAD 2013 for Mac - AutoCAD eXtensible Runtime software development kit
    • Xcode 3.2.6 - For developers running Mac OS X 10.6.8 or later
    • Carbon Qt 4.7.2 Patched - Cross-platform application and UI framework

    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.

    Installing the ObjectARX SDK

    The following steps explain how to install the ObjectARX SDK.

    1. Download the ObjectARX SDK from http://www.objectarx.com or the AutoCAD Developer Center.
    2. Double-click the ObjectARX_2013_English_Mac_OSX.dmg file.
    3. Double-click the Install ObjectARX for AutoCAD 2013.mpkg file.
    4. In the Install ObjectARX for AutoCAD 2013 installer, on the Introduction page, click Continue.
    5. On the Installation Type page, click Continue and then click Install.
    6. If prompted, enter your user name and password to continue the install.
    7. On the Summary Page, click Close when the install completes.
      The files are copied to the Autodesk and Library folders in the Developer folder located at the root of your harddrive.

    Uninstall the ObjectARX SDK

    The following steps explain how to uninstall the ObjectARX SDK.

    1. Launch Finder and browse to the root of the harddrive.
    2. Open the Developer/Autodesk folder and delete the appropriate release folder, or the Autodesk folder to remove all versions of the ObjectARX SDK.
    3. Open the Library folder under the Developer folder, and navigate down to the Autodesk folder. Delete the Autodesk folder only if you are removing all installed versions of the ObjectARX SDK.

    Sample Projects

    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.

    Building Your First Application

    Before get started, there are some points we should know:

    • DBX module should be .dylib type
    • ARX module should be .bundle/.framework type and have the .bundle file extension.
    • ARX module only works on 64-bit

    What you need

    • AutoCAD for MAC: link symbols, debug and test your apps
    • ARXSDK: header files, configurations, samples and templates
    • After install ARXSDK, open arxsdk/inc/prj_env.xcconfig, check the paths of arxsdk and autocad

    Steps to create a Hello World ARX from a Cocoa template

    1. Start XCode, create a Cocoa bundle project.
    2. Setup configurations:
      1. Open the configuration, clean up the following items: ARCHS, SDKROOT, ONLY_ACTIVE_ARCH
      2. Create a debug xcconfig file.
        #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.

      3. Create a release xcconfig file.
        #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.

    3. Add a c++ source file.
      1. Include the following headers: winstubs.h, aced.h, and rxregsvc.h
      2. Implement your command.
        void mycmd()
        {
            acutPrintf(L"Hello world.");
        }
      3. Create the entrypoint and register your commands.
        #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;
        }
    4. Build the project.
    5. Start AutoCAD and enter appload at the Command prompt. Browse to the ARX bundle and load it.
    6. At the Command prompt, enter mycmd and press Enter. The text "hello world" is displayed in the Command Line window.

    Steps to create a Hello World ARX from Autodesk template

    1. Start XCode, create a new "Arx with Cocoa" project using the Autodesk template.
    2. Build the project.
    3. Launch AutoCAD and enter appload at the Command prompt. Browse to the ARX bundle and load it.
    4. At the Command prompt, enter mycmd and press Enter.
      The text "hello world" is displayed in the Command Line window.