Microsoft Visual C/C++ Environment

To make it less confusing when working with multiple versions of ObjectARX, I recommend removing the ObjectARX SDK folders from your global VC settings, and adding them instead to the project settings for each individual project. Doing so gives you more local control over the project, and makes it less confusing when you need different build configurations to use different versions of ObjectARX in the same project. ...

3 min · Owen Wengerd

Miscellaneous

0 min · Owen Wengerd

Undocumented Commands

Some of these commands are present in the AutoCAD command table, but are disabled, and therefore are not recognized as commands. They are included for the sake of completeness. Command Introduced Notes *SCROLL R12 Resets the "pan" scroll bars. .ACADSTATUS pre R12 Creates ACAD.SLG in same directory as ACAD.EXE. The file contains an internal status log. [You must precede this command with an extra period to use it at the command line.] .ACLTSTATUS R13 Same as ACADSTATUS, except for AutoCAD LT. [You must precede this command with an extra period to use it at the command line.] .SYSSTATUS R14 Does nothing. -OLDMTEXT R14 Runs the R13 -MTEXT command. ADIDUMP R13 Does nothing. AXIS pre R12 It just tells you it's a discontinued command (remember AXISMODE?) CONTENT R14 Does nothing. Could it be a prelude for the 'Content Explorer'? CONVERTPOLY R14 Convert both ways between old style polylines and the new lightweight polylines. This is a very useful one! DLGCOLOR* R13 Controls dialog colors in R13/DOS, does nothing in other versions. *This command is documented in R13, but not in R14. DRGINSERT R14 Does nothing. DUMPMEMALLOC R13 Provides internal memory information. DVBIN R14 Does nothing. Probably intended for importing VBA macro. DVBOUT R14 Does nothing. Probably intended for exporting VBA macro. ENDSV R12 An interesting variant of END, with a warning about being unable to save vector files(?). FILEOPEN R12 A command-line only variant of OPEN. In R13, this command is issued when selecting a file from the MRU file list in the 'File' menu. KABOOM! R13 Does nothing. Looks fun, though! KRISTI R13 Creates cat_acad.h and cat_acad.rc in the ACAD.EXE directory. These files contain resource definitions for all loaded toolbar buttons. They don't look very useful to me, but I'll bet Kristi needed them. MAKEBLK R14 Does nothing. OFFLINE R13 Warns that it is "not converted to AcDb yet", then does nothing. OLDMTEXT R14 Runs the R13 MTEXT command. OLDMTPROP R14 Runs the R13 MTPROP command. PAINTER R13 Does nothing in R13, runs _MATCHPROP in R14. PRPLOT pre R12 Tells you that it's a discontinued command (remember "printer plots"?) RENDENV R14 Does nothing. SETENV R13 Does nothing. UNLOCK R13 Does nothing. VIEWTOOLBAR R13 Does nothing. XDRGINSERT R14 Does nothing. Additional Information: ...

2 min · Owen Wengerd

ADS / ObjectARX

0 min · Owen Wengerd

Periscope

Summary Periscope provides fast drawing entity feedback in a compact tooltip-like scope window as you move the cursor over the objects (including objects nested in blocks). The displayed information is designed to supplement the visual information seen on the screen by showing “invisible” properties in an intuitive and compact fashion. Two common uses are to quickly get a grasp on the contents of drawings obtained from third parties and to check drawings for drafting standards conformance. Custom extenders may be created in VBA or .NET to extend or modify the information displayed in the scope window by providing text with HTML formatting. Periscope supports the following platforms: ...

2 min · Owen Wengerd

Undocumented System Variables

Variable Type Range Introduced Notes _LINFO string - pre R12 Hardware lock serial number; responds to (getvar "_LINFO") only. _PKSER string - R9[2] The AutoCAD serial number (read-only). Note that in versions of AutoCAD prior to R11(?), the serial number was a string in the executable which could be hacked to read 00-000000. In R11(?) a hook into the ZOOM command was enabled to immediately crash AutoCAD if the serial number string was tampered with.[2] _SERVER boolean 0/1 R11[2] Network license server status (read-only). _VERNUM string - R13 AutoCAD build number. AUXSTAT integer -32768 - 32767 R13 auxiliary input device status[3] AXISMODE boolean 0/1 pre R12 Holdover from old AXIS command; no longer used. AXISUNIT '(x y) - pre R12 Holdover from old AXIS command; no longer used. BS_BITS[2] integer -32768 - 32767 R11 only DBGLISTALL * * R10[2] Unknown function. *Note that this was an integer with range -32768 - 32767 from R10 - R11, then it became a boolean (0/1).[2] ENTEXTS integer [0, 1, 2] R12 Controls drawing extents calculation. 0 : extents are calculated each time they're needed (slower, but uses less memory). 1 : cache extents of each entity in short (2-byte) values if possible (compromise between speed and memory efficiency). 2 : cache extents of each entity as long (4-byte) values (fastest extents calculations, but uses more storage memory). ENTMODS integer 0 - ~4Gig R12 Increments every time a database object is modified (read-only). FORCE_PAGING integer 0 - ~4Gig R13 GLOBCHECK integer [0, 1, 2, 3] R13 3 : show DCL dialog size when displaying dialog. >0 : disallow local-language commands (very useful for developers!). JWDEBUG[2] ? ? R9 - R10 Probably a "debug" flag used by a programmer with initials J.W. (John Walker?) KESDEBUG[2] ? ? R9 only Probably a "debug" flag used by a programmer with initials K.E.S. LAZYLOAD boolean 0/1 R13 NODENAME string - R13 AutoCAD node name. NOMUTT boolean 0/1 R14.01 1 (True) : No input prompts are displayed. PHANDLE integer 0 - ~4Gig R12 PRODUCT string - R14 Product name (e.g. "AutoCAD") (read-only). PROGRAM string - R14 Executable name (e.g. "acad") (read-only). QAFLAGS bitcode 0 - 32767* R11 bit 0 (1) : ^C in menu macro cancels grips (acts like keyboard <Esc>). bit 1 (2) : no pause during text screen listings. bit 2 (4) : no "alert" dialogs (text display instead). bit 7 (128) : accepts "screen picks" (point lists) via (command) function. *Note that this was an integer with range -32768 - 32767 in R11, then it changed to 0 - 32767 in R12.[2] Additional Information: ...

3 min · Owen Wengerd

Using VC Build Hook to Target Multiple AutoCAD Versions

[Update: Visual Studio 2010 now includes a built in feature called native multi-targeting that replaces the need for VC Build Hook. Read this blog post to learn how to use VS 2010 to target older versions of Visual Studio.] I created the VC Build Hook utility in order to make it possible to use the current Visual Studio IDE for building ObjectARX applications that target any version of AutoCAD. This is desirable because ObjectARX applications must be built by the Visual C/C++ build tools that correspond to the ObjectARX SDK version for the target AutoCAD version. VC Build Hook works by switching the executables path during a Visual Studio build and pointing the paths to the desired version of the Visual C/C++ build tools. In addition, VC Build Hook automatically fixes build tool command options to account for differences between VC versions so that build commands produced by one version of Visual Studio are correctly interpreted by another version of the build tools. Assuming you've already set up your projects as described here (note that you must have a working installation of the necessary version of Visual C/C++ build tools and runtime libraries), then you'll need to install the current version of VC Build Hook: ...

5 min · Owen Wengerd

AutoLISP

0 min · Owen Wengerd

Demand Loading a LISP File

The registry demand loading feature in AutoCAD, BricsCAD, and ZWCAD is a great method for loading ObjectARX/BRX/ZRX modules automatically at startup, and it's relatively easy to create the demand loading settings from an installation program or MSI file at install time. Unfortunately it only works for ARX/BRX/ZRX files (and also with .NET dlls in AutoCAD 2006 and later). Some years ago, I created a small ARX module called VLXLoad. The purpose of this module was to work as a stub to load an associated .vlx file of the same base name in the same folder. I've since renamed this small utility to LspLoad and expanded it so that it can load any type of LISP file. The idea is to rename the LspLoad.*.* file to the name of the associated .lsp/.vlx/.fas file (i.e. MyApp.18.arx will look for and load MyApp.vlx in the same directory), then create demand load registry settings to load the renamed LspLoad module. Voila, the associated LISP file gets loaded as if it was being demand loaded from the registry. ...

2 min · Owen Wengerd

Undocumented AutoLISP Functions

FunctionNotes (_ver) Returns AutoLISP build number (?). (report) Inroduced in R12/DOS; never worked in Windows. (vmon) Discontinued. Once used to enable virtual memory; still there for compatibility, but does nothing. (xstrcase) An international-friendly version of (strcase). Additional Information: An undocumented feature of the (getcfg) and (setcfg) functions in R13 and later is that you can access "private" areas of the configuration file (*.cfg) by passing a key string of the form (getcfg "CfgData/Version/ExecutableDate&Time"). This retrieves the "ExecutableDate&Time=" value in the [Version] section of the configuration file, for example. Miscellaneous Destroying Handles (Pre-R13 Only) In AutoCAD R12 and earlier, it was difficult to programmatically destroy handles because the HANDLES command required the user to type in a randomly selected passphrase (of several) before it continued. This was done to make it extremely difficult to destroy handles accidentally. Unfortunately, this also made it extremely difficult to automate the task. Apparently Autodesk ran into the same problem, because they programmed the HANDLES command to accept a special "passkey" which always works regardless of the displayed passphrase. Here's the secret passkey: ...

3 min · Owen Wengerd

Undocumented ObjectARX Functions

Notes Only R14 functions are presented at this time. Many of these exist in R13 as well, however no effort has yet been made to distinguish R14-only functions. In case you're wondering, all this information was legally obtained using only standard programming tools. The functions (and symbols) listed below are "exported" from Acad.exe. An exported C++ function has its return type and argument types embedded in its name, therefore it's relatively easy to get a complete function prototype for such functions. An exported C-Style (ADS) function does not contain any information about its arguments or return types, so those functions are more difficult to prototype. Nevertheless, examination of the function's name often gives away its purpose, and this is often enough to deduce its prototype. ...

5 min · Owen Wengerd

Using VC 7 to Build For AutoCAD 2000/2002

With the advent of AutoCAD 2004 and Visual Studio .NET (aka Visual Studio 2002), ObjectARX programmers are again faced with the task of moving from an older version of a compiler (VC6) to a newer version (VC7). Rather than maintain two versions of compilers and two versions of projects for supporting both AutoCAD 2000/2002 and the new AutoCAD 2004, it makes sense to use only the newest IDE to support *all* target AutoCAD platforms. ...

6 min · Owen Wengerd