June 17, 2007

Free Webcast - ACA Details


Steve Bennett, of LA CAD and tireless AUGI volunteer, is offering a free, one-hour webcast on Wednesday, June 20, 2007, titled Utilizing the Detail Engine in AutoCAD Architecture. See the details and find a link to the registration site in this article in his blog.

7/7/2007 Update: Steve is offering another webcast, this time on Project Management, on Wednesday, July 25, 2007. Get the details and a link to the registration site here.

June 16, 2007

Rounded Values and the Quantity Column

Many times you may have objects and associated data that you would like to document in a Schedule Table, but there are large numbers of "identical" objects - all the data in each objects row is the same - and you really do not need to show each line. This is just the situation that the quantity column was meant to handle - check the box on the Columns tab when creating or editing your Schedule Table Style to add a Quantity column, as shown in the image below.With a quantity column in your schedule table, all identical rows will "collapse" into a single row, with the total number of objects represented listed in the quantity column. If you do not want to display the actual quantity, simply hide the quantity column.

An interesting question came up in this thread in the Autodesk Architectural Desktop 2007 & Prior Discussion Group. The images in this blog post were taken from the ADT 2006 drawing file I posted in reply. The goal was to list spaces and their areas in a schedule table, using a quantity column to collapse spaces of the same type and area onto one line. Unfortunately, there were slight differences in the actual areas of the spaces, such as those in my sample file, as illustrated by the schedule table below. I created an "unformatted" automatic property to which I assigned a Property Data Format that is a copy of the Standard Property Data Format, with the precision set to eight decimal places.There are two different types of spaces: offices, at a nominal 100 square feet, and conference rooms, at a nominal 150 square feet. Intentional (in my case) stretching of the spaces by varying small amounts resulted in the slightly different areas shown, and preventing any lines from collapsing. Given the obviously different values, this is not surprising.

The discussion group poster noted that he had created a Property Data Format for his area properties that rounded the values to the nearest whole number, but this still was not allowing the rows to collapse, despite the apparently identical values. As shown below, I was able to reproduce that in my sample file. ADT is using the raw automatic property value, before the application of the Property Data Format, to determine whether rows are identical, as can be seen in the schedule table shown below.
Fortunately, there is a way to achieve the desired result, other than insisting on precise drafting. And while that is something of a pet peeve of mine, there certainly could be situations where there are legitimate small variations in a given value, that disappear when rounded to the desired accuracy for reporting the value. I can think of two ways to achieve the desired result, both of which involve the use of a formula property. Which works best for you will depend upon the specifics of your situation.

The first formula uses the unformatted automatic property and applies the Round function to get the desired precision, as seen below. For whole number precision, the Fix function may also work, although that will simply truncate any fractional amount, rather than round it.The advantage of using an unformatted property to get a numeric value, then applying the Round function in a formula property is that you can control the desired precision, and, with a little math, can even get a precision greater than whole number. For example, if you wanted to have the area value rounded to the nearest 50 square feet, you could do something like this:
Round( [NetAreaUnformatted]/50, 0 ) * 50
By dividing the value by 50, rounding, then multiplying the value by 50, you will get the value, rounded to the nearest 50. One thing to note for the Round function is that if the value of the digit beyond the one being rounded is exactly 5, the digit being rounded will round up if the digit is odd and down if the digit is even (that is, the result will always be an even digit). The results of using that formula in the schedule table can be seen below - the values for all four offices and all four conference rooms are now the same, so they collapse onto two lines, one for each type.
The second formula assumes that you can achieve the desired rounding with a Property Data Format, and simply takes the formatted version of the automatic property and passes it through the formula, enclosed in double quotation marks, to convert it to a string value, like this:
"[NetArea]"
Since the Property Data Format made the displayed values for each space type the same, the string will be the same, and the rows will collapse, as seen in the image below.
If you are interested, you can download the sample file I posted to the thread and take a look at the formulas "live".

June 15, 2007

AU 2007

Having attended three of the last four Autodesk Universities - I missed the 2005 edition in Orlando - I can attest to the fantastic opportunities to learn from and network with the best of the best. Even if you could afford to have Matt Dillon or Paul Aubin fly in and give you three-and-one-half days of one-on-one training, you would still miss out on all of the informal learning opportunities and the chance to meet fellow users, any one of whom might have a solution to an issue that has been giving you problems. Not to mention being able to "corner" members of the AutoCAD® Architecture development team, and provide some direct feedback.

If were thinking about going this year, but you have not yet started laying the groundwork, there is no better time than the present to start. Registration opens in "August", according to the Autodesk AU website. That is likely to be early in August, going by past years. If you need to make the case to your employer or a spouse, you will want to do so well before October 8, when the fees go up $500. Many of the more popular classes may be filled by that time, anyway.

If you need an additional incentive, and were hoping to be able to take a class that goes beyond the basics of the ACA Schedule feature, I am pleased to announce that my class proposal titled Get Fully Equipped in AutoCAD Architecture (90-minute class) has been accepted. I will be presenting a method of creating and scheduling equipment that I have used for several health care projects and which could easily be used on laboratory projects or adapted to any other project type where you need to show equipment or furniture in plan, with identifying tags and then create a schedule to list those items and related data. If that sounds interesting to you, and you are going to AU this year, I would appreciate you taking this class into consideration when selecting your classes.

If you are looking for a course that covers the basics of the ACA Schedule feature, Matt Dillon will be presenting Schedule Anything in AutoCAD Architecture or AutoCAD MEP in a 3 1/2 hour tutorial. If you have never taken Matt's Schedule Anything class before and are looking to master the basics of the Schedule feature, I can assure you that it will be well worth your time.

I do not know where on the schedule either of these classes fall at this time, but I hope that Matt's class is offered first, so that anyone wanting to take both, but who would benefit most by learning about the overall feature first, can do so.

June 02, 2007

ACA/ADT Layer LISP Functions

06/30/2013 - Updated to include ACA 2013 and 2014.
04/03/2011 - Updated to include ACA 2012.
01/27/2010 - Updated to include ACA 2008 - 2011!

AutoCAD® Architecture (ACA) and Autodesk® Architectural Desktop (ADT) ship with an ARX file that contains LISP functions that work with Layer Standards and Layer Keys. Mark Webb of Autodesk posted a synopsis of the LISP functions that were available in the AecLMgrLISP40.arx file that accompanied ADT 2004; you can obtain that synopsis in this thread in the AutoCAD Architecture Customization Discussion Group. Look for my repost on May 8, 2007.

Note that the name of the ARX file changes, depending upon the version you are using.
ADT 2004 - AecLMgrLisp40.arx
ADT 2005 - AecLMgrLisp45.arx
ADT 2006 - AecLMgrLisp47.arx
ADT 2007 - AecLMgrLisp50.arx
ACA 2008 through ACA 2014 - AecLMgrLisp.arx

ADT 3.3 included an ARX file called aeclayermanagerui30.arx; if memory serves, not all of the LISP functions listed in the synopsis noted above are present in that version.

Here is some sample code for loading the proper ARX function, based on the value of the ACADVER system variable. It supports ADT3.3 through ACA 2014.
(setq sacdvr (getvar "ACADVER"))
;; ARXload proper ARX function:
(cond ; cond A.
((= "15.06" sacdvr)
;; ARXload ADT3.3 function:
(if (not (member "aeclayermanagerui30.arx" (arx)))
; If the ARX file is not currently loaded...
(progn ; ...do the following:
(prompt "\nARXloading \"aeclayermanagerui30.arx\". ")
; Display prompt noting file to be loaded.
(if (arxload "aeclayermanagerui30.arx" nil)
; If ARX file loads successfully...
(setq flag T) ; ...set flag to T.
(prompt "\n; error: ARXLOAD failed")
; ...else display prompt and return nil.
) ;_ End if.
) ;_ End progn.
(setq flag T) ; ...else already loaded, set flag to T.
) ;_ End if.
) ;_ End condition A1.
((= "16.0" sacdvr)
;; ARXload ADT2004 function:
(if (not (member "aeclmgrlisp40.arx" (arx)))
; If the ARX file is not currently loaded...
(progn ; ...do the following:
(prompt "\nARXloading \"aeclmgrlisp40.arx\". ")
; Display prompt noting file to be loaded.
(if (arxload "aeclmgrlisp40.arx" nil)
; If ARX file loads successfully...
(setq flag T) ; ...set flag to T.
(prompt "\n; error: ARXLOAD failed")
; ...else display prompt and return nil.
) ;_ End if.
) ;_ End progn.
(setq flag T) ; ...else already loaded, set flag to T.
) ;_ End if.
) ;_ End condition A2.
((= 16.1 (atof sacdvr))
;; ARXload ADT2005 function:
(if (not (member "aeclmgrlisp45.arx" (arx)))
; If the ARX file is not currently loaded...
(progn ; ...do the following:
(prompt "\nARXloading \"aeclmgrlisp45.arx\". ")
; Display prompt noting file to be loaded.
(if (arxload "aeclmgrlisp45.arx" nil)
; If ARX file loads successfully...
(setq flag T) ; ...set flag to T.
(prompt "\n; error: ARXLOAD failed")
; ...else display prompt and return nil.
) ;_ End if.
) ;_ End progn.
(setq flag T) ; ...else already loaded, set flag to T.
) ;_ End if.
) ;_ End condition A3.
((= 16.2 (atof sacdvr))
;; ARXload ADT2006 function:
(if (not (member "aeclmgrlisp47.arx" (arx)))
; If the ARX file is not currently loaded...
(progn ; ...do the following:
(prompt "\nARXloading \"aeclmgrlisp47.arx\". ")
; Display prompt noting file to be loaded.
(if (arxload "aeclmgrlisp47.arx" nil)
; If ARX file loads successfully...
(setq flag T) ; ...set flag to T.
(prompt "\n; error: ARXLOAD failed")
; ...else display prompt and return nil.
) ;_ End if.
) ;_ End progn.
(setq flag T) ; ...else already loaded, set flag to T.
) ;_ End if.
) ;_ End condition A4.
((= 17.0 (atof sacdvr))
;; ARXload ADT2007 function:
(if (not (member "aeclmgrlisp50.arx" (arx)))
; If the ARX file is not currently loaded...
(progn ; ...do the following:
(prompt "\nARXloading \"aeclmgrlisp50.arx\". ")
; Display prompt noting file to be loaded.
(if (arxload "aeclmgrlisp50.arx" nil)
; If ARX file loads successfully...
(setq flag T) ; ...set flag to T.
(prompt "\n; error: ARXLOAD failed")
; ...else display prompt and return nil.
) ;_ End if.
) ;_ End progn.
(setq flag T) ; ...else already loaded, set flag to T.
) ;_ End if.
) ;_ End condition A5.
((or
(= 17.1 (atof sacdvr))
(= 17.2 (atof sacdvr))
(= 18.0 (atof sacdvr))
(= 18.1 (atof sacdvr))
(= 18.2 (atof sacdvr))
(= 19.1 (atof sacdvr))
(= 19.2 (atof sacdvr))
) ;_ End or.
;; ARXload ACA 2008 through 2014 function:
(if (not (member "aeclmgrlisp.arx" (arx)))
; If the ARX file is not currently loaded...
(progn ; ...do the following:
(prompt "\nARXloading \"aeclmgrlisp.arx\". ")
; Display prompt noting file to be loaded.
(if (arxload "aeclmgrlisp.arx" nil)
; If ARX file loads successfully...
(setq flag T) ; ...set flag to T.
(prompt "\n; error: ARXLOAD failed")
; ...else display prompt and return nil.
) ;_ End if.
) ;_ End progn.
(setq flag T) ; ...else already loaded, set flag to T.
) ;_ End if.
) ;_ End condition A6.
(T
(alert
(strcat
"Unsupported version of AutoCAD is running."
"\nACADVER = " sacdvr "."
"\n\nPlease notify Computer Services."
) ;_ End strcat.
) ;_ End alert.
nil ; Return nil.
) ;_ End condition A7.
) ;_ End cond A.

Note that after running that code, the LISP variable flag will be set to T (true) if the ARX file was already loaded or was successfully loaded and will be set to nil if the ARX file failed to load. Your subsequent code may want to test that value before trying to use one of the LISP routines defined by the ARX file.

One function that many users will find useful is AecGenerateLayerKey function, which takes one argument, the name of a Layer Key as a quoted string. If a layer of that name does not exist in the drawing file, it will be created, using the parameters specified in the current Layer Key Style, and the layer name returned. If a layer of that name already exists, the layer name is returned, but no changes are made to the layer's properties (color, linetype, etc.), even if they do not agree with those set in the Layer Key Style. That is consistent with the way a Layer Key works when called by an ACA/ADT object create command, or by AEC Content. If the specified Layer Key does not exist in the current Layer Key Style, the Layer Key name is returned as a quoted string. No other action is taken, if you want that layer set current, trap the return value, test to see if it is nil and, if not, use the CLAYER system variable or the LAYER command in your routine to set that layer current. This function allows you to add Layer Keying to any custom LISP routines you may have for things that AEC Content alone can not do easily, or which you wrote long before using ADT/ACA.

A pair of functions I found useful when customizing a Layer Standard for my firm were the AecLayerSaveStdAsText and AecLayerLoadStdAsText functions. This allows you to export the contents of a Layer Standard as a formatted text file, open the text file in a text editor, like Notepad, carefully make edits - preserving the proper formatting, then reload the edited file as a Layer Standard in a drawing file. My firm's Layer Standard is based on the U.S. National CAD Standard, and I wanted to have all of the Minor fields available in both Minor1 and Minor2. Rather than enter each field twice in the editor available inside ADT or ACA, I was able to export the Layer Standard to a text file, copy all the Minor1 field values to Minor2 and then reload the text file. I believe I may have tweaked some of the other field values before reloading the file, as well. Much more efficient, and it avoided the possibility of typos when doing the same thing twice.

There are a number of other layer-related functions in the ARX file, for setting Layer Key Overrides, toggling Layer Key Overrides on and off, generating a list of Layer Keys and working with layer snapshots. Take a look at what is available, and make use of those that fit your needs.