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: , , , , , , , ,

Wednesday, October 08, 2008

AutoCAD Architectural Schedule Formula Tip

Problem: Schedule Formula (simple area addition) does not display as intended.

Solution: Check your format for the underlying property set variables.

Image

As you can see from the image above, the combined area of two properties is not displaying as intended. What can I do to get a simple sum that displays in square feet? Here is the executive summary.

1.) Verify that your Schedule Cell format is set to Area.
2.) Now check each variable in the formula and scroll to the right setting their format to "standard" instead of area as shown in the following image.

That's it! Your Problem is solved!

Image

Continue reading below for the step by step version.

Step by Step:
Step 1: Select your schedule table, right click your mouse and choose "Edit Schedule Table Style..." from the pop up menu.


Image
Step Two: When the Style Editor dialog box appears, navigate to the offending column and select it by left clicking with your mouse. Now move your mouse to the "Modify..." button at the bottom of the dialog box and left click it with your mouse. Now find the sample values list area indicated by #3 in the image below and left click and hold your mouse button down while sliding your mouse to the right. When you can see the format column you can let go of the mouse and continue to the next step.


Image
Step Three: Double check that your chosen data format is "Area" for the Column Properties as shown in #1 in the image below. Next move your mouse back to the sample values list and change the format value for your variables to "standard" from "Area" as shown in the image below next to #2 and #3 in the image.


Image
Step Four: Left Click the "OK" button and verify that your schedule updates to display as shown below. You did it! Congratulations!


Image

Hope that helps!

Labels: , , , , ,