Get your technology fix here. Stay tuned for general tech trends, news, and articles. Work with Autodesk products? I do too! I like to write VBA, lisp and create a lot of custom tools for general consumption too. You'll find all that here and more!

Search This Blog

Tuesday, September 23, 2008

The recent LT Unlimited blog article by Kate Morrical titled: "Customize the Status Bar with MODEMACRO" reminded me of some customization I recently wrote. I received a call from a remote architect who needed some assistance with Linetypes. She was concerned that when switching from model to paperspace her linetypes weren't always displaying correctly.

I explained that she should be adjusting her ltscale variables in order to see the linetypes when in modelspace. She wished for an "automatic solution". So I wrote a quick macro, using VBA, to automatically set the correct lt and psltscale values based on the current value of dimscale. I tied the macro to the AcadDocument_LayoutSwitched event so that whenever she switched layouts, the macro would update the values.

To provide graphic feedback that this system was working I chose to use the MODEMACRO system variable. Here is the macro in action with visual feedback occuring on the status bar.

Here is the code from the vba macro that sets the MODEMACRO variable. You can see from the code snippet below, that I am displaying the current value of the MEASUREMENT, DIMSCALE, LTSCALE, and PSLTSCALE variables.