Skip to content
Archive of posts tagged ObjectARX

Bricsys 2010 Developer Conference Post Mortem

I am back home after a whirlwind trip to the Bricsys 2010 Conference. I’m very happy to be back to Ohio food and my own bed. It was a great experience and well worth the trouble.

I’ve written before (and here) about the problem with food at conferences, and this one was no different. Unfortunately, there are no Burger Kings in Belgium, so the problem was compounded. I was excited when I saw a restaurant touting “American Food”, unfortunately it was “American Food as Europeans Imagine It”, which is not American food at all.

The hotel was, well, let’s just say you got that genuine experience of living in the past. Not quite the stone age past, but clearly before the age of modern locks and clocks — and well before air conditioning was invented. To make matters worse, housekeeping did not replace the provided shampoo and soap, so I had to make do with no soap on day 2 of the conference. The concert hall where the conference was held was also not air conditioned, which just compounded the problem — and certainly contributed to the dispersement of attendees from initially a small intimate group on day 1 to most of us sitting in the galleries by ourselves by the end of day 2.

The good news is that all the suffering was worthwhile. Bricsys was very accomodating, and it was a pleasure to meet modern day Robin Hood and Bricsys CEO Erik de Keyser and his merry band of men. Deelip Menezes’ keynote address about the future (cloud) of CAD (cloud) was (cloud) excellent, and the discussion that followed turned into a 12 round bout that Deelip played to a draw. Well done, Deelip, well done. I’m sure the fight will continue virtually, so take heed, and stay out of the line of fire.

I learned that Bricsys has made an impressive investment of time and resources into a foundation upon which to build a “DWG CAD” business. This is no longer about who can take on Autodesk. Autodesk conceded the AutoCAD (or “DWG”) market with their push toward subscription (aka “maintenance”), annual release cycles, and artificially high pricing on their platform technologies. There are literally dozens of companies trying to capture that market: products like ZWCAD and GstarCAD from China are hot on the heels of Bricscad. This is about who will emerge to control the market that Autodesk abandoned, and to some extent about how Autodesk will respond.

Bricscad is currently the clear leader among DWG CAD companies in terms of technical capabilities, but at least to date, it’s mostly AutoCAD application developers that recognize this (because of Bricsys’ very successful effort to make their BRX API source code compatible with ObjectARX). The question is whether they can convince consumers that Bricscad is the best choice. I think we will be a long way toward answering that question by this time next year, and of course the answer will be critically important to the DWG CAD market. I think it was shrewd of Bricsys to invite thought leaders like Deelip to this conference, but that is only a first step. Still, the very fact that I am writing and Deelip is blogging and tweeting about Bricscad is an important milestone on the road to respect.

[Full Disclosure: Bricsys paid for all my travel and conference expenses.]

Visual Studio 2010 Ships

Visual Studio 2010 shipped today accompanied by .NET Framework 4.0. I blogged before about the switch to using the MSBuild build system, and how that theoretically could be helpful in targeting multiple AutoCAD versions from the same solution. The shipping VS 2010 does not support non-Unicode response files, so out-of-the-box it cannot target VC 7.0 (for AutoCAD 2006 and earlier). When time permits, I’m planning to see if I can find a workaround; in the meantime, I’ll continue to use VS 2008 for ObjectARX.

Port Your ObjectARX Code to 64 Bit

AutoCAD versions since AutoCAD 2008 (and since AutoCAD LT 2009) have included both 32 bit and 64 bit flavors on the same media. If you install on a 64 bit Windows system, you get the 64 bit AutoCAD; otherwise you get the 32 bit AutoCAD. The 64 bit AutoCAD can take advantage of as much memory as you can throw at it, whereas the 32 bit version is limited to 2 GB (3 GB if you cheat). They should be otherwise identical in theory, but in practice there are major differences.

One big difference is VBA. Microsoft put VBA out to pasture many years ago when they introduced the .NET framework, so there will never be a 64 bit version of VBA. Autodesk had to resort to a seriously inefficient kludge to get it to work at all in the 64 bit flavor of AutoCAD (VBA has to run in a separate 32 bit process, which makes typical applications two orders of magnitude slower).

The other big difference is that any third party ObjectARX applications must be installed for the correct architecture. A 32 bit ObjectARX application will not work in a 64 bit AutoCAD. [Note that .NET (or "managed") applications typically work fine in both architectures -- I'm referring to native C++ ObjectARX applications only.]

On the Autodesk discussion groups, many people ask how they can install the 32 bit version of AutoCAD on their new 64 bit operating system. Why would they want to do that? Almost always because they need to use an application that is only available for 32 bit AutoCAD architectures, or because they discover that their VBA applications become unbearably slow.

It is possible, with some hacking of the AutoCAD installation database, to install the 32 bit flavor of AutoCAD on a 64 bit system, but I don’t recommend that. There is just no excuse any more to not support the 64 bit architecture. If you find yourself in this situation, put pressure on the developer of the application to get it ported.

In fact, if you rely on an application that hasn’t been ported to the 64 bit architecture, I’d like to hear from you. Add a comment to this post and let me know the name of the application. If you are a vendor or developer that has not yet ported your 32 bit application, please contact me — I will gladly port it for you. Even large applications can typically be ported in several hours.

BTW, I am well aware that even Autodesk is guilty of not supporting 64 bit platforms in some of its vertical market AutoCAD versions (and corresponding object enablers). I certainly hope they remedy that situation in the next release cycle.

Visual Studio 2010 and VC Build Hook

[Update: See Visual Studio 2010 Native Multi-Targeting]

Many of you use my VC Build Hook utility to target multiple versions of AutoCAD from a single solution in Visual Studio 2008. Visual Studio 2010 now includes a new feature called native multi-targeting that performs the same function as VC Build Hook. The new feature works great for using build tools back to VC 7.1, but it does not work with VC 7, which is required for targeting AutoCAD versions 2006 and earlier.

The problem is that VC 7 chokes on Unicode response files. In earlier versions of Visual Studio you could set a project property to select Unicode or ANSI response files, but that property has been removed in Visual Studio 2010. I have been told by a Microsoft engineer that the problem will be addressed in SP1, presumably by adding that project property back.

The moral of the story is that you’ll need to wait for SP1 before you’ll be able to use the VC 7 build tools from within the Visual Studio 2010 IDE. I am not planning to update VC Build Hook to support Visual Studio 2010.

Automatic LISP Loading

There are a myriad of ways to load AutoLISP applications in AutoCAD, including acaddoc.lsp, an .mnl file, the Startup Suite, and manually by various means. For application developers wishing to deploy their applications to others, all of these methods have drawbacks. The ideal solution should be easy to implement in an installation program, require minimal or zero changes to the user’s AutoCAD configuration, work the same way across all versions of AutoCAD, and easily undone when the application is uninstalled.

ObjectARX application developers have long used registry demand loading to load their applications automatically, either when AutoCAD starts or when the user enters a command that the application defines. Registry demand loading is relatively easy to set up and meets the other requirements for an ideal solution, except for one problem: it works only with ObjectARX modules (or with .NET modules in AutoCAD 2006 and later).

Many years ago, I created a solution to this problem by building a small stub ObjectARX module that did nothing but load an associated LISP file. This effectively allows the registry demand loading mechanism to be used for loading a LISP file. If you develop AutoLISP applications that could benefit from registry demand loading, then I have a Christmas present for you: LspLoad.zip contains a complete suite of newly updated stub modules for all versions of AutoCAD from AutoCAD 2000 to AutoCAD 2010, plus modules for Bricscad 9 and 10, which also supports registry demand loading.

To use the stub modules, just rename them so that the base filename matches your application’s main LISP filename, then install them in the same folder as the LISP file and create the registry demand load entries. The only work you have to do is to get the stub module to load. You can simply drag and drop the appropriate stub module into a running instance of AutoCAD in order to test it.

Creating the demand loading registry keys is not difficult, but it may require some programming. I write custom actions for my installation programs that enumerate all installed AutoCAD versions and flavors, and set up the demand load keys for every one. However you do it, the final result should look something like this (for AutoCAD 2010 on my system):

In this screen shot, I created an application called “!LspLoadTest” (the “!” was added just so it displayed at the beginning of the list). I added the minimum required subkeys. The LOADER string value is set to the complete path of the stub module, and LOADCTRLS is set to a value of 2, which means I want the application loaded when AutoCAD starts. LOADCTRLS is a bit coded value; for use with LspLoad, it’s only useful values are 2 or 4. A value of 4 means “load when my command is invoked”; this mode requires a COMMANDS subkey that lists the defined commands.

The way it works is very simple. In the example above, you can see that I renamed the module (but left the “.18.x64.arx” so that I can tell it apart). I then added !LspLoadTest.lsp to the W:\LspLoad folder. That file contained the following:

(princ “\nThis test file loaded from “)
(princ (if GetPathOf!LspLoadTest (GetPathOf!LspLoadTest) “<unknown>”))
(princ)

Now when I start AutoCAD 2010, I see on the command line:

This test file loaded from W:\LspLoad\

These files are free to use for any purpose. Have a great holiday, everyone!