Tuesday, June 23, 2009

Legacy VBA Error - For next loop may really mean If end if.

I was updating some legacy VBA code today and had to add some additional logic to a function. When I click the run button, I was faced with this dialog box
A quick check of the code indicates that there IS a closing "NEXT" statement for the "For Each..." loop. When this happens to you, check any "If...." logic constructs within the "For ... Next" loop. Chances are you'll find a missing "End if" statement.

Labels: , , , , , , , , , ,

Friday, May 08, 2009

Get the AU Online Code!


Many of you have attended Autodesk University and know the value of this fantastic training and networking event. But I know that many of you don't get an opportunity to attend for many reasons. Since I have access to the training materials, I thought I would share the code with those who've never attended.

Here's the deal: Send me an email stating why you want to experience AU through the online portal. I'll select five people and then send them a link that will let them register and gain access to the thousands of classes, handouts, and screencasts. Don't delay. This deal expires on June 1st, 2009.

Labels: , , , , , , , , , , ,

Friday, February 27, 2009

ACA 2009 VBA Macro - Room Zoom Available


R2009Find_Room_Zoom2.dvb is a VBA Macro that displays a modeless userform on the screen with a text box and a button labeled "Find". When you enter a room or space number in the text box and click the "Find" button, it will cycle through all the available space/room objects in the current drawing and any attached xref files and zoom your display to center on that space or room with the corresponding number. This macro originated in Autodesk Architectural Desktop (ADT) R3.3 and is now updated for Autodesk AutoCAD Architectural (ACA) Release 2009.

Take a look at the code within the macro to see how to:


  • Use the acfocus control (allows you to keep the form visible on the screen while you interact with entities within your file.

  • Find the schedule property and get the associated space or room object.

You'll find more helpful utilities in past posts here and at AUGI.com, R U a Member?

Labels: , , , , , , , ,