June 02, 2007

ACA/ADT Layer LISP Functions

10/30/2014 - Updated to include ACA 2015
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 2015 - 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 2015.
(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.0 (atof sacdvr))
(= 19.1 (atof sacdvr))
(= 20.0 (atof sacdvr))
) ;_ End or.
;; ARXload ACA 2008 through 2015 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.

May 26, 2007

Drawing Accurately

I can not stress enough the importance of drawing accurately when using Autodesk® Architectural Desktop, AutoCAD® Architecture, or even AutoCAD®, for that matter. Nearly all of my work is done in imperial units, and when creating "the model" (or just "drawing"), I generally keep my units set to Engineering (feet, inches and decimal inches) and the precision set to at least five decimal places, to avoid having small errors being masked by the rounding that takes place when using architectural units.

I often hear, "Why bother, it will not be built with that level of accuracy in the field and the precision on the dimensions is set to 1/8" anyway?" I understand that in the field, getting to within 1/4" of the design is a very good day, and that any given wall is not straight, nor are any two walls perpendicular or parallel. Your design needs to make allowances for construction tolerances, particularly when a more precise item, such as a factory produced object, is installed adjacent to a less precise item, like a field-built wall. I would argue that you still want to draw accurately so that you know what dimension you "should" have, and then apply your tolerances to that.

One very important reason is that Autodesk Architectural Desktop/AutoCAD Architecture objects can do some strange things when they are not drawn precisely. (And, as Larry Bettes notes in the Discussion Group thread noted below, not only should the objects be drawn precisely, but you want to start from a point that is a whole number, or at least does not require all 16 of the significant figures available.) Another important reason is if you draw your model accurately, you can query the model for information and have a reasonable level of confidence that the information you get back is accurate. Is it just me, or are the very people who draw with the precision set to a large value or "eyeball" when placing a new object or moving an existing one ("Snaps, what are those?" "Keying in a distance takes too much time!") the very same people who think you can take that inaccurate model and blindly add dimensions and everything will be just fine? Perhaps the error between any two adjacent walls is small, and less than construction tolerances, but when you have a number of such inaccuracies added together, you can not always count on them cancelling each other out.

Here is one example of how small imprecisions can add up to sizable error. The total error in this example is small, but keep in mind the precision on the dimension strings is 1/64", and in one foot the error is already four times that. The images below are based on a file I created and posted to this thread in the Autodesk Architectural Desktop 2007 & Prior Discussion Group.

I did modify the dimension style to use the Arial text style and bumped the DIMSCALE up to 2 so that the numbers would be more easily seen in the screen captures.

I started with a dimension style that has its precision set to 1/64" and drew a dimension exactly 1'-0" long. As you can see in the image below, the Measurement property of the dimension indicates 1'-0.00000000".

Then I added eight dimensions, each of which displays 1 1/8" as the dimension value (no text overrides here, trust me).

Given this, you would expect a closing dimension to show 3", since 1'-0" - (8 * 1.125") = 3". But you would be wrong, as can be seen below.

How did the closing dimension end up being 3 1/16"? Simple: all eight of the 1 1/8" dimensions are identical, and as shown below, are NOT exactly 1.125", but are instead 1.1175". This makes each one just less than 1/128" shy of 1 1/8" (and therefore just over 1/128" more than 1 7/64"), so the value rounds up to the nearest 1/64", or 1 1/8". This gives the impression of 1/8" accuracy without the substance, and allows the closing dimension's measurement, 3.06000000, to be reported at 3 1/16".

So a series of small inaccuracies can add up to a significant one. And while the difference may still be relatively minor, the point is that by drawing inaccurately, you are allowing the person doing the layout on site to determine where any extra dimension goes or where any missing dimension is taken out. Nine times out of ten you may not care. But that tenth time, when the expensive piece of millwork does not fit, you will care, but it will be too late. If you work on a team with others who rely on the accuracy of your work to do their work, you may find that you care even sooner. With all of the tools at hand in Autodesk Architectural Desktop/AutoCAD Architecture, it really does not take that much additional effort to draw accurately, and the time you save chasing dimension strings that do not add up and dealing with layout issues in the field will more than make up for the extra effort. And you may see fewer wall cleanup issues, to boot!

May 10, 2007

Cycling Between Viewports in a Layout

Those of you who used Autodesk® Architectural Desktop prior to the introduction of the Customize User Interface (CUI) files in 2006 may recall that the menu file included an "accelerator" for the CTRL+R keystroke combination that would cycle between the viewports in a layout whose extents are at least partially visible on-screen. Those of you who have been using AutoCAD® for many years may also recall that the "original" accelerator was CTRL+V [or ^V in a menu macro], which got supplanted when Windows came along and made CTRL+V "paste".

The ability to cycle through the viewports can be handy when you have overlapping viewports and the program decides the one you want is "underneath" the one you do not want, and is essential if you have an "underneath" viewport that is entirely within the boundaries of another viewport. For whatever reason, the CTRL+R accelerator did not get incorporated into the ADT.cui file, so users of 2006 and later may find they no longer can cycle through viewports using CTRL+R. The good news is nothing else has been assigned to CTRL+R, and it is not difficult to add the CTRL+R functionality back.

In CUI files, the old accelerators are now called Shortcut Keys and are found under the Keyboard Shortcuts category of a given CUI. You can add Shortcut Keys to the main CUI or any partial CUIs you may have loaded; if you have a separate CUI for your company standard menu items or for your personal use, you may want to add the CTRL+R Shortcut Key there, to aid in migrating to future releases. The Help contains instructions for how to add a Shortcut Key, and there is even a video in the 2007 Help for those of you who are visually oriented. You can find this by navigating here: AutoCAD Help > Customization Guide > Customize the User Interface > Add Shortcut Keys and Temporary Overrides. In 2006, click on the Procedures tab, then select the "To create a shortcut key" link. In 2007, the video is on the "Add Shortcut Keys and Temporary Overrides" page.

For those who have an allergic reaction to the Help, or who find the fact that the instructions are written around the ACAD.cui, not the ADT.cui too annoying to bear, the balance of this article covers the specifics of adding the ^V macro as a Shortcut Key and assigning the CTRL+R keystroke to it. The first thing you will need to do is open the Customize User Interface dialog. Type CUI at the Command: prompt. If you hate keyboarding and want to use a pulldown menu, you will not be able to use the Tools pulldown, as noted in the Help [unless you have added that from the ACAD.cui file]. If you have added the CAD Manager pulldown menu [Window > Pulldowns > CAD Manager Pulldown] you can start the CUI command from there, as shown below. [As always, you can view a full-size version of reduced size images by clicking on the image.]

Set the Customize tab active, if it is not already current. The upper left pane of the Customize tab lists the CUI files that are loaded. You can choose to show all CUI files, or focus on one using the dropdown list at the top of the pane. Expand the CUI in which you want to add the CTRL+R Shortcut Key and then expand the Keyboard Shortcuts category, as shown below. You will not see the large red arrow, which I added to the image for emphasis.

Here is a tip for those of you who have fully embraced the AutoCAD® Architecture/Autodesk Architectural Desktop mindset of right-clicking to do just about anything. In this case, it will not work. You can right click on either "Keyboard Shortcuts" or "Shortcut Keys" and a context menu will obediently appear, but there will not be an option to add a new Shortcut Key, as can be seen in the image below.

New Shortcut Keys are created by dragging the command you want from the Command List in the lower left pane of the CUI dialog and dropping it onto "Shortcut Keys" in the upper left pane. Fortunately for our example, there is alread a "command" in the Command List, named "CTRL+R", that has the ^V macro assigned to it, so we do not need to add a custom command to the list. Scroll down in the Command List list box until you see the "CTRL+R" command.

Left click on and then drag the "CTRL+R" command up to "Shortcut Keys" in the upper left pane and drop it there.

Expand the Shortcut Keys subcategory, if it did not do so automatically while you were dragging and dropping, and then find and select your new "CTRL+R" command on the list of commands. This will change the display on the right side of the Customize tab of the CUI dialog, displaying "Shortcuts" in the upper right pane, with a list of all of the Shortcut Keys commands, and "Properties" in the lower right pane. Since you selected "CTRL+R" command in the upper left pane, it is highlighted in the upper right pane and the Properties pane shows the properties for that command. Notice the horizontal bar in the left column in the Shortcuts pane, rather than the check mark that the other commands have. That is because a keystroke has not been assigned yet.

To assign a keystroke, click in the right column next to the "Key(s)" line in the Access category of the Properties pane. An ellipsis button will appear at the right side of that line; select it to open the Shortcut Keys dialog.

The Shortcut Keys dialog allows you to indicate what keystroke combination you want to assign to this command. Click in the edit box, if the focus is not already there, then press the "CTRL" and "R" keys at the same time, to enter "CTRL+R". The dialog will tell you what command is currently assigned to that keystroke combination, if any. If you are satisfied with the entry, select OK to return to the CUI dialog box.

You have now assigned a keystroke combination to the CTRL+R command, and the Shortcuts pane now shows a checkmark in the first column on that line, as well as the assigned keystroke combination in the Keys column. Select the Apply button to save this change to the CUI, if you have additional changes to make, or select OK to save the change and return to the drawing file.

You should now find pressing CTRL+R when model space is active on a Layout with multiple viewports visible on screen will cycle through those viewports. You will want to back up the CUI file in which you made the change, to avoid having to do it again in the future, should you ever "lose" that file.

April 27, 2007

File Format Change in AMEP 2008

Here is a heads up for anyone using AutoCAD® MEP or anyone who works with those who do. While AutoCAD® Architecture 2008 uses the same file format as its predecessor, Autodesk® Architectural Desktop 2007, AutoCAD MEP 2008 does NOT use the same file format as Autodesk® Building Systems 2007. Apparently, AutoCAD MEP 2008 files will not be compatible with the 2007 releases.

While the Object Enabler site does not list anything for the 2008 products, an Object Enabler for AutoCAD MEP 2008 is available here. The site lists it being applicable only to the 2008 release of Autodesk products. The Readme does not indicate that installing the enabler would affect the format of any non-AutoCAD MEP files that were opened.

April 26, 2007

Revising a Schedule Table Style

Here is the situation: Some time back you developed a Schedule Table Style that references one or more Property Set Definitions and it has served you well and been used in many drawings. But now you have decided that you need to add a new property to one of those Property Set Definitions, and add a new column to your Schedule Table Style to display the values of that property. You diligently edit the Property Set Definition and Schedule Table Style in your office's central source file and test it out in some newly created drawings and all is working well.

You then announce the change to the rest of the firm, and someone who has a project in progress tries to add the new Schedule Table Style to an existing drawing that already had the old version. No matter how many times the new Schedule Table Style is dragged into the existing drawing in Style Manager, it seems as though the old version refuses to leave. Worse yet, if you delete all existing instances of that Schedule Table Style from the drawing and purge the old definition, when you add the new one, is still does not have your newly added column! What gives - is your drawing doomed to being eternally haunted by the old version of the Schedule Table Style?

Fortunately, the answer is no. The reason why the new Schedule Table Style loses the new column is that the old Property Set Definition is still present in the existing file. When you imported the new style into a new drawing to test it, it would have brought along the new version of the Property Set Definition, provided it was not defined in the new drawing (which is why you should keep your styles in source files and import them when needed, and not preload them into your template files). But, if the target file already has a Property Set Definition of that name, which would be the case in that existing file that had the old version of the schedule, the new Property Set Definition is not imported and the old version will remain. And since the new property does not exist in old Property Set Definition, the column referencing that property gets deleted from the Schedule Table Style.

The solution is to copy the new Property Set Definition into the existing file first, then copy the new Schedule Table Style. Now the new column will stay in the Schedule Table Style, and you are good to go. Of course, if the new property is a manual one, any existing objects/styles will have the default value, which you will likely need to edit, unless the default value just happens to be correct.

April 15, 2007

ACA 2008/ADT 2007: Setting a Different Property Data Format in a Formula Property

A new feature added to Autodesk® Architectural Desktop 2007 and also available in AutoCAD® Architecture 2008 builds on the addition of the Sample Value pane to the Formula Property Definition dialog in the 2006 release. The Sample Value pane allows you to test the formula you have written by entering sample values for the other properties referenced by the formula. The 2006 release listed the Property Data Format [PDF] that was assigned to each referenced property; starting in the 2007 release, you can change that initial assignment to any of the other PDFs defined in the current drawing.

Not only does the PDF assigned in the Sample Value pane affect the way the sample value is displayed in the Formula Property Definition dialog, it affects the way the value is input to the formula itself. Furthermore, the PDF assigned in the Sample Value pane works on the "raw" value of the referenced property, BEFORE the PDF assigned to the property is assigned. This means that you no longer need to create an unformatted version of a property for use in a formula calculation as well as a formatted version for display in a Schedule Tag or the Properties palette. This can be a big time saver if you never need your formula properties to work in versions of ADT prior to 2007. Since saving back to prior releases without exploding ADT objects is generally a difficult thing to do, most using 2007 or 2008 should be able to take advantage of this feature.

It also means that if you set up a formula that references a property, then later decide to change the PDF assigned to that property, you will also have to go back to the formula property and change the PDF there if you want the changed PDF to be used in the formula property as well. This is how I "discovered" this feature - I had set up a property in ADT 2007, used it in a formula, realized I needed to increase the precision of the PDF assigned to the property, and was surprized to find that the formula property was still acting as though the precision had not been changed. After poking around a bit in the file and making certain that I had actually changed the precision on the property, I finally opened the formula and noticed that the PDF showing in the Sample Value pane was still set to the "old" value, that I could change the PDF to any other one in the file, and that the assigned PDF was what governed the way the data was brought into the formula. I currently use ADT 2004 on a day-to-day basis at work, so it may be possible that back when 2007 came out, I was aware of being able to set a PDF in the Formula Property Definition dialog, but I am fairly certain that I did not understand exactly what that meant until yesterday.

The following screen captures illustrate the potential for this feature. A drawing file was created and the units set to inches, Engineering format, with a precision of eight decimal places, so that the effects of varying precision in the PDF would not be masked by the units or precision in the drawing file. A wall was drawn, with a length of one hundred and five one-hundred-millionths inches [8'-4.00000005"] and a height of one hundred and one two-hundred-fifty-sixth inches [8'-4.00390625"]. The image below shows part of the Design tab of the Properties palette with this wall selected, and shows the length and width in Engineering units, with eight-decimal-place precision.
Two new Property Data Formats were created: Length - Extremely Short, a copy of Length - Short, with the precision increased to 1/256 of an inch...
...and Standard-8, a copy of Standard, with the precision increased to eight decimal places and no zero suppression. [Click on any reduced image to see a full-size version.]
A new Property Set Definition called WallObjectsTest01 was created, and properties referencing the Height and Length automatic property sources were added to it. The Length - Extremely Short PDF was assigned to the Height property and the Standard-8 PDF was assigned to the Length property. Five formula properties were added to the Property Set Definition, to demonstrate the effects of various PDF assignments in the Sample Value pane. Each of the five formula properties simply passes through one of the automatic property values and is assigned the Standard-8 PDF, so that it will display at maximum precision in the Properties palette. A summary of the properties in the WallObjectsTest01 Property Set Definition can be seen in the image below.
The Height-LengthExtremelyShort formula property keeps the default Length - Extremely Short PDF assigned to the Height value.
The Height-Standard formula property changes the PDF assigned to the Height property value in the formula to Standard.
The Height-Standard-8 formula property changes the PDF assigned to the Height property value in the formula to Standard-8.
The Length-Standard formula property maintains the Standard PDF assigned to the Length property.
The Length-Standard-8 formula property changes the PDF assigned to the Length property value in the formula to Standard-8.
The image below shows the values returned by each of the properties in the WallObjectsTest01 Property Set Definition for the test wall previously described.Note the following results:
  • The Height automatic property reports the height in architectural imperial units with a precision of 1/256 of an inch, in this case, the exact value is reported, since the height was set to exactly 8'-4 1/256".
  • The Height-LengthExtremelyShort formula property returns a value of 8. This is an improvement over earlier releases, where the presence of the embedded double quotation mark used as an inch symbol would have caused an error, but the value would likely not result in a correct calculation. Beware using formatted values in formula properties.
  • The Height-Standard formula property returns a somewhat more accurate value, but it is rounded at the third decimal place, because the Standard PDF has a precision of three decimal places. That may well work for certain calculations, but if you need greater precision for a given calculation, you will want to create a PDF that provides it.
  • The Height-Standard-8 formula property returns the full decimal equivalent value, because the eight-decimal-place precision of the Standard-8 PDF is capable of delivering it.
  • The Length automatic property reports a length of 100. This is because it has the Standard PDF assigned, so the precision is limited to three decimal places and trailing zeros are suppressed.
  • The Length-Standard property also reports a length of 100. This is because Standard PDF is applied to the Length value, resulting in a value of 100. When this value is returned from the formula property, it is interpreted as an integer, and the eight-decimal-place precision for real numbers in the Standard-8 format, which is assigned to the formula property itself, does not come into play. If the formula property were amended to include a CDbl function to force the Length value to be interpreted as real number, the result would be 100.00000000, as the five hundred-millionths would have already been lost when the Standard PDF was applied to the Length value.
  • The Length-Standard-8 property reports the actual length of the wall, including the five hundred-millionths, despite the fact that the fractional amount was lost in the reported value of the Length property itself.

April 11, 2007

BIM

Nigel Davies has an interesting post on BIM in this article at Eat Your CAD. Thanks to Tomislav Zigo for his post in Bimology for calling my attention to this article.

April 10, 2007

Multiple-Line Room Tags

There have been several recent requests for information on creating multi-line room tags in ADT/ACA. I thought I would collect the links I have been posting in a single article here, to make replying to future requests easier and to make certain I do not forget one or more of the resources.

Using Multiple Manual Properties to Enter the Room Name, And Then Combining Them in a Formula Property
This thread contains a sample file of an early version, done in ADT 2004, that supports two-line room names, from June 6, 2003. Download the sample from the file reposted on August 24, 2004.

In this thread, you will find a more clever formula, which supports three lines and could be easily expanded to even more lines, from January 25, 2005. That thread was also discussed in two blog articles, on July 4, 2005 and July 9, 2005.

Using a Single Manual Property to Enter the Room Name with MTEXT Codes, And Then Stripping the MTEXT Codes With a Formula Property
This Autodesk Knowledge Base article contains instructions on how to create a multi-line room tag using this approach.

Using a Single Manual Property [Driven by a List Definition in 2007 or Later], an Index Number and Multiple Formula Properties
Tomaslav Zigo posted this article to his blog showing a way to have a two-line room name tag populated from a single source and split at a user designated place without the need to type in MTEXT codes. This allows the use of List Definitions for the room name [and index] in 2007 and later, contrary to this previous post.

Multi-Line Attributues
Unfortunately, the new multi-line attributes added to AutoCAD® 2008 are not active when incorporated into a view block of a Multi-View Block Schedule Tag in AutoCAD® Architecture 2008. Here is hoping that feature makes its way into next year's release, so that a single attribute that does not need to be repostitioned can display multi-line room names and eliminate the need for fancy formulas.

April 06, 2007

Annotative Tags With Leaders in ACA 2008

The image above shows three interior walls drawn in AutoCAD Architecture 2008, with the out-of-the-box wall tag applied. Like all of the tags in 2008, the wall tag makes use of the new annotative scaling, as does the leader that is drawn as part of the tag tool function. These were created with the annotation scale set to 1/8" = 1'-0", as can be seen on the Drawing Window Status Bar. [Click on the image to see a larger version.] So, what happens when you change the annotation scale?
The image above shows the annotation scale being changed to 1/4" = 1'-0".
As you might expect, the tags have reduced to half of their size at 1/8" = 1'-0", maintaining their insertion points. The "arrow head" on the leader has also reduced in size by 1/2, but notice that the tag end of the leader remains stubbornly in the same place it was when it was created for the 1/8" = 1'-0" size of the tag, leaving a gap between leader and tag at 1/4" = 1'-0". Ideally, the leader end would have adjusted to the change in the tag.
Hovering over the leader of the A2 tag, as seen in the image above, causes the annotative icon to appear above and to the right of the cursor. The icon looks like the ends of two three-sided scales.
The end of the leader at the A2 tag has been grip edited to extend the end to the midpoint of the top of the tag at 1/4" = 1'-0". But will that also change the endpoint at 1/8" = 1'-0"?
As you can see in the image above, when the annotation scale is changed back to 1/8" = 1'-0", the end of the leader at that scale remains in its original position, and if you were to change it back to 1/4"=1'-0" again, the edit at that scale will be "remembered," as seen below.
So, while the leader end at the tag will not automatically move to maintain its relative position at the surrounding graphics of the tag as the tag changes sizes for different scales, you can manually edit the leaders and the endpoint location will be retained separately for each scale. This behavior applies to all leaders that have an annotative Dimension Style, which will come in handy when placing a room tag outside of a small room. You can now use a single leader on a single layer and have it work for every scale at which you will show the tag, with a little work to edit the leader endpoint to work with each scale.

April 01, 2007

ADT 2006 & Prior - Angular Automatic Properties

Here is a heads up for anyone using ADT 2006 and prior and making use of any of the automatic property sources that report the measurement of an angle, such as the Included Angle of an Arc, the Rotation of a Block Reference or the Roll of a Structural Member. The angular value will be reported based on the current setting of the AUNITS System Variable, and for any setting other than 0 [decimal degrees], the value will have non-numeric formatting attached - a suffix of "r" for radians; a suffix of "g" for grads; "d", "'" and """ for degrees/minutes/seconds; and "d", "'" and """ plus "N" or "S" and "E" or "W" for surveyor. The precision of the number will be based on that of the AUPREC System Variable, not that of the Property Data Format assigned to the automatic property.

If you want to use the anglar value for mathematical calculations in a formula property, assuming that AUNITS is set to 0 and AUPREC is set to a sufficiently high value will cause problems if AUNITS is set to anything else and may cause problems with accuracy if AUPREC is set too low. Also keep in mind that the VBScript angle functions take angular input in radians, so even if you have decimal degrees with appropriate precision, you will need to convert the value to radians first. There does not appear to be a constant for the value of PI in VBScript, so you will need to type that into your formulas manually, with sufficient precision for the task at hand. 3.14159265358979323846264...

The good news is that in ADT 2007, the value of angular automatic property sources are reported in unformatted radians, using the real number precision set in the assigned Property Data Format. If you are migrating formulas from 2004-2006 to 2007 or later that use automatic angles, you will have to adjust them to the changed source value, but at least you will have a consistent value from which to start.