August 29, 2011

My colleague Arne just released a helpful little utility aptly named the Digital Pen Library Utility. This tool plugs a few gaps we’ve noticed in the Anoto digital paper library software during our development sprints while building our smartpen based solutions at ChasmTech. This utility provides the ability to more effectively manage your digital paper libraries by checking if printed documents in the library are still pending. This will give you a clear view of the current library allowing you to decide if it is safe to archive the current library and start a fresh one. More details on this download can be found on the ChasmTech download page.

August 9, 2011

Even though it’s the year 2011 and ObjectARX is available in all its glory for .NET I still spend a lot of time in the Visual Lisp IDE (VLIDE). While ObjectARX is powerful and full of awesome, it comes at a cost of a lot of overhead to setup a project, add all the needed references, heck even compiling / debugging is a huge pain in the ass in comparison to Lisp. Lisp is still hands down the most efficient way to do most batch modifications within an AutoCAD session for those who have made the time to learn it.

There are a couple of problems with Visual Lisp right now though. One of my biggest complaints about the VLIDE is the default colors. The high contrast white background is an eye killer. The IDE is configurable though and we’re given full a 16 bit color palette – with which I was able to configure a color scheme that was more to my liking. If you start Visual Lisp, go to the Tools menu and choose Window Attributes you are presented with the dialog that should let you configure your colors. Before opening this configuration dialog select a code window in Visual Lisp to modify. Set the properties accordingly. If you are happy with the colors when you press Ok on the dialog you will be prompted to “Use current as EDITOR prototype?”. Clicking yes here will update you editor prototype, resulting in future windows using these defaults.

One key limitation here is that on x64 editions of AutoCAD this dialog is broken. You may also see the following error when you attempt to close the dialog:

**Update May 11th 2012 – This appears to have been fixed in AutoCAD 2013 x64. Hurray!

It seems that Autodesk has let this code go to some extent. I’ve seen a number of forum posts of people mentioning the unwind error. This is a shame and partly why I’m writing this post! First off – if you have an x86 release of AutoCAD you are in luck. You can configure your IDE no problem using the UI. For you x64 users, all is not lost. Lucky for us Visual Lisp saves all this configuration information to a text file named VLIDE.dsk. On my Vista x64 machine its found in the following locations:

If you open up this file you’ll see a large list of dotted pair lists full of settings. The one I’m most interested in here is the *editor-sample-window property. This is the “default” configuration to use when opening a lisp file.

Two values of importance are FGC (foreground color) and BGC (background color). I was having a hard time finding a color wheel that did integer based color codes – but you can convert your favorite hex color codes to decimal (helpful hex to decimal converter here). The next bit is a little ugly. Within the :CLV property we have a list. This list is basically a list of 16 bit integers containing a color code of the foreground and background color of each window property. If the color is set to nil – it is transparent. This list appears to be in the order in which the properties are displayed within the UI:

:LEX-SPACE

:LEX-STR

:LEX-SYM

:LEX-NUM

:LEX-INT

:LEX-REAL

:LEX-COMM

:LEX-COMM1

:LEX-COMM2

:LEX-PAREN

:LEX-SPEC

:LEX-SPEC1

:LEX-UNKN

:WINDOW-TEXT

:WINDOW-SELECTION

:ERROR-HIGHLIGHT

:INPUT-ZONE

:CONSOLE-MESSAGE

TW and LM contain the tab width and left margin respectively. So go wild editing these values and configure your new IDE! Keep in mind when editing the Visual Lisp settings using the UI, the vlide.dsk file is not saved until AutoCAD is shutdown cleanly. If AutoCAD crashes, you will lose your configuration. If you would like to try out my IDE settings – I’ve attached a zip file containing a copy of my .DSK file. I also recommend you make a backup of the .dsk file before you start tinkering.

Now, if only I could figure out some way to build a vlx file from the command line so as to integrate it into my automated build system..

For those of you who don’t read the comments – Dennis Hill was cool enough to share his digging into the DSK file and also his IDE colors which I’ve been running for a week or so now. Take a minute to read the comments and check out his color scheme. Thanks Dennis!